invariants-relevance-icse2000 - Quickly Detecting Relevant...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Quickly Detecting Relevant Program Invariants Michael D. Ernst , Adam Czeisler , William G. Griswold ,and David Notkin Dept. of Computer Science & Engineering University of Washington Box 352350, Seattle WA 98195-2350 USA mernst,czeisler,notkin Dept. of Computer Science & Engineering University of California San Diego, 0114 La Jolla, CA 92093-0114 USA ABSTRACT Explicitly stated program invariants can help programmers by characterizing certain aspects of program execution and identifying program properties that must be preserved when modifying code. Unfortunately, these invariants are usually absent from code. Previous work showed how to dynami- cally detect invariants from program traces by looking for patterns in and relationships among variable values. A pro- totype implementation, Daikon, accurately recovered invari- ants from formally-specified programs, and the invariants it detected in other programs assisted programmers in a soft- ware evolution task. However, Daikon suffered from report- ing too many invariants, many of which were not useful, and also failed to report some desired invariants. This paper presents, and gives experimental evidence of the efficacy of, four approaches for increasing the relevance of invariants reported by a dynamic invariant detector. One of them — exploiting unused polymorphism— adds desired in- variants to the output. The other three — suppressing implied invariants, limiting which variables are compared to one an- other, and ignoring unchanged values— eliminate undesired invariants from the output and also improve runtime by re- ducing the work done by the invariant detector. 1 INTRODUCTION Previous research explored the use of dynamic methods for discovering likely program invariants, with a particular inter- est in supporting software evolution tasks [ECGN]. A pro- totype implementation, Daikon, demonstrated the feasibility of dynamically detecting invariants, or properties that hold at a particular program point. The approach is to run the pro- gram of interest, examine the values that the program com- putes, and postulate and check potential invariants over those values, reporting those that are true for the test suite and that also satisfy some other conditions. Daikon’s output was accurate: it rediscovered formal spec- ifications from which a set of programs had been derived. Daikon’s output was also useful: programmers who were modifying an undocumented C program (apparently writ- ten without thought for formal invariants) found the dynam- ically detected invariants helpful in their modification task. This paper describes four techniques that improve the rel- evance— usefulness to programmers— of the reported in- variants and the performance of the underlying engine. The first technique adds desired but previously missing invari- ants, and the latter three eliminate undesirable invariants while simultaneously improving runtime.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

invariants-relevance-icse2000 - Quickly Detecting Relevant...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online