Debugging
-
Upload
indu-sharma -
Category
Education
-
view
298 -
download
0
Transcript of Debugging
![Page 1: Debugging](https://reader036.fdocuments.us/reader036/viewer/2022092622/587aa6f91a28abed218b4af1/html5/thumbnails/1.jpg)
Debugging
Indu Sharma
HOD(CSE) CPTC,
Rajsamand
![Page 2: Debugging](https://reader036.fdocuments.us/reader036/viewer/2022092622/587aa6f91a28abed218b4af1/html5/thumbnails/2.jpg)
Introduction Debugging occurs as a consequence
of successful testing. That is, when a test case uncovers an error, debugging is the process that results in the removal of the error.
Debugging has the objective: to find and correct the cause of a software error.
![Page 3: Debugging](https://reader036.fdocuments.us/reader036/viewer/2022092622/587aa6f91a28abed218b4af1/html5/thumbnails/3.jpg)
Debugging Process
TestCases
ExecutionOf cases
Results
Debugging
Additional test
SuspectedcausesRegression
test
CorrectionsIdentifiedcauses
![Page 4: Debugging](https://reader036.fdocuments.us/reader036/viewer/2022092622/587aa6f91a28abed218b4af1/html5/thumbnails/4.jpg)
Debugging Process The debugging process begins with the
execution of a test case. Results are assessed and a lack of
correspondence between expected and actual performance is encountered.
The debugging process will always have one of two outcomes:
1. The cause will be found and corrected, or2. The cause will not be found.
In the latter case, the person performing debugging may suspect a cause, design a test case to help validate that suspicion, and work toward error correction in an iterative fashion.
![Page 5: Debugging](https://reader036.fdocuments.us/reader036/viewer/2022092622/587aa6f91a28abed218b4af1/html5/thumbnails/5.jpg)
Debugging Approaches In general, there are three
categories for debugging approaches:
1. Brute Force2. Backtracking3. Cause Elimination
![Page 6: Debugging](https://reader036.fdocuments.us/reader036/viewer/2022092622/587aa6f91a28abed218b4af1/html5/thumbnails/6.jpg)
Brute Force Take memory dumps, invoke run time
traces, program is loaded with PRINT statements.
We hope that in the mass of information that is produced we will find a clue that can lead us to the cause of an error.
Least efficient and quite common. More frequently leads to wasted effort
and time.
![Page 7: Debugging](https://reader036.fdocuments.us/reader036/viewer/2022092622/587aa6f91a28abed218b4af1/html5/thumbnails/7.jpg)
Backtracking Can be used successful in small programs. Beginning at the site where a symptom has
been uncovered the source code is traced backward (manually) until the site of the cause is found.
Disadvantage: as the number of source line increases, the number of potential paths may become unmanageably large.
![Page 8: Debugging](https://reader036.fdocuments.us/reader036/viewer/2022092622/587aa6f91a28abed218b4af1/html5/thumbnails/8.jpg)
Cause Elimination Introduces the concept of binary
partitioning. Uses binary partitioning to reduce
the number of locations potential where errors can exist
Isolate potential causes, devise cause hypotheses tests to isolate bug.