The document discusses different approaches to debugging software errors. It describes debugging as the process of locating and fixing errors. Some key approaches covered are brute force, backtracking, using breakpoints, induction, deduction, and testing. Breakpoints allow stopping program execution at specific points to monitor values, while induction and deduction involve reasoning strategies to uncover errors.
The document discusses different approaches to debugging software errors. It describes debugging as the process of locating and fixing errors. Some key approaches covered are brute force, backtracking, using breakpoints, induction, deduction, and testing. Breakpoints allow stopping program execution at specific points to monitor values, while induction and deduction involve reasoning strategies to uncover errors.
The document discusses different approaches to debugging software errors. It describes debugging as the process of locating and fixing errors. Some key approaches covered are brute force, backtracking, using breakpoints, induction, deduction, and testing. Breakpoints allow stopping program execution at specific points to monitor values, while induction and deduction involve reasoning strategies to uncover errors.
A Nightmare? The story of “BUGS” What is Debugging? Debugging...
Locating and Fixing Errors
Steps:
● Identify the Location and Nature of error.
● Correcting or fixing error Types/Approaches: > Brute Force > Backtracking > Breakpoint > Induction > Deduction > Testing Brute Force ● Involves Memory Dumps ● A memory dump is a snapshot of execution sequence Backtracking ● It is refinement of brute force method. ● Source code is traced out backwards. ● Reverse direction of the flow of control. ● Small size problems. ● Should be the last resort. Breakpoint ● Stopping the program execution at breakpoint. ● Each breakpoint is associated with a particular instruction. ● Breakpoint is also performed with watch values. ● The incorrect or unexpected values are monitored with watch values. Debugging by induction ● Reasoning or thoughtful strategy. ● Start with the symptoms of the error in the result of one or more test eases and looking for relationships among the symptoms. ● The error is often uncovered. Debugging by deduction ● This is the kind of cause elimination method. ● On the basis of cause hypothesis, lists of possible causes are enumerated. ● Now the tests are conducted to eliminate causes to remove errors in the system. ● If all the causes are eliminated then errors are fixed and hypothesis is proved. Otherwise, hypothesis is refined to eliminate errors. Debugging by testing ● Uses test cases to locate errors. ● Test cases in testing cover many conditions and statements. ● Test cases in debugging focuses on small number of conditions and statements. Pair programming