Debug software with a repeatable process

8 steps · about 3 h 30 min · Intermediate

  1. Know your debugging tools (guide, MDN, 20 min)

    Use inspection, console, network and debugger views deliberately.

  2. Read the failure carefully (guide, MDN, 25 min)

    Turn error types and stack information into an initial hypothesis.

  3. Step through execution (doc, Python, 30 min)

    Pause, inspect state and follow control flow instead of guessing.

  4. Add useful diagnostic logs (doc, Python, 30 min)

    Capture context and transitions without scattering print statements.

  5. Find the change that caused it (guide, Git, 25 min)

    Use blame and bisect when a regression is tied to history.

  6. Turn the symptom into an assertion (doc, pytest, 25 min)

    Create a precise failing example before changing implementation code.

  7. Control external dependencies (doc, pytest, 25 min)

    Reproduce edge cases without relying on unstable outside systems.

  8. Leave better diagnostics behind (guide, Python, 30 min)

    After the fix, improve observability so the next failure is faster to understand.