On the Art of Debugging Software

Excerpt from Mager, Troubleshooting the Troubleshooting Course, 1982:

A 1979 study by Cutler (Problem Solving in Clinical Medicine) made an observation about the importance of probability information by offering three maxims for diagnosticians:

  • Common diseases occur commonly.
  • Uncommon manifestations of common diseases are more common that common manifestations of uncommon diseases.
  • No disease is rare to the person who has it.
It is interesting to translate these maxims into the language of equipment and troubleshooting. They come out this way:

  • Common troubles occur frequently.
  • Unusual symptoms of common troubles occur more often than common symptoms of uncommon troubles.
  • No trouble is rare to the client who has it.
Mager’s book is mostly about equipment troubleshooting. More specifically, training courses on troubleshooting, their flaws, and how to fix them. The anecdotes in the book deal with the diagnosis of appliances, manufacturing equipment, radars, etc., but I was delighted by how relevant they are to diagnosing issues in software.
Most software engineers have a crazy bug story or two (or twenty) but it’s rarely a true “crazy bug.” It’s usually a typical bug like a race condition, off-by-one, uninitialized variable, memory leak, misinterpreted API, etc. that manifested itself in an extremely odd way.
Updating Cutler and Mager:
Uncommon behavior resulting from common software defects occur more often than common behavior of uncommon software defects.

Leave a Reply