invariants-icse99-slides

invariants-icse99-slides - Ernst, ICSE 99, page 1...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Ernst, ICSE 99, page 1 Dynamically Detecting Likely Program Invariants Michael Ernst, Jake Cockrell, Bill Griswold (UCSD), and David Notkin University of Washington Department of Computer Science and Engineering http://www.cs.washington.edu/homes/mernst/ Ernst, ICSE 99, page 2 Overview Goal: recover invariants from programs Technique: run the program, examine values Artifact: Daikon Results: Outline: • recovered formal specifications • aided in a software modification task • motivation • techniques • future work Ernst, ICSE 99, page 3 Goal: recover invariants Detect invariants like those in assert statements • x > abs(y) • x = 16*y + 4*z + 3 • array a contains no duplicates • for each node n , n = n.child.parent • graph g is acyclic Ernst, ICSE 99, page 4 Uses for invariants Write better programs [Liskov 86] Documentation Convert to assert Maintain invariants to avoid introducing bugs Validate test suite: value coverage Locate exceptional conditions Higher-level profile-directed compilation [Calder 98] Bootstrap proofs [Wegbreit 74, Bensalem 96] Ernst, ICSE 99, page 5 Experiment 1: recover formal specifications Example: Program 15.1.1 from The Science of Programming [Gries 81] // Sum array b of length n into variable s. i := 0; s := 0; while i ≠ n do { s := s + b [ i ]; i := i +1 } Precondition: n ≥ Postcondition: s = ( Σ j : 0 ≤ j < n : b [ j ]) Loop invariant: 0 ≤ i ≤ n and s = ( Σ j : 0 ≤ j < i : b [ j ]) Ernst, ICSE 99, page 6 Test suite for program 15.1.1 100 randomly-generated arrays • Length uniformly distributed from 7 to 13 • Elements uniformly distributed from -100 to 100 Ernst, ICSE 99, page 7 Inferred invariants 15.1.1:::BEGIN (100 samples) N = size(B) (7 values) N in [7..13]N in [7....
View Full Document

This note was uploaded on 02/24/2012 for the course CSE 503 taught by Professor Davidnotikin during the Spring '11 term at University of Washington.

Page1 / 24

invariants-icse99-slides - Ernst, ICSE 99, page 1...

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

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