The Art of Software Testing, Second Edition
by Glenford J. Myers, Corey Sandler, Tom Badgett, Todd M. Thomas
7.5. Debugging by Testing
The last "thinking type" debugging method is the use of test cases. This probably sounds a bit peculiar since the beginning of this chapter distinguishes debugging from testing. However, consider two types of test cases: test cases for testing, where the purpose of the test cases is to expose a previously undetected error, and test cases for debugging, where the purpose is to provide information useful in locating a suspected error. The difference between the two is that test cases for testing tend to be "fat" because you are trying to cover many conditions in a small number of test cases. Test cases for debugging, on the other hand, are "slim" since you want to cover only a single condition or a few conditions in each test case.
In other words, after a symptom of a suspected error is discovered, you write variants of the original test case to attempt to pinpoint the error. Actually, this method is not an entirely separate method; it often is used in conjunction with the induction method to obtain information needed to generate a hypothesis and/or to prove a hypothesis. It also is used with the deduction method to eliminate suspected causes, refine the remaining hypothesis, and/or prove a hypothesis.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access