A few days ago I read an article on Dr. Dobbs written by Peter Eastman. Eastman describes a concept of bug opportunities in bodies of code. He divides the bug opportunity into a set of levels, creating a simple taxonomy for bug opportunity classification:
- There is no opportunity to make a mistake
- If there is an error, it will be caught at compile time
- If there is a bug, it will result in a runtime error describing the problem
- If there is a bug, the program will work incorrectly
- If there is a bug, it will cause an unrelated part of the program to work incorrectly
After consuming the article it came to me that the levels could be extended even further, with the following:
Level 5. Misinterpretation of reference source or specification
Level 6. Error in reference source or specification
Let’s break down level 5.
This is the bug where your program runs perfectly unit-tests suite passes and everything. But the implementation is error prone and buggy in the sense that it does it is not correct an example could be adding taxes several times to a price (I have seen this one in production).
One of the problems that here is that the unit-tests are written by the same developer, who also wrote the implementation code for the application in question. So one could argue that the bug is first present in the test suite since it does not demonstrate the presence of the bug in the application code.
Level 6, is somewhat related to 5. But on a higher level, where the people who provided you with reference or specification got it wrong. An example could be… NASA (Lost in Space) – I am not sure of all the details in this case, but it does sound like a specification related bug.
Pair programing, dedicated testers and code review are of course all good remedies for many of the above examples. The taxonomy is however quite interesting in relation to bug hunting in your development process/method.
For more expensive bugs check:
- http://royal.pingdom.com/2009/03/19/10-historical-software-bugs-with-extreme-consequences/
- http://en.wikipedia.org/wiki/List_of_software_bugs
0 Comments.