| |
Errors and Bugs
Bugs and disasters
Errors and Bugs
"Program testing can be used to show the presence of bugs, but never to show their absence!" Edsger Dijkstra
and
If debugging is the process of removing software bugs, then programming must be the process of putting them in. Edsger Dijkstra
The term bug is remarkably evocative and incredibly imprecise. It’s easy to throw words around without really understanding what they mean. Using more specific terminology helps us to define what we’re doing. These definitions are inspired by IEEE literature (IEEE 84):
Error An error is something that you do wrong. It is a specific human action that results in software containing a fault. For example: Forgetting to check a condition in your code (like the size of a C array before indexing into it) is an error.
Fault A fault is the consequence of an error, embodied in the software. I made an error, and this resulted in a fault in the code. At first, this is a latent problem. If the code I’ve just written is never executed, then this fault will never have a chance to cause problems. If execution often passes through the faulty code, but never in the particular way that triggers the fault, we’ll never notice that there is a fault at all. This subtle point is what makes debugging notoriously difficult. A faulty line of code may seem fine for years, and then one day it causes the most bizarre system tantrum you’ve ever seen; you won’t suspect the aged code since it’s been reliable for so long. You might discover a fault in a code review, but you can’t identify a fault from a running program.
Failure When encountered, a fault may cause a failure. It may not. The failure, the manifestation of the fault, is what we really care about. It’s probably the only thing we’ll take notice of. A failure is the departure of your program’s operation from its requirements, from its expected behavior. This is where we verge on philosophy. If a tree falls over in a forest, does it make a sound? If the running program doesn’t exercise a bug, is the mistake still a fault? These definitions help to answer this.
Bug The term bug is a colloquialism, often used as a synonym for fault. According to folklore, the first computer bug was an actual bug. It was discovered by Admiral Grace Hopper in 1947 at Harvard. A moth trapped between two electrical relays of the Mark II Aiken Relay Calculator caused the whole machine to shut down.
Linguistic mistake Various kinds of errors such as spelling, typographical, grammatical, semantic, lexical, and stylistic ones are Linguistic errors, and most of time they are of trivial importance. An important amount of errors (23%) are due to lexical errors (usually things like typos).
Visual mistake Wrong font, css error, wrong rendering, or wrong colour are most of time of trivial importance for functionality but should not be present in beta releases of the product.
|
|