04.4.5 · Skill in Engineering quality

Debugging

Finding the real cause of a problem systematically.

Good debugging is a method: reproduce, form a hypothesis, test it, narrow down. Tools like debuggers, logs and bisecting help. The same habit of evidence over guessing applies to product problems.

Your status · Debugging

Saved in this browser. Sign in to keep it on every device.It colours this skill's tile on your map.

Why it matters for a product engineer

Good debugging is a method: reproduce the problem, form a hypothesis, test it, and narrow down. It is faster than guessing, and it finds the real cause instead of hiding it. A product engineer debugs across the interface, the services and the data, and the same habit, evidence before fixes, works for product problems too.

How to do it

  1. Reproduce the problem, and write down the exact steps. A bug you cannot reproduce is still a question.
  2. Read the actual error message and the logs before you form a theory.
  3. Ask what changed: a deploy, a dependency, a configuration, the data.
  4. Form one hypothesis at a time, and design a test that could prove it wrong.
  5. Narrow down: bisect the commits, the input or the configuration until one change explains it.
  6. Understand the cause before you fix it. Then add a test, so it cannot return quietly.

Common mistakes

  • Changing several things at once, so you never learn which one mattered.
  • Fixing the symptom, such as catching an exception, without knowing the cause.
  • Trusting a report’s explanation instead of its facts.
  • Blaming the platform before checking your own code. Julia Evans finds the bug is her own “95% of the time”.

Example

In Trey Harris’s well-known story, a university department could not send email further than about 500 miles. He reproduced it: Princeton, 400 miles, worked; Memphis, 600 miles, failed. A server update had installed an older mail program that ignored his configuration and set the connection timeout to zero. That aborts a connection in about three milliseconds, the time light needs to travel about 558 miles.

Loop

The 500-mile email, as a debugging method

12345The 500-mile email2002
  1. 1Reproduce400 miles worked, 600 miles failed
  2. 2What changed?A consultant had updated the server
  3. 3Test a hypothesisThe configuration file was not altered
  4. 4Look closerThe server answered with an older mail program
  5. 5Explain all the factsTimeout zero: about 3 ms, about 558 miles

The report sounded impossible, but it was a measurement. Taking it seriously, and reproducing it, led straight to the cause.

ReportedTrey Harris, post to the SAGE mailing list, 24 Nov 2002

Sources: A debugging manifesto (Julia Evans) ↗ · The case of the 500-mile email (Trey Harris) ↗

AI leverage

Use AI in your work

Use AI to support this skill. Your judgment and verification remain part of the work.

Workflow
Give an assistant a minimal reproduction and redacted traces to propose causes and discriminating experiments.
Limitations
Plausible explanations can anchor investigation on the wrong cause, and a patch may only hide the symptom.
Verification
Reproduce the failure, test competing explanations and confirm the fix with a regression case.

Technical leverage

Trace behavior across UI, services and storage, then connect the technical cause to its user impact.

Evidence of mastery

Put it into practice
Practice
Investigate a real defect from report through verified fix.
Artifact
A minimal reproduction, causal explanation and regression check.

What good looks like

  • The check fails before the fix and passes after it.
  • The explanation accounts for the original symptom.

Use this evidence to assess your work. Your map status is a self-assessment, not a certification.

Resources

1
  • articleStart here
    A debugging manifesto ↗
    Julia Evans · 2022 · 4 min

    Short principles for debugging well, from trusting nobody to reading the actual error message.

Tools

2
Tools for Engineering quality