Debugging by Thinking: A Multidisciplinary Approach (HP Technologies)

7.9 Inductive-analysis strategy

7.9.1 Inductive-analysis assumptions

Induction is “the process of deriving general principles from particular facts or instances,” according to the American Heritage Dictionary of the English Language.

The inductive-analysis strategy makes the following assumptions:

7.9.2 Inductive-analysis control structure

The next code sample shows the control structure for the inductive-analysis strategy.

Do while no hypothesis explains all facts Generate a hypothesis Ensure that the hypothesis is compatible with other knowledge Ensure that the hypothesis explains as much as possible Count the facts accounted for Compare hypotheses, ensuring that this is a better explanation than its alternatives If the best hypothesis explains all the facts, Then Terminate search successfully End-if End-do Last hypothesis evaluated explains the cause of the bug

Категории