a new approach to software design analysis Daniel Jackson MIT - - PowerPoint PPT Presentation

a new approach to software design analysis
SMART_READER_LITE
LIVE PREVIEW

a new approach to software design analysis Daniel Jackson MIT - - PowerPoint PPT Presentation

a new approach to software design analysis Daniel Jackson MIT CSAIL ISSTA, Baltimore July 15, 2015 a retraction ISSTA, 1996 a sad story February 11, 2013 acrobat to the rescue what we hate ... & love from http://amplicate.com


slide-1
SLIDE 1

a new approach to software design analysis

Daniel Jackson · MIT CSAIL · ISSTA, Baltimore · July 15, 2015

slide-2
SLIDE 2

a retraction

slide-3
SLIDE 3

ISSTA, 1996

slide-4
SLIDE 4
slide-5
SLIDE 5

a sad story

slide-6
SLIDE 6

February 11, 2013

slide-7
SLIDE 7

acrobat to the rescue

slide-8
SLIDE 8

what we hate ... & love

from http://amplicate.com

slide-9
SLIDE 9

concepts

slide-10
SLIDE 10

what characterizes an app?

Apple Mail Microsoft Word Twitter EmailAddress Message Folder or Label Paragraph Format Style

concepts!

Tweet Hashtag Following Photoshop PixelMap Layer/Mask Adjustment

slide-11
SLIDE 11

concepts define classes

text editor line, buffer, character set paragraph, format, style word processor text flow, link, page template desktop publishing app

slide-12
SLIDE 12

where are Word’s concepts from?

Charles Simonyi: brought key concepts to Word from Xerox PARC

slide-13
SLIDE 13

rich concepts have long journeys

Bravo, 1974 Ginn & Co, since 1868 Microsoft Word, 1983 Apple Pages, 2005

slide-14
SLIDE 14

new, old & refurbished concepts

pre-existing concepts electoral vote purchase order social security number calendar event analogic concepts comment, tweet folder, label layer, mask friend, follower synthetic concepts: entirely new relative reference vacation bounce hashtag public key

even these were invented repurposed with a new role

  • ften enablers of

new technology

slide-15
SLIDE 15

so instead of this...

UI design soft & human about presentation programming hard & technical about content

slide-16
SLIDE 16

... a new (old) view

conceptual design: essential concepts & behavior representation design:

  • rganization &

performance

Layer Adjustment Mask PixelMap Brush

Fred Brooks Essence & accident

slide-17
SLIDE 17

it’s all about the concepts

Acrobat text box

  • bject

document text Photoshop channel layer mask Lightroom action treatment effect incoherent concepts, no clear purpose powerful concepts with low level purposes simple concepts with purposes aligned to common tasks

slide-18
SLIDE 18

purposes

slide-19
SLIDE 19

design is driven by purpose

contrivance

purpose

motivates fulfills?

slide-20
SLIDE 20

example: a photo wall

motivates fulfills? changeable wall display of prints

magnetic paint adhesive corners corkboard tiles

not strong enough

damages prints

slide-21
SLIDE 21

final design, executed

slide-22
SLIDE 22

purpose elaboration

in complex systems purpose is elaborated into subpurposes

purpose subpurpose subpurpose

slide-23
SLIDE 23

dropbox

share: control who can read your files sync: keep files on multiple machines consistent collaborate: support multi-user editing of documents store: expand space available by storing files in the cloud

slide-24
SLIDE 24

a hierarchy of purposes

manage files share collaborate sync

slide-25
SLIDE 25

the fundamental idea

in a well designed system each concept is motivated by one purpose

slide-26
SLIDE 26

construct and edit formatted documents structure document into units consistent formatting within document consistent formatting across documents apply formatting create and edit content

example: word processor

text paragraph format style stylesheet

slide-27
SLIDE 27

but what exactly is a concept?

slide-28
SLIDE 28

a timer

slide-29
SLIDE 29

a conceptual explanation

  • n: bool

time: Slot schedule: set Slot inv on = (time ∈ schedule) tick ≜ time := next(time) toggle (s: Slot) ≜ if s ∉ schedule then schedule := schedule ∪ {s} else schedule := schedule \ {s}

slide-30
SLIDE 30

a non-conceptual description

¬ON ¬ON ON ¬ON ¬ON ON ON ON tick toggle(day) toggle(night)

slide-31
SLIDE 31

a concept is...

an increment of functionality can be included independently of others that fulfills a purpose contributing to the system’s overall purpose with its own state visible to the user with its own actions performed by the user affecting the external world but often only indirectly

slide-32
SLIDE 32

formal models of concepts

  • n: bool

time: Slot schedule: set Slot inv on = (time ∈ schedule) tick ≜ time := next(time) toggle (s: Slot) ≜ if s ∉ schedule then schedule := schedule ∪ {s} else schedule := schedule \ {s}

what’s good what’s bad every behavior (helps get it all right) every behavior (irrelevant ones too) just what, not why (separation of concerns) just what, not why (no real meaning)

slide-33
SLIDE 33

the operational principle

a better way to define & explain a concept an archetypal scenario separates essential from accidental aspects shows how purpose is fulfilled by combination of user & system actions

Michael Polanyi

“if you pull a tab out, then when that time slot comes around, the light will go on”

slide-34
SLIDE 34

“if you change a style’s format, then all paragraphs of that style will change format accordingly” “if you tag a photo, then all friends of the person tagged will be able to see the photo” “if you select a file and it belongs to a folder with keyboard focus, then pressing delete will move the file to the trash” “if you pull a tab out, then when that time slot comes around, the light will go on”

slide-35
SLIDE 35

purposes, principles & misfits

concept: trash

  • perational principle: if you delete a file, it moves

to a special folder; you can restore from there, but emptying it removes contents for good purpose: allow undo of deletions

  • perational misfit: if you delete a file on an

external drive, you cannot reclaim the space until you empty the trash, but then you’ll lose the ability to restore files deleted from the main drive

  • perational misfit: if you delete an old file and

change your mind, you may not be able to find it again in the trash (if there are many deleted files and you forgot the file’s name)

slide-36
SLIDE 36

design structure

slide-37
SLIDE 37

concept dependences

stylesheet style paragraph format text

⟨c,c’⟩ ∈ depends ⇔ ∀a: apps · c ∈ concepts(a) ⇒ c’∈ concepts(a) concept dependence: can’t have style without format

David Parnas uses relation

slide-38
SLIDE 38

abstract concepts

stylesheet style paragraph format text paragraph style character style

abstract concept instantiation ⟨ci,c⟩ ∈ instantiates ⇔ (∀a: apps · c ∈ concepts(a) ⇒ ∃i · ci ∈ concepts(a))

slide-39
SLIDE 39

purpose hierarchy

⟨p,p’⟩ ∈ requires ⇔ ∀a: apps · p ∈ fulfills(a) ⇒ p’∈ fulfills(a)

construct and edit formatted documents structure document into units consistent formatting within document consistent formatting across documents apply formatting create and edit content

slide-40
SLIDE 40

purpose-concept mapping

⟨p,c⟩ ∈ motivates ⇔ ∀a: apps · p ∈ fulfills(a) ⇒ c ∈ concepts(a))

c

  • n

s t r u c t a n d e d i t f

  • r

m a t t e d d

  • c

u m e n t s s t r u c t u r e d

  • c

u m e n t i n t

  • u

n i t s c

  • n

s i s t e n t f

  • r

m a t t i n g w i t h i n d

  • c

u m e n t c

  • n

s i s t e n t f

  • r

m a t t i n g a c r

  • s

s d

  • c

u m e n t s a p p l y f

  • r

m a t t i n g c r e a t e a n d e d i t c

  • n

t e n t

stylesheet style paragraph format text

slide-41
SLIDE 41

analyzing designs

slide-42
SLIDE 42

the ideal mapping

P1 C1 P2 C2 purposes concepts

slide-43
SLIDE 43

4 bad smells

P1 C1 P2 P1 C1 C2 P1 C1 C2 P1 C1 P2

unfulfilled purpose unmotivated concept

  • verloaded concept

variant concepts

slide-44
SLIDE 44

unfulfilled purposes

P1 C1 P2

user (Apple Mail, Gmail) › ‘identify parties to communication’ › weak search, no authentication slide hierarchy (Powerpoint) › ‘structure slides in a tree’ › sections provide just one level aspect ratio (Sony A7Rii, Canon 5D3) › ‘take square image’ › can’t view in finder or save setting binder (Preview, Acrobat) › ‘maintain composite PDF doc’ › can insert pages, but forgets source

C2

leaf

slide-45
SLIDE 45

unfulfilled purpose Apple Mail

slide-46
SLIDE 46

P1 C1 C2

unmotivated concepts

buffer (emacs) › no reason not to save to file stash (Git) › addresses misfit in branching glue records (DNS) › addresses misfit of circular deps performance kludge kludge

slide-47
SLIDE 47

P1 C1 C2

variant concepts

rating stars (Lightroom) › colors, flags, stars, oh my! rules & searches (Apple Mail) › two ways to specify set of messages labels & categories (Gmail) › two ways to classify messages text object & text box (Acrobat 10) › document text too: all different permissions (AFS) › coexist with Unix permissions headline, title, caption (IPTC) › original purposes lost

slide-48
SLIDE 48

variant concepts apple mail

slide-49
SLIDE 49

variant concepts for subpurposes

specify subset of messages by feature automatic handling

  • f incoming messages

find message sent or previously received

rule search term filter search

slide-50
SLIDE 50

P1 C1 P2

  • verloaded concepts

Nam Suh independence axiom

No one can serve two masters. Either you will hate the one and love the other,

  • r you will be devoted to the one and despise the other. [Matthew 6:24]
slide-51
SLIDE 51

P1 C1 P2

  • verloaded concepts

conference review › feedback vs. selection call forwarding › follow-me vs. delegate contact (Apple address book) › shortcut vs. format addressee friends (Facebook) › filter posts vs. limit access signature (Acrobat 9) › digital vs. physical paper size (Epson printer driver) › dimensions vs. source Pamela Zave: Secrets of CF

slide-52
SLIDE 52
  • verloaded concepts epson driver

result: can’t create custom size for front loading

slide-53
SLIDE 53
  • verloaded concepts epson driver

paper size

select paper dimensions select paper source in printer

slide-54
SLIDE 54
  • rthogonality

P1 C1 P2 C2

  • rthogonality is violated when one

concept’s fitness for purpose is undermined by another concept

slide-55
SLIDE 55

P1 C1 P2 C2

non-orthogonal concepts

  • rigin, space, exclusion (CSS)

› 4 position values for 2×3×2 options conversation & label (Gmail) › same subject, get same label listserv & bcc (SMTP) › modified subject reveals target title & reply (Tumblr) › adding ? to title enables replies (!) group & selection (many old apps) › can’t select object in a group group & connector (Keynote 5.3) › can’t select box if connected Shriram Krishnamurthi BCC example

slide-56
SLIDE 56

non-orthogonality fuji x100s

slide-57
SLIDE 57

image quality setting

slide-58
SLIDE 58

aspect ratio

slide-59
SLIDE 59

“image size” setting

slide-60
SLIDE 60

non-standard ratio + RAW?

image quality undermines image size

slide-61
SLIDE 61

set ratio image size set image quality image quality

an orthogonality violation

set ratio image size set image quality image quality

  • verloaded concept too
slide-62
SLIDE 62

uniformity

C Ca Cb P C' C Ca Cb P P'

uniformity is violated when instantiations differ with respect to fulfillment of purpose ... directly or indirectly

slide-63
SLIDE 63

non-uniform concepts

deposits by check (banking) › funds arrive before clearing primitive type (Java) › not like a class type direct flight (Official Airline Guides) › 1 flight number, but >1 stop alerts (Apple iCal) › can’t select email alerts for default custom settings (Fuji x100s) › only some settings selectable

C Ca Cb P

slide-64
SLIDE 64

all’s well that ends well

slide-65
SLIDE 65

acrobat (version 09)

hard to discern any compelling concepts

slide-66
SLIDE 66

acrobat (version 10)

user interface has been reworked but still text, text box, object

slide-67
SLIDE 67

acrobat (version 11)

conceptual reworking: now just text

slide-68
SLIDE 68

(mis)applying classic analysis

slide-69
SLIDE 69

classic formal design analysis

system property ⇒

?

descriptions

defined expected

behaviors

John Guttag & Jim Horning Formal Specification as a Design Tool (1980)

concept

purpose ?

slide-70
SLIDE 70

misfit #1: purposes ⊈ goals

style: ‘consistent formatting’ doesn’t just mean do it once! means that it’s easy to maintain layer: ‘non destructive edits’ doesn’t just mean edit can be undone means that edits can be turned on/off, replayed request: ‘take user to chosen floor’ doesn’t mean don’t stop on the way doesn’t mean ‘eventually’

slide-71
SLIDE 71

misfit #2: errors ⊈ counterexamples

motivates fulfills? changeable wall display of prints

magnetic paint adhesive corners corkboard tiles

not strong enough

damages prints

✔ ✘

shields wifi signal and: strong enough, no damage to prints... Christopher Alexander misfits

slide-72
SLIDE 72

misfit #2: errors ⊈ counterexamples

projection: ‘visualize time-varying relation as cartoon’ a key concept in the Alloy visualizer bad flaw: independent layout of each cartoon frame

slide-73
SLIDE 73

misfit #3: user behavior isn’t fixed

motivates fulfills? changeable wall display of prints

magnetic paint adhesive corners corkboard tiles

not strong enough

damages prints

✔ ✘

requires 6 coats

slide-74
SLIDE 74

misfit #3: user behavior isn’t fixed

purpose: help align objects a design: autoalign a better design: snap align

slide-75
SLIDE 75

the root of the problem

The rôle of a formal functional specification is simply to act as a logical firewall between two completely different concerns... The pleasantness problem concerns the question whether a system... would satisfy our needs... The correctness problem concerns the question whether a given design meets such-and-such a formal functional specification. The logical firewall ... isolates computing science’s well-carved niche from the pleasantness problem to which science has little to contribute. Please note that I did not say that the one problem is more important than the other; after all, no chain is stronger than its weakest link. Edsger Dijkstra EWD952

slide-76
SLIDE 76

what were we analyzing?

Powerpoint schemes Indesign swatches Jackson & Damon, ISSTA’96 Microsoft Word

slide-77
SLIDE 77

a style concept idiom

concept name style purpose achieve consistent formatting of a set of elements known instances para and char styles in Word, Indesign, Pages, Keynote 6; Indesign swatches; Powerpoint themes; classes in CSS related to style buffer, stencil, master challenges as-is inheritance; partially defined styles; precedence when overlapping

slide-78
SLIDE 78

style idiom object model

Element style base Style rules Rule Property Value value property ! ! add ons Style next ? Style basedOn ? Stylesheet styles Style Style Name name variant Element style Name

slide-79
SLIDE 79

consistency style achieve consistent formatting of a set of elements master achieve consistent structure and format of composite elements stencil use archetypal objects for consistency and time saving style buffer reformat another object like a previous one to save effort preset allow setting of many properties at once

  • rganization

folder

  • rganize collection of items into a hierarchy

REST

  • rganize collection of resources by simple path names

group group items so they can be treated as a single item layer allow easy inclusion/exclusion of sets of items stack place items in stacking order for precedence selection apply action in aggregate to many items at once label add labels to items so they can be found later alias address one or more items with a shorthand name filter allow filtering of set of objects by their features property describe an object with properties that have values metadata sort and search for items using associated data navigation history keep past actions for audit, undo, visibility buffer provide temporary storage area for quick modification cursor provide shortcut entry into traversable document access access token control access to a resource in an easy way reservation allocate resources efficiently and prevent conflicts OOBA authenticate user with ‘out of bound’ channel unique to user communication message communicate in discrete packets between endpoints share a short communication by broadcast let a user know when something happens mediate communications by preapproved relationships

slide-80
SLIDE 80

design case studies

slide-81
SLIDE 81

small survey of MIT dropbox users

0% 20.0% 40.0% 60.0% 80.0% good knowledge average knowledge poor knowledge correctly predicting behavior

delete shared folder results in leaving delete shared subfolder removes it

Kelly Zhang

slide-82
SLIDE 82

gitless: a reworking of git

Santiago Perez De Rosso

slide-83
SLIDE 83

a sample git misfit

sample misfit you’re working in a branch and want to switch to another but there are uncommitted changes you can’t switch without overwriting work in the new branch you don’t want to commit unfinished work best option is to stash, but even that doesn’t work if conflicts diagnosis staging area, working directory and branch are coupled and stash is an unmotivated concept gitless: new concept of branch when you switch branches, the working directory changes with it and all uncommitted changes in the old branch are saved

slide-84
SLIDE 84

why is css so damn hard?

Lea Verou

  • ffset

space viewport space element space dimension width height exclusion

set visibility control layout container-dependent positioning set position set dims &

  • ffets

set overlap scrolling-independent positioning set width & height

hypothesis: driving design by use cases: gets hopelessly coupled a lesson for agile development?

slide-85
SLIDE 85

code analysis opportunities

are defects clustered around fragile concepts? predict where next defect will be? focus refactoring efforts? can concept coupling be inferred? map modules to concepts & look for interactions find needless dependences? compare code & concept dependences identify dependences due to implementation

slide-86
SLIDE 86

conclusions

slide-87
SLIDE 87

summary

concepts a better way to design software dependence graph shape an MVP explore radical redesigns

  • perational principle

lightweight test of a concept design concept-purpose mapping identify concepts to kill investigate overloaded concepts for misfits

slide-88
SLIDE 88

researcher seeking... nifty concepts troubled concepts get a reward! an ack & a concept T shirt for every example I use in my book

join the great concept hunt

dnj@mit.edu