DySy: Dynamic Symbolic Execution for Invariant Inference.

Slides:



Advertisements
Similar presentations
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
De necessariis pre condiciones consequentia sine machina P. Consobrinus, R. Consobrinus M. Aquilifer, F. Oratio.
Semantics Static semantics Dynamic semantics attribute grammars
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
50.530: Software Engineering Sun Jun SUTD. Week 10: Invariant Generation.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
1 Symbolic Execution for Model Checking and Testing Corina Păsăreanu (Kestrel) Joint work with Sarfraz Khurshid (MIT) and Willem Visser (RIACS)
1/20 Generalized Symbolic Execution for Model Checking and Testing Charngki PSWLAB Generalized Symbolic Execution for Model Checking and Testing.
A survey of techniques for precise program slicing Komondoor V. Raghavan Indian Institute of Science, Bangalore.
Chapter 1. The Phases of Software Development. Data Structure 2 Chapter outline  Objectives  Use Javadoc to write a method’s complete specification.
Kai Pan, Xintao Wu University of North Carolina at Charlotte Generating Program Inputs for Database Application Testing Tao Xie North Carolina State University.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
Fall Semantics Juan Carlos Guzmán CS 3123 Programming Languages Concepts Southern Polytechnic State University.
CS 355 – Programming Languages
Rahul Sharma Işil Dillig, Thomas Dillig, and Alex Aiken Stanford University Simplifying Loop Invariant Generation Using Splitter Predicates.
Pexxxx White Box Test Generation for
Dynamically Discovering Likely Program Invariants to Support Program Evolution Michael D. Ernst, Jake Cockrell, William G. Griswold, David Notkin Presented.
Dynamically Discovering Likely Program Invariants to Support Program Evolution Michael Ernst, Jake Cockrell, William Griswold, David Notkin Presented by.
Program Exploration with Pex Nikolai Tillmann, Peli de Halleux Pex
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
Well-cooked Spaghetti: Weakest-Precondition of Unstructured Programs Mike Barnett and Rustan Leino Microsoft Research Redmond, WA, USA.
Describing Syntax and Semantics
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Caltech Pasadena, CA 12 November 2009.
MS thesis/project ideas for MS students in the Department of Computer Science at the University of Minnesota Duluth suggestions by Dr Andrew Brooks, Heller.
Reverse Engineering State Machines by Interactive Grammar Inference Neil Walkinshaw, Kirill Bogdanov, Mike Holcombe, Sarah Salahuddin.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
(or what I learned from Neil about software testing) John Hughes Chalmers University/Quviq AB.
Dynamically Discovering Likely Program Invariants to Support Program Evolution Presented By: Wes Toland, Geoff Gerfin Michael D. Ernst, Jake Cockrell,
1 Abstraction  Identify important aspects and ignore the details  Permeates software development programming languages are abstractions built on hardware.
Bug Localization with Machine Learning Techniques Wujie Zheng
The Daikon system for dynamic detection of likely invariants MIT Computer Science and Artificial Intelligence Lab. 16 January 2007 Presented by Chervet.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
Code Contracts Parameterized Unit Tests Tao Xie. Example Unit Test Case = ? Outputs Expected Outputs Program + Test inputs Test Oracles 2 void addTest()
Parameterized Unit Tests By Nikolai Tillmann and Wolfram Schulte Proc. of ESEC/FSE 2005 Presented by Yunho Kim Provable Software Lab, KAIST TexPoint fonts.
Static Program Analyses of DSP Software Systems Ramakrishnan Venkitaraman and Gopal Gupta.
Hassen Grati, Houari Sahraoui, Pierre Poulin DIRO, Université de Montréal Extracting Sequence Diagrams from Execution Traces using Interactive Visualization.
1 Test Selection for Result Inspection via Mining Predicate Rules Wujie Zheng
Convergence of Model Checking & Program Analysis Philippe Giabbanelli CMPT 894 – Spring 2008.
Symbolic Execution with Abstract Subsumption Checking Saswat Anand College of Computing, Georgia Institute of Technology Corina Păsăreanu QSS, NASA Ames.
ISBN Chapter 3 Describing Semantics.
Chapter 3 Part II Describing Syntax and Semantics.
Semantics In Text: Chapter 3.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Debugging COMP T1.
A Test Case + Mock Class Generator for Coding Against Interfaces Mainul Islam, Christoph Csallner Software Engineering Research Center (SERC) Computer.
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
Types and Programming Languages Lecture 11 Simon Gay Department of Computing Science University of Glasgow 2006/07.
Lightweight Support for Magic Wands in an Automatic Verifier Malte Schwerhoff and Alexander J. Summers 10 th July 2015, ECOOP, Prague.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Extracting Sequence.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
CUTE: A Concolic Unit Testing Engine for C Koushik SenDarko MarinovGul Agha University of Illinois Urbana-Champaign.
Combining Static and Dynamic Reasoning for Bug Detection Yannis Smaragdakis and Christoph Csallner Elnatan Reisner – April 17, 2008.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Symbolic Execution in Software Engineering By Xusheng Xiao Xi Ge Dayoung Lee Towards Partial fulfillment for Course 707.
Design by Contract. The Goal Ensure the correctness of our software (correctness) Recover when it is not correct anyway (robustness) Correctness: Assertions.
Copyright 2006 Pearson Addison-Wesley, 2008, 2012 Joey Paquet 1 Concordia University Department of Computer Science and Software Engineering SOEN6441 –
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing I No reading Group meetings MidtermNo Section Testing II Progress report due Readings out Testing.
Jeremy Nimmer, page 1 Automatic Generation of Program Specifications Jeremy Nimmer MIT Lab for Computer Science Joint work with.
Dynamic Symbolic Execution
Input Space Partition Testing CS 4501 / 6501 Software Testing
CS 326 Programming Languages, Concepts and Implementation
A Test Case + Mock Class Generator for Coding Against Interfaces
New Ideas Track: Testing MapReduce-Style Programs Christoph Csallner, Leonidas Fegaras, Chengkai Li Computer.
The Zoo of Software Security Techniques
Assertions References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 4/25/2019.
Presentation transcript:

DySy: Dynamic Symbolic Execution for Invariant Inference

Authors Christoph Csallner Nikolai Tillmann Yannis Smaragdakis

Christoph Csallner College of Computing, Georgia Tech Research interest :Software engineering, especially in program analysis and automated testing Other papers: 1.Combining static and dynamic reasoning for bug detection(TAP 2007) 2.Combining over- and under-approximating program analyses for automatic software testing

C&Y ’ s papers Dynamically discovering likely interface invariants ICSE 2006 Check 'n' crash: combining static checking and testing ICSE 2005 Yannis Smaragdakis

Nikolai Tillmann Microsoft Research Leader of project Pex Papers: 1.Pex-White Box Test Generation for.NET(TAP 2008) 2. Unit Tests Reloaded: Parameterized Unit Testing with Symbolic Execution. IEEE Software(4): (2006)

Yannis Smaragdakis Associate Professor, Department of Computer Science, University of Massachusetts, Amherst Research:Applied programming languages and software engineering Papers: 1.C&Y ’ s papers 2. Exception Analysis and Points-To Analysis: Better Together(ISSTA'09)

Background Dynamic Invariant Inference: Daikon Sybolic execution Pex

Invariant a predicate is called an invariant to a sequence of operation if the predicate always evaluates at the end of the sequence to the same value than before starting the sequence Example:MU puzzleMU puzzle

The puzzle: 1.If a string ends with an I, a U may be appended (xI → xIU) 2.Any string after an M may be completely duplicated (Mx → Mxx) 3.Any three consecutive Is (III) may be replaced with a single U (xIIIy → xUy) 4.And two consecutive Us may be removed (xUUy → xy) Is it possible to convert MI into MU using these four transformation rules only? Invariant

Daikon The first and most mature dynamic invariant inference tool. Daikon tracks a program's variables during execution and generalizes the observed behavior to invariants by variant relation models. Relation model exmaples: Constant value (x= a, or x > 0), Linear relationships (y == a*x + b), Ordering (x <= y) and Membership

Symbolic execution Symbolic Execution and Program Testing 1975 by James King. the analysis of programs by tracking symbolic rather than actual values Path condition(pc): A precondition for a program path

Simple example 1.y = read() 2.y = 2 * y 3.if (y == 12) 4.fails() 5.print("OK")

Pex a dynamic analysis and test generation framework for.NET, developed by the Foundations of Software Engineering group at Microsoft Research shadow interpreter Relation between DySy and Pex.

Overview Basic idea Implementation details Abstraction for Loops

Basic idea 1.For one test suite. Take pc as precondition. Take the conduction rule from precondition to return value of a method as postcondition 2.Repeat 1 for all test suites. 3.Combine all precondition by disjunction, and all postcondition by conjunction.

example public Object top() { if(Empty) return null; return theArray[topOfStack]; } Two test suites: 1. Empty == true 2. Empty == false && topOfStack >= 0 && topOfStack < theArray.Length

Example(2) Conbined precondition: Empty == true ||(Empty == false && topOfStack >= 0 && topOfStack < theArray.Length) Combined postcondition: Empty == true ==> (\result == null) and (Empty == false && topOfStack >= 0 && topOfStack < theArray.Length) ==> (\result == theArray[topOfStack])

Implementation details Usage of Pex Handling nested method calls Abstraction for Loops

Usage of Pex For the duration of each method call, DySy registers a separate interpreter with Pex's monitoring framework.

Nested calls DySy builds a set of quadruples (method, pathCondition, result, finalState) to represent methods as it monitors the program

Abstraction for Loops Traditional method : Record preconditions for every cycle. precise but useless, causing heavy overhead

Abstraction for Loops heuristic method : 1.Loop variants are treated as inputs(symbol) 2.Loop conditions are ignored, except that the loop body is not entered. 3.Only latest value of loop variants are recorded.

example public int linSearch(int ele, int[] arr) { if (arr == null) throw new ArgumentException(); for (int i = 0; i < arr.Length; i++) { if (ele == arr[i]) return i; } return -1; }

Program state arr != null && ($i = 0 || $i = 0 ) public int linSearch(int ele, int[] arr) { if (arr == null) throw new ArgumentException(); for (int i = 0; i < arr.Length; i++) { if (ele == arr[i]) return i; } return -1; }

Simplified program state !(ele == arr[$i]) ==> \result == -1 || ele == arr[$i] ==> \result == $i

evaluation Test code: StackAr: an example program originally by Weiss Overhead: DySy: 28seconds Daikon: 9seconds

Thank you!