CHAPTER 15 Fixing the Defect
Once we have understood a failure’s cause–effect chain, we know how the failure came to be. Still, we must find the place where the infection begins—that is, the actual location of the defect. In this chapter, we discuss how to narrow down a defect systematically—and having found the defect, how to fix it.
15.1 LOCATING THE DEFECT
Section 9.5 in Chapter 9 discussed a general strategy for narrowing down infection sites:
- 1. We start with the infected value that defines the failure (Figure 15.1a).
- 2. We determine the possible origins of the infected value, following dependences in the source code (Figure 15.1b).
- 3. Using observation, we check each single origin to determine whether it is infected or not (Figure ...
Get Why Programs Fail, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.