A free ebook, as a PDF and an EPUB

Systematic debugging: a forensic guide to bugs that come back

Reproduce on a clean checkout, bisect in time and space, instrument instead of guessing, test one hypothesis at a time, and write the post-mortem that kills the whole family of bugs.

The PDF opens in a new tab. Your details go to learnwithparam only. This does not subscribe you to the newsletter.

Look insidePages from the PDF, as they print.

  1. Page 3: Most bugs get fixed twice because the first fix lands on the symptom.
    Page 3: Most bugs get fixed twice because the first fix lands on the symptom.
  2. Page 4: A repro script runs one failing test on a clean checkout of any commit.
    Page 4: A repro script runs one failing test on a clean checkout of any commit.
  3. Page 10: Sixty-four commits take six test runs to narrow to one.
    Page 10: Sixty-four commits take six test runs to narrow to one.
  4. Page 13: Log each decision with one request id, so the path tells its own story.
    Page 13: Log each decision with one request id, so the path tells its own story.
  5. Page 19: A surviving hypothesis is level one; ask why until it explains the family.
    Page 19: A surviving hypothesis is level one; ask why until it explains the family.
  6. Page 22: The one-page post-mortem names the cause, not the trigger, and blames no one.
    Page 22: The one-page post-mortem names the cause, not the trigger, and blames no one.

What the ebook covers

  1. 1

    Why most bugs get fixed twice

    The first fix lands on the symptom, so the bug comes back. Forensic debugging swaps guessing for evidence in six phases, in order.

  2. 2

    Reproduce before you theorize

    No reproduction, no debugging. Capture the exact inputs, environment and state, run them on a clean checkout, shrink them, and do not trust a failure that only happens sometimes.

  3. 3

    Bisect in time, code, load and data

    Binary search beats reading code in order. Bisect commits when a release broke it, the call graph when one service fails, concurrency when load does, and inputs when one tenant does.

  4. 4

    Instrument, do not assume

    Reading code tells you what could happen. Logs tell you what did. Log the decision at every branch with one request id, on the happy path and the failure path.

  5. 5

    Hypothesis loop and five whys to root cause

    State one hypothesis in one sentence, run the experiment that could prove it wrong, and update. When one survives, ask why five times and fix at the level you can afford.

  6. 6

    Post-mortem and harden

    The bug is not done until the regression test exists. A one-page blameless post-mortem records the timeline, the real cause and the changes that stop the family coming back.

  7. 7

    The page to keep and the questions people ask

    Every phase on one page, then short answers to what engineers search about systematic debugging.

See the lab this ebook comes fromTrace AI Agents in Production: Every agent run traced in Langfuse, a dashboard of cost, latency and failures per agent and per customer, and an alert before one goes over budget.