CS 160 Lecture 21 Professor John Canny Fall

  • Slides: 38
Download presentation
CS 160: Lecture 21 Professor John Canny Fall 2004 3/9/2021 1

CS 160: Lecture 21 Professor John Canny Fall 2004 3/9/2021 1

Design for Errors 4 Some favorite error messages: * 404 not found * Fatal

Design for Errors 4 Some favorite error messages: * 404 not found * Fatal error 312: aborting * Syntax error near line 1025 * Internal compiler error * Segmentation fault: core dumped * Add your favorite here: 3/9/2021 2

Design for Errors 4 Some favorite error messages: * 404 not found * Fatal

Design for Errors 4 Some favorite error messages: * 404 not found * Fatal error 312: aborting * Syntax error near line 1025 * Internal compiler error * Segmentation fault: core dumped 4 What do these messages communicate? 4 What is the solution to each? 3/9/2021 3

Naïve users 4 Fatal error 312: * User messed up and someone will die

Naïve users 4 Fatal error 312: * User messed up and someone will die (computer? ). * Solution: log off and pretend nothing happened. 4 404 not found * The computer misplaced something (the “ 404”? ). * Solution: Maybe it will find it if you try later… 4 Segmentation Fault: core dumped * Something bad happened * Solution: someone will probably have to clean out the “core” stuff that was dumped inside the computer. 3/9/2021 4

More sophisticated users 4 Segmentation fault: core dumped * This lazy programmer slept through

More sophisticated users 4 Segmentation fault: core dumped * This lazy programmer slept through their programming classes and didn’t learn about array bounds checking, invariants or memory management. * Solution: Move them to the user support hotline 3/9/2021 5

More sophisticated users 4 404 + the other messages * Why can’t programmers explain

More sophisticated users 4 404 + the other messages * Why can’t programmers explain what is wrong in normal English? * Why do the messages sound like bad movie titles? “fatal error” etc. * Why do programmers usually assume that its the user that did something wrong when their silly program crashes? 3/9/2021 6

User Testing 4 Solution for programmers: * Test out error messages in person on

User Testing 4 Solution for programmers: * Test out error messages in person on your boss. * E. g. walk into office, say “segmentation fault: core dumped”, deposit printout of memory on their desk, and walk out. 4 Why isn’t this is good idea? 4 Why would you put it into a program? 3/9/2021 7

Human error recovery 4 People make mistakes in communication all the time, and are

Human error recovery 4 People make mistakes in communication all the time, and are adept at repairing them. 4 Repair need not involve assignment of blame. 4 E. g. “I’m sorry, I didn’t understand. Can you rephrase? ” * Tells the speaker you heard what they said, but were unable to interpret it. They should repeat, but express it differently. * There is no assertion that what they said was ungrammatical or incorrect, and you accept some blame by default. 3/9/2021 8

Human error recovery 4 Aside: People attribute personality based on the kind of language

Human error recovery 4 Aside: People attribute personality based on the kind of language others use. 4 For instance, psychologists have analyzed the personality of writers, politicians etc. from their writings. 4 They can classify them using standard personality categories, Like Myers-Briggs 4 People interact better with others when their personalities are compatible. 3/9/2021 9

Human error recovery 4 Reeves and Nass studied human interaction with text-based OS’es, found

Human error recovery 4 Reeves and Nass studied human interaction with text-based OS’es, found that similar results apply. 4 i. e. people have better interactions with text interfaces when the system’s (text) personality is compatible with theirs. 4 MS help wizards are a consequence of this work. 3/9/2021 10

Humane error recovery 4 In human communication, an error is the beginning of a

Humane error recovery 4 In human communication, an error is the beginning of a process of repair. It is “normal” to make errors. 4 In human-machine interaction, errors normally lead to the end of the current task. Errors are treated as “abnormal”. 4 In other words, application programs often try to escape from the repair process, leaving the user stranded. 3/9/2021 11

Types of errors 4 Mistakes * User intended to do what they did, and

Types of errors 4 Mistakes * User intended to do what they did, and it led to an error. User would probably do the same thing again. 4 Slips * User did not mean to do what they did. They can recover by doing it differently again. * Slips are not just for beginners. Experts often make them because they devote less conscious attention to the task (or mere presence or “demo” effects). 3/9/2021 12

Minimizing Error 4 System errors: Program defensively (assert, bounds check (please!!)) 4 Estimated loss

Minimizing Error 4 System errors: Program defensively (assert, bounds check (please!!)) 4 Estimated loss of productivity due to Windows OS crashes $170 B. 4 Estimate for Windows XP over $20 B. 4 Note: most Windows XP exploits have been standard buffer overruns. 3/9/2021 13

Minimizing Error Omission of array-bound checking, esp. in I/O code, has no possible justification

Minimizing Error Omission of array-bound checking, esp. in I/O code, has no possible justification in a modern computer. 4 Its sometimes justified on the basis of impact on performance (speed). 4 If you believe that argument, you can make your car “faster” by removing its brake pads (the small air gap slows the car). 4 Think about orders of magnitude – between instruction cycles and network/file system speed. 4 Note: 3/9/2021 14

Minimizing Error 4 User errors: * Use Intuitive command names. * Include short explanations

Minimizing Error 4 User errors: * Use Intuitive command names. * Include short explanations as “tool tips”. * Put longer explanations in help system. 3/9/2021 15

Minimizing Error 4 Recognition over recall * Easier to select a file icon from

Minimizing Error 4 Recognition over recall * Easier to select a file icon from a folder than to remember and type in the filename. * Auto-completion can help fix this. 4 Use appropriate representations * E. g. graphical file selector good for choosing individual files * Textual file names support automation, richer organization (using command line options). 3/9/2021 16

Typical Errors 4 From Norman’s 1983 survey: 4 Mode errors: * User forgets what

Typical Errors 4 From Norman’s 1983 survey: 4 Mode errors: * User forgets what mode they’re in, and does the command appropriate for another mode. * Digital watches, VCRs etc. 3/9/2021 17

Mode Errors 4 Why are mode errors so common in certain devices (watches, VCRs)?

Mode Errors 4 Why are mode errors so common in certain devices (watches, VCRs)? 4 Several attributes: * There aren’t enough command keys for all the operations – so the mode determines what each button does. * There isn’t enough display space to provide strong feedback about the mode. 3/9/2021 18

Mode Errors 4 Solutions: * Strive for consistent behavior of buttons across modes. *

Mode Errors 4 Solutions: * Strive for consistent behavior of buttons across modes. * Provide display feedback about behavior of keys in the current mode. * Provide an option for scrolling help tips if possible. * Allow the device to be programmed externally (e. g. from a PC with Bluetooth). 3/9/2021 19

Mode Errors 4 If you don’t have a tiny screen, then make the context

Mode Errors 4 If you don’t have a tiny screen, then make the context clear! 4 i. e. use color, tabs, navigation graphics etc. to make clear to the user “where” they are in the interface. 3/9/2021 20

Typical Errors 4 Description error: * The action is insufficiently specified by the user.

Typical Errors 4 Description error: * The action is insufficiently specified by the user. * User may not know all the command line switches, or all the installation options for a program. * Solution: Warn the user that the command is ambiguous, or “unusual”. Provide help about options in several standard ways. 3/9/2021 21

Typical Errors 4 Capture error: (aka the tongue twister error) * Command sequences overlap,

Typical Errors 4 Capture error: (aka the tongue twister error) * Command sequences overlap, and one is more common. * User reflexively does the common one when trying to do the unusual one. * E. g. try typing “soliton” very fast. 4 Solution: be aware of and test for this error. Try different command names. 3/9/2021 22

Detecting Errors 4 The earlier the better: * Check for consistency whenever possible (“asserts”

Detecting Errors 4 The earlier the better: * Check for consistency whenever possible (“asserts” for user input). * If there’s a high risk of error, check for unusual input, or for common slips (spelling correction). 4 E. g. google’s “did you mean XX? ” response 3/9/2021 23

System Response 4 Stop the user from continuing the way they were going (and

System Response 4 Stop the user from continuing the way they were going (and possibly compounding the error). 4 Take “safe” recovery actions - e. g. auto-save the state with a unique name. 4 Begin the recovery process… 3/9/2021 24

Break 3/9/2021 25

Break 3/9/2021 25

Recovery 4 Gag 4 Warn 4 Do Nothing 4 Self Correct 4 Teach Me

Recovery 4 Gag 4 Warn 4 Do Nothing 4 Self Correct 4 Teach Me 4 Let’s talk about it 3/9/2021 26

Gag Response 4 Machine freezes, often not even accepting input. 4 Generally a bad

Gag Response 4 Machine freezes, often not even accepting input. 4 Generally a bad idea, but there are good(? ) uses: * Raskin’s FLOW system, refuses to accept keystrokes that are not legal commands. * Intended for naïve users. * Even random typing produces legal programs! 3/9/2021 27

Warn Response 4 Machine accepts input, even if not legal. Warns user about problem(s).

Warn Response 4 Machine accepts input, even if not legal. Warns user about problem(s). 4 Allows user to get into deeper trouble. 4 Allow backtracking “undo”, back to start of trouble if possible. 3/9/2021 28

Do Nothing Response 4 Machine accepts input, even if not legal. Machine does nothing

Do Nothing Response 4 Machine accepts input, even if not legal. Machine does nothing 4 User has to figure out that something’s wrong. 4 Usually a bad idea, but can be useful in automation/DB queries – * It allows scripts/queries to continue executing, but e. g. don’t copy a file onto itself. 3/9/2021 29

Self Correct 4 DWIM (Do What I Mean) was an aggressive self-correcting system. Spell

Self Correct 4 DWIM (Do What I Mean) was an aggressive self-correcting system. Spell checkers are of this type. 4 Generally good but: * Sometimes override user intent. * Can frustrate on frequently-used strings: “naïve” is good but not “Hsi”. * Solutions: + Don’t repeat correction if overridden. + Watch user behavior over time. 3/9/2021 30

Let’s talk about it 4 Inspired by human error recovery. * Machine explains its

Let’s talk about it 4 Inspired by human error recovery. * Machine explains its understanding of the situation, gives the user some options. * Examples: network diagnostic wizard, modem wizard, … 4 Very difficult to program these, but they’re very valuable. * Need some analysis of previous user problems. * Look at help desk logs. 3/9/2021 31

Teach Me 4 System informs user what they can do. 4 Common in speech

Teach Me 4 System informs user what they can do. 4 Common in speech recognizers. Include command “what can I say? ”, or run speech tutorial. 3/9/2021 32

Explanations 4 The first part of the recovery process is to explain what appears

Explanations 4 The first part of the recovery process is to explain what appears to be wrong. 4 Remember the user is only supposed to have a functional model of what’s going on. Try to give an explanation at high level. 4 People understand basic resources like filespace, memory etc. 4 “I’m afraid the program has an internal fault in the code that <<reads and writes files>>, which was called when trying to <<save your user preferences>>. We regret the inconvenience, and are trying to recover…” 3/9/2021 33

Recovery 4 The system should always give the user a reasonable amount of information

Recovery 4 The system should always give the user a reasonable amount of information about the problem. 4 Better to err on the side of too much information. 4 Some problems are amenable to automatic repair: retry, use redundant information, backup data etc… 4 DWIM (Do What I mean) was an editor that attempted to correct common user errors. You need an “undo” key to use this approach. 3/9/2021 34

Recovery 4 Run a “diagnostic wizard” for common or unreliable subsystems (e. g. the

Recovery 4 Run a “diagnostic wizard” for common or unreliable subsystems (e. g. the network). 4 These can interact with the user to get extra information needed to fix the problem. 3/9/2021 35

Research Approaches 4 Intentional interfaces: build models of user intention from their actions. 4

Research Approaches 4 Intentional interfaces: build models of user intention from their actions. 4 Assumes that people have clear goals that the system can understand. 4 Can get confused if people multi-task or do sub-optimal things. 3/9/2021 36

Research Approaches 4 Accountable systems: The system maintains a user-oriented model of internal behavior,

Research Approaches 4 Accountable systems: The system maintains a user-oriented model of internal behavior, somewhere between a structural and a functional model. 4 If an error occurs, this “account” can give a sensible explanation, and often recovery suggestions. 3/9/2021 37

Summary 4 Error messages are often masterpieces in bad communication. That’s not necessary. 4

Summary 4 Error messages are often masterpieces in bad communication. That’s not necessary. 4 Error recovery is a “normal” process. 4 Types of errors: slips and mistakes. 4 Some common error types. 4 Five responses to errors. 4 Recovery. 4 Research approaches. 3/9/2021 38