Adapting Side-Effects Analysis for Modular Program Model Checking M.S. Defense Oksana Tkachuk Major Professor: Matthew Dwyer Support US National Science.

Slides:



Advertisements
Similar presentations
Data-Flow Analysis II CS 671 March 13, CS 671 – Spring Data-Flow Analysis Gather conservative, approximate information about what a program.
Advertisements

Programming Languages and Paradigms
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Pointer Analysis – Part I Mayur Naik Intel Research, Berkeley CS294 Lecture March 17, 2009.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
Analyzing Interaction Orderings with Model Checking Support US National Science Foundation (NSF CISE/SEL) US Department of Defense Advanced Research Projects.
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) Dataflow Analysis Introduction Guo, Yao Part of the slides are adapted from.
A survey of techniques for precise program slicing Komondoor V. Raghavan Indian Institute of Science, Bangalore.
1 Practical Object-sensitive Points-to Analysis for Java Ana Milanova Atanas Rountev Barbara Ryder Rutgers University.
Software Model Checking for Embedded Systems PIs: Matthew Dwyer 1, John Hatcliff 1, and George Avrunin 2 Post-docs: Steven Seigel 2, Radu Iosif 1 Students:
Assurance through Enhanced Design Methodology Orlando, FL 5 December 2012 Nirav Davé SRI International This effort is sponsored by the Defense Advanced.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Parameterized Object Sensitivity for Points-to Analysis for Java Presented By: - Anand Bahety Dan Bucatanschi.
Interprocedural analysis © Marcelo d’Amorim 2010.
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
Static Analysis of Embedded C Code John Regehr University of Utah Joint work with Nathan Cooprider.
Road Map Introduction to object oriented programming. Classes
Common Sub-expression Elim Want to compute when an expression is available in a var Domain:
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Establishing Local Temporal Heap Safety Properties with Applications to Compile-Time Memory Management Ran Shaham Eran Yahav Elliot Kolodner Mooly Sagiv.
Next Section: Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis (Wilson & Lam) –Unification.
Program analysis Mooly Sagiv html://
Purity Analysis : Abstract Interpretation Formulation Ravichandhran Madhavan, G. Ramalingam, Kapil Vaswani Microsoft Research, India.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
Program analysis Mooly Sagiv html://
Another example p := &x; *p := 5 y := x + 1;. Another example p := &x; *p := 5 y := x + 1; x := 5; *p := 3 y := x + 1; ???
Overview of program analysis Mooly Sagiv html://
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
Pointer analysis. Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis Andersen and.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Impact Analysis of Database Schema Changes Andy Maule, Wolfgang Emmerich and David S. Rosenblum London Software Systems Dept. of Computer Science, University.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University STATIC ANALYSES FOR JAVA IN THE PRESENCE OF DISTRIBUTED COMPONENTS AND.
Chapter 6: User-Defined Functions
Software Engineering Research paper presentation Ali Ahmad Formal Approaches to Software Testing Hierarchal GUI Test Case Generation Using Automated Planning.
SE: CHAPTER 7 Writing The Program
Lazy Abstraction Jinseong Jeon ARCS, KAIST CS750b, KAIST2/26 References Lazy Abstraction –Thomas A. Henzinger et al., POPL ’02 Software verification.
Model construction and verification for dynamic programming languages Radu Iosif
Verification of obstruction-free algorithm with contention management Niloufar Shafiei.
Convergence of Model Checking & Program Analysis Philippe Giabbanelli CMPT 894 – Spring 2008.
ESEC/FSE-99 1 Data-Flow Analysis of Program Fragments Atanas Rountev 1 Barbara G. Ryder 1 William Landi 2 1 Department of Computer Science, Rutgers University.
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke Presented by: Xia Cheng.
Integration Testing Beyond unit testing. 2 Testing in the V-Model Requirements Detailed Design Module implementation Unit test Integration test System.
USING MODEL CHECKING TO DISCOVER AUTOMATION SURPRISES Java class User: - getExpectation() - checkExpectation() FAULTY EXECUTION start incrMCPAlt pullAltKnob.
Pointer Analysis – Part I CS Pointer Analysis Answers which pointers can point to which memory locations at run-time Central to many program optimization.
Sept 12ICSM'041 Precise Identification of Side-Effect-Free Methods in Java Atanas (Nasko) Rountev Ohio State University.
Specifying Multithreaded Java semantics for Program Verification Abhik Roychoudhury National University of Singapore (Joint work with Tulika Mitra)
What Makes Device Driver Development Hard Synthesizing Device Drivers Roumen Kaiabachev and Walid Taha Department of Computer Science, Rice University.
1 Iterative Program Analysis Abstract Interpretation Mooly Sagiv Tel Aviv University Textbook:
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
Abstraction and Abstract Interpretation. Abstraction (a simplified view) Abstraction is an effective tool in verification Given a transition system, we.
The PLA Model: On the Combination of Product-Line Analyses 강태준.
Language Paradigms CS655.
Algorithms and Problem Solving
Pointer Analysis Lecture 2
Space-Reduction Strategies for Model Checking Dynamic Software
Specifying Multithreaded Java semantics for Program Verification
Aspect Validation: Connecting Aspects and Formal Methods
Verification and Validation Unit Testing
CSE 303 Concepts and Tools for Software Development
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Pointer analysis.
Algorithms and Problem Solving
자바 언어를 위한 정적 분석 (Static Analyses for Java) ‘99 한국정보과학회 가을학술발표회 튜토리얼
The Bogor Model Checking Framework
Presentation transcript:

Adapting Side-Effects Analysis for Modular Program Model Checking M.S. Defense Oksana Tkachuk Major Professor: Matthew Dwyer Support US National Science Foundation (NSF CISE/SEL) US Department of Defense Advanced Research Projects Agency (DARPA/IXO PCES) US Army Research Office (ARO CIP/SW)

Software Model Checking Problems State space explosion due to large data domains Solutions Reduction Abstraction Modular Verification

Unit Code Base Unit Break the entire system into modules and verify one at a time. Module under analysis is called unit Unit is not self-executable system, need to model environment

Environment Generation Problem Unit Code Base In OO (Java) systems, boundaries and interactions between unit and environment are complex Control effects: invoking of methods Data effects: passing data and modifying data Hard to identify interaction points Locking, exceptions, global references

Unit Code Base Finds points of interaction (unit interface) Identifies environment classes that directly interact with the unit Cuts away classes that don’t directly interact with the unit Generates models for the remaining classes Solutions in Bandera Environment Generator (BEG)

Environment Models Universal environments Safe but impractical Environment assumptions may be used to generate more precise environments User supplied Automatically extracted from environment implementation using static analysis techniques

Modular Verification Unit Code Base Drivers Environment classes are broken into Active classes hold a thread of control (drivers) Passive classes (stubs) Stubs Closed Unit Java + modeling primitives + Unit Properties  Java Model Checker

Generation of universal stubs and drivers Generation of drivers from assumptions (LTL,Regular Expressions) future work: customized control flow analysis Generation of stubs from assumptions (Java-like exprs/assignments) static analysis results side-effects analysis to calculate data effects future work: control effects, safe locks Current State of Tool Support

In This Talk… Identifying environment data effects using a customized side-effects analysis Identifying the unit Identifying environment Analyzing environment Modeling environment from analysis results

Identifying the unit/environment The unit is user defined based on properties to be checked BEG scans the unit for external references that drive generation of environment classes Unit Stubs

Analyzing Environment Staged Analysis Scope-based analysis to eliminate methods that can’t side-effects the unit data Points-to analysis to approximate objects pointed to by a reference variable in store statements (l.f = r, l[i]=r) Side-Effects analysis to detect side-effects on the unit data through store statements

Detecting Independent Methods BEG builds a call graph for environment methods immediately called from unit Unit Stubs Excluding the methods that can’t effect unit data based on scope analysis Call Graph

Side Effects Analysis Traditional side-effects analyses are designed to calculate the set of memory locations that may be modified by method execution Do not approximate the values that are assigned in a store statement (l.f = r, l[i]=r) Do not distinguish between unit and environment locations Are usually designed to be fast rather than precise

Tracks side-effects to unit locations, ignores side-effects to environment locations Tracks the value on the right hand side of side effecting statements (l.f = r, l[i] = r) Increases precision Flow and context-sensitivity (parameterized) Access-path based with user controlled k-limiting Tracking type and reachabilty of unit locations Calculating must side-effects Incorporating return sensitivity BEG Side-Effects

Example class Node { Node next; Data data; … } class … { … void m(Node n, Data d) { n.next.next.data = d; } t = n.next; t = t.next; t.data = d;

Assignments through References t = n.next; t = t.next; t.data = d; n // d n.next.next.data = d; t next data //

Assignments through References // n d n.next.next.data = d; next data t = n.next; t = t.next; t.data = d; t

Assignments through References // next data // n.next.next.data = d; n d t t = n.next; t = t.next; t.data = d;

Assignments through References // next data // n.next.next.data = d; t = n.next; t = t.next; t.data = d; n d t

1-limited Analysis // next data // n.next.next.data = d; t = n.next; t = t.next; t.data = d; n d t

1-limited Analysis // t next data // n.next.next.data = d; t = n.next; t = t.next; t.data = d; d n

1-limited Analysis with Reachability n // d t next data // n.next.next.data = d; t = n.next; t = t.next; t.data = d;

1-limited Analysis with Reachability // t next data // n.next.next.data = d; t = n.next; t = t.next; t.data = d; n d

Abstract Access Paths Roots: static fields, formal parameters, new instances We restrict the tracking of access paths through unit fields The language of abstract access paths

Extension Operator root r  l )  l r f r ! r !  r !  l ! .f ) l=r.f f ?

Extension Operator root r  l )  l r f l=r.f f

Prefixing Operator  root arg l = C.m’(arg) arg p’ return ret’ p’  ’(p’) ret’  rootp’ arg l  ’(p’) ret’

Prefixing Operator  rootp’ arg l  ’(p’) ret’

Prefixing Operator  rootp’ arg l  ’(p’) ret’ denote

Data Flow Frameworks Join semi-lattice L Partial ordering v Merge operator t Least element ? Flow, initial point and value Function Space F of monotone functions over lattice Mapping from labels to transfer functions f in F

Our Analyses Using DFF May PtMust PtMay SeMust Se L P (Var-> P (AbsPath)) P (AbsPath-> P (AbsValue)) vµ¶µ¶ t  ?; Var-> P (AbsPath) ; AbsPath-> P (AbsValue) F Forward Flow, initial statement s 0, initial value ; FfFf F= {f:L ! L j 9 l k, l g :f(l)=(l - l k )  l g } f s (l)=(l-Kill(s))  Gen(s)

Pt Analysis Correctness p ` 11 B semantics 22 R sc ) p ` Pt 1 c B concerete paths Pt 2 c R ca ) p ` Pt 1 a B abstract paths Pt 2 a

Se Analysis Correctness p ` 11 B semantics 22 R sc ) p ` Se 1 c B concerete paths Se 2 c R ca ) p ` Se 1 a B abstract paths Se 2 a

Modeling Environment Example code Analysis summary Generated model void m(Node n, Data d) { n.next.next.data = d; } void m(Node param1, Data param2) { if(Bandera.choose()) Bandera.chooseReachable(param1.next,”Data”) = param2; }

Examples and Experience Container Examples Identified container properties and how to guide the analysis to preserve such properties in the environment Replicated Workers Found a deadlock Autopilot Identified mode confusion scenario

Related Work Side-effects analysis [Landi & Ryder] Parameterized points-to analysis [Liang & Harrold] Closing open systems [Godefroid] Generation of environment data [Stoller] Environment assumption generation [Giannakopoulou et al.]

Limitations and Future Work Assumptions Atomicity of environment methods Lack of divergence, indefinite blocking, and lock acquisition in the environment Designing/reusing analyses to discharge the above assumptions Designing/reusing analyses for drivers Integration with Bandera and Bogor Exploiting richer specifications (e.g., JML)

Summary Overview of BEG capabilities Presentation of Side-effects analysis Environment modeling strategies BEG work is ongoing Will be included in the upcoming Bandera release