{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

invariants-icse99-slides

# invariants-icse99-slides - Michael Ernst Jake Cockrell Bill...

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

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/

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

View Full Document
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

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

View Full Document
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 0 Postcondition: s = ( Σ j : 0 j < n : b [ j ]) Loop invariant: 0 i n and s = ( Σ j : 0 j < i : b [ j ])

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

View Full Document
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] (7 values) B (100 values) All elements in [-100..100] (200 values) 15.1.1:::END

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern