Debugging is not testing but often occurs as a consequence of testing.5 Referring to
Figure 17 .7 the debugging process begins with the execution of a test case. Results
are assessed and a lack of correspondence between expected and actual perlorm
ance is encountered. In many cases, the noncorresponding data are a sl,mptom of
an underlying cause as yet hidden. The debugging process attempts to match sy,rnptom
with cause, thereby leading to error correction.
The debugging process will usually have one of two outcomes: (1) the cause r,vill
be found and corrected or (2) the cause will not be found. In the latter case, the person
perlorming debugging may suspect a cause, design a test case to help validate
that suspicion, and work toward error correction in an iterative fashion.
why is debugging so diflficult? In all likelihood, human psychology (see section 17.8.2) has more to do with an answer than software technology. However, a few characteristics of bugs provide some clues:l. The symptom and the cause may be geographically remote. ThaI is, the
symptom may appear in one part of a program, while the cause may actually
be located at a site that is lar remov(id. Hlghly coupled components
(Chapter 8) exacerbate this situation.
2. The slrnptom may disappear (temporarily) when another error is corrected.
3. The synptom may actually be caused by nonerrors (e.g., round_off
inaccuracies).
4' The symptom may be caused by human error that is not easily traced