Debugging Hacks: What They Never Taught You About Solving Hard Bugs

Carefully crafted in 04 Mar 2008

![](/assets/debugging-hacks-what-they-never-taught-you-about-solving-hard-bugs-1.jpg “”)

All right, second tutorial: What They Never Taught You About Solving Hard Bugs.

Hard core grade presentation for programmers. How many of you spent days, weeks or even months fixing the weirdest, unreproducible bug in your app ? I have a few times.

This is presented by Marc Hedlund (blog) from Wesabe.

Short story for an elaborated and fun tutorial, it all goes around detailing this simplified high level procedure to track and eliminate bugs:

  1. Revert any changes you made loking for a quick fix.
  2. Collect data from each of the components involved.
  3. Reproduce the bug and automate it.
  4. Simplify the bug conditions as much as possible
  5. Look for connections and coincidences in the data.
  6. Brainstorm theories and test them.7. When you find a fix, verify it against the report.
  7. Check you haven’t created new bugs

You may need to do it repeatedly. You may decide that the cost is too hight. It may take several poepple to final close it but this approach almost always work.

One of the attendees mentioned the holly grail of bug tracking: logfiles. Log everything to files, with detail. The overhead and costs are minimal these days. Have your servers time synced to the second. Users do provide weak reports on the problems, logfiles will be your best friend at the worst times. I couldn’t agree more.

Suggested books by Marc:

Why programs fail. A guide to Systematic Debugging. Andreas Zeller. - The pragmatic Programmer. Andrew Hunt, David Thomas. - How to solve it. A new aspect of mathematical method. G. Polya. - How Doctors Think. Jerome Groopman, M.D. - Emotions Revealed. Recognizing Faces. Paul Ekman. - And of course, Sir Arthur Conan Doyle. The complete Sherlock Holmes. Vol 1.

I’ll try and get the tutorial later.

Comments

comments powered by Disqus