In software debugging, the detective method is a systematic approach. We have a general set of steps:
- Observe: inspect problem state, validate/invalidate hypothesis.
- Like viewing
stdoutor inspecting variables with the debugger.
- Like viewing
- Hypothesise: develop potential cause for observed behaviour.
- Segfault caused by illegal out of bounds array access.
- Predict: what’s the expected behaviour for hypothesised cause?
- i.e.,
var iwill exceedclass.size()at some point.
- i.e.,
- Experiment: perform a controlled experiment to verify prediction.
- Re-run an identical scenario in the debugger.