552
Debugging
alternative explanation exclusion, 28-29
applying Lord Peter Wimsey to, 36
applying Professor Solomon to, 50
applying Schoenfeld to, 185
applying Sherlock Holmes to, 19
camouflage effect, 55-56
cause elimination, 28, 38
cross-disciplinary knowledge, 19-20
curiosity, 39
defined, 9
detecting vs., 26
development methodologies and, 8-12
domestic drift, 53-54
by editing, 10
eureka zone, 58
fact focus, 20-21
fact gathering, 23-25
fact organization, 42-43
gestalt understanding, 45-46
by interacting, 11
logic, 40-41
observations, 25-27
output, turning off, 307
possibilities, enumerating, 41--42
reasoning based on facts, 40
reasoning in both directions, 29-30
red herrings and, 30-31
by repeating, 11
search caution, 44
search record, 57
side effects as clues, 36-38
techniques, 510-12
testing vs., 8-9
by thinking, 10-12
unusual details, attention to, 21-23
Debugging heuristics, 201-19
categorize the problem, 208-12
choose a hypothesis (from historical data),
216-17
create a test case, 203-7
defined, 185
describing the problem, 212-13
draw a diagram, 215
explain the problem (to someone else),
213
list of, 201
recall a similar problem, 214-15
reduce required input, 207-8
review, 217-19
stabilize the problem, 202-3
Debugging infrastructure, 466-69
assertions, 469
augmented data structures, 466-67
augmented procedures, 467-68
specialized interactive debuggers, 468-69
Debugging strategies, 189-99
binary search, 190-91
breadth-first search, 192-93
choosing, 197-99
deductive-analysis, 196
defined, 185
depth-first search, 193-94
evaluation mechanisms, 189-90
greedy search, 191-92
inductive-analysis, 196-97
program slice, 195
review, 199
Debugging tactics, 185, 221-56
assert assumptions, 237-39
change storage class, 249-51
check data structures, 239-40
compile to assembly code, 252-54
defined, 185
different compiler, 251-52
different platform, 255-56
display data structures, 240-42
display execution messages, 227-30
display procedure arguments, 230-32
display variable values, 225-27
force variable value, 236-37
generate a flow trace, 232-33

Get Debugging by Thinking now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.