7.11 Review


7.11 Review

Every debugging strategy consists of three parts: a set of assumptions, a control structure, and an evaluation mechanism. The purpose of the evaluation mechanism is to tell you whether you’re making progress.

The binary search strategy is analogous to the binary search algorithm taught in every beginner’s data structures or algorithms class. This strategy assumes that the code segments under investigation have some linear ordering.

The greedy search strategy is analogous to the greedy method taught in introductory algorithms classes. This strategy assumes that the program is divisible into segments that can be tested for responsibility for the defect. The key to the greedy search strategy is finding a selection method that maximizes the benefit and minimizes the cost for each iteration of the strategy.

A program slice gives the set of statements and predicates in a program that may affect the value of a set of variables at specific location in that program. The program slice strategy assumes that a tool is available that will perform control- and data-flow analysis on the application and provide the slicing information.

The deductive-analysis strategy reasons from a general body of knowledge to a specific conclusion about the problem at hand. This strategy assumes that you have extensive experience in programming to draw on and a thorough understanding of the details of the application you’re debugging.

The inductive-analysis strategy reasons from a set of specific facts to an increasingly precise hypothesis that explains them. This strategy assumes that there exists a set of observations to start from and that there is a method for evaluating the quality of the hypotheses generated.

Choose a debugging strategy based on which set of assumptions fit the situation you’re working on.




Debugging by Thinking. A Multidisciplinary Approach
Debugging by Thinking: A Multidisciplinary Approach (HP Technologies)
ISBN: 1555583075
EAN: 2147483647
Year: 2002
Pages: 172

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net