CHAPTER 11 Detecting Anomalies

Although one program run can tell you quite a great deal, having multiple runs to compare offers several opportunities for locating commonalities and anomalies—anomalies that frequently help to locate defects. In this chapter, we discuss how to detect anomalies in code coverage and anomalies in data accesses. We also demonstrate how to infer invariants from multiple test runs automatically, in order to flag later invariant violations. All of these anomalies are good candidates for infection sites.

11.1 CAPTURING NORMAL BEHAVIOR

If we have a full specification of a program’s behavior, we can easily narrow down an infection (as discussed in Chapter 10). So why not simply use assertions all the way through? The following ...

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.