Tom's Levels of Bug Difficulty
Computer programming is an art but it is guided by the bugs
we come across. Like Dudley's Criteria for the levels of mathematical difficulty,
there are several levels of bug difficulty.
- Immediate: you see the bug as you type it and
so can fix it right away.
- Syntax: easy to find because the compiler tells
you it is there.
- Snowball: The compiler snowballs and gives you
1000 errors because you missed a comma. Fix the first error and the
other 999 will mostly go away.
- Output is obviously wrong: you can trace the
- Output looks ok but on detailed inspection has a
flaw: you can trace the problem.
- Output is fine to inpections but special cases are
The only approach is to think hard and see that the code covers
all bases. Have the program carefully check all input
for flaws to protect the inner code.
- Program crashes mysteriously with a core dump:
Adding write statements to locate the point of failure, or turning on
debugging, makes the program run just fine.
This could be a compiler error - but proving that requires cutting
the problem down to the smallest possible example.
- The bug is smarter than you are: Tough luck!
It is still there but you are not smart enough to
find it! For this reason the airplane will crash.
origin: 2004 Jul 31
updated: 2007 Mar 07
U.S. Department of Health and Human Services
National Institutes of Health
National Cancer Institute