Page 196 - DCAP405_SOFTWARE_ENGINEERING
P. 196
Unit 11: Testing Strategies
The symptom may be caused by a human error that is not easily traced. Notes
The symptom may be result of timing problems rather than processing problems.
It may be difficult to accurately reproduce input conditions (e.g. a real time application in which
input ordering is indeterminate).
The symptom may be intermittent. This is particularly common in embedded systems that
couple hardware with software inextricably.
The symptom may be due to causes that are distributed across a number of tasks running on
different processors.
11.6.2 Debugging Approaches
The debugging approach can be categorized into various categories. The first one is trial and
error. The debugger looks at the symptoms of the errors and tries to figure out that from exactly
which part of the code the error originated. Once found the cause, the developer fixes it. However,
this approach is very slow and a lot of time and effort goes waste.
The other approach is called backtracking. Backtracking means to examine the error symptoms
to see where they were observed first. One then backtracks in the program flow of control to a
point where these symptoms have disappeared. This process identifies the range of the program
code which might contain the cause of errors. Another variant of backtracking is forward tracking,
where print statements or other means are used to examine a sequence of intermediate results to
determine the point at which the result first becomes wrong.
The third approach is to insert watch points (output statements) at the appropriate places in the
program. This can be done using software without manually modifying the code.
The fourth approach is more general and called induction and deduction. The induction approach
comes from the formulation of a single working hypothesis based on the data, analysis of the
existing data and on especially collected data to prove or disprove the working hypothesis. The
inductive approach is explained in Figure 11.1.
Figure 11.1: The Inductive Debugging Approach
cannot
Locate Organize Study Devise a
pertinent the the hypothesis
data data relationships
can cannot
Prove
the hypothesis
can
Fix the error
Task Analyze the various categories in which the debugging approaches can be
categorized.
LOVELY PROFESSIONAL UNIVERSITY 189