Debugging Flashcards

1
Q

Failure reproduction

A

a matter of identifying inputs to the program (whether data it receives upon being executed, user inputs, network traffic, or any other form of input) that causes the failure to occur.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

localize the defect

A

trying to identify the cause of the failure in code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

steps to localize (hypothesis):

A
  1. Observe failure
  2. Form hypothesis of cause of failure
  3. Devise a way to test hypothesis, such as analyzing the code you believe caused it or executing the program with the reproduction steps and stopping at the line you believe is wrong
  4. If the hypothesis was supported (meaning the program failed for the reason you thought it did), stop. Otherwise, return to 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

work backwards to localize:

A
  1. Observe failure
  2. Identify the line of code that caused the failing output
  3. Identify the lines of code that caused the line of code in step 2 and any data used on the line in step 2
  4. Repeat three recursively, analyzing all lines of code for defects along the chain of causality
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

delta debugging

A

compare successful and failing executions of the program.

  1. Identify a successful set of inputs
  2. Identify a failing set of inputs
  3. Compare the differences in state from the successful and failing executions
  4. Identify a change to input that minimizes the differences in states between the two executions
  5. Variables and values that are different in these two executions contain the defect
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

work forward to localize:

A
  1. Execute the program with the reproduction steps
  2. Step forward one instruction at a time until the program deviates from intended behavior
  3. This step that deviates or one of the previous steps caused the failure
  • easy to follow, but can take a long time because there are so many instructions that can execute.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly