Hypothetical Debugging

Posted on

When debugging problems I find it useful to form an explicit hypothesis at every stage. The process goes something like this:

  1. Form a hypothesis.
  2. Gather data to prove or disprove that hypothesis.
  3. Repeat.

The key insight is that we always have a hypothesis — the problem is when it stays implicit. An implicit hypothesis doesn’t get tested; it gets assumed. Making it explicit forces you to test it rather than assume it.

For me, it is often a misplaced assumption which causes me to go round in circles debugging an issue. Writing down “I think the problem is X because Y” and then specifically looking for evidence that disproves it is a different mental mode to vaguely poking around with a hunch.