1 of 24 Automatic Extraction of Object-Oriented Observer Abstractions from Unit-Test Executions Dept. of Computer Science & Engineering University of Washington,

Slides:



Advertisements
Similar presentations
Chapter 22 Implementing lists: linked implementations.
Advertisements

Sequence of characters Generalized form Expresses Pattern of strings in a Generalized notation.
DETAILED DESIGN, IMPLEMENTATIONA AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Data Abstraction II SWE 619 Software Construction Last Modified, Spring 2009 Paul Ammann.
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:
Dynamically Discovering Likely Program Invariants to Support Program Evolution Michael D. Ernst, Jake Cockrell, William G. Griswold, David Notkin Presented.
Copyright © 2006 Software Quality Research Laboratory DANSE Software Quality Assurance Tom Swain Software Quality Research Laboratory University of Tennessee.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Dynamically Discovering Likely Program Invariants to Support Program Evolution Michael Ernst, Jake Cockrell, William Griswold, David Notkin Presented by.
DART Directed Automated Random Testing Patrice Godefroid, Nils Klarlund, and Koushik Sen Syed Nabeel.
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
/department of mathematics and computer science Visualization of Transition Systems Hannes Pretorius Visualization Group
Using JML Runtime Assertion Checking to Automate Metamorphic Testing in Applications without Test Oracles Christian Murphy, Kuang Shen, Gail Kaiser Columbia.
Synthesis of Interface Specifications for Java Classes Rajeev Alur University of Pennsylvania Joint work with P. Cerny, G. Gupta, P. Madhusudan, W. Nam,
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
Automatic Extraction of Object-Oriented Component Interfaces John Whaley Michael C. Martin Monica S. Lam Computer Systems Laboratory Stanford University.
1 State-Based Testing of Ajax Web Applications A. Marchetto, P. Tonella and F. Ricca CMSC737 Spring 2008 Shashvat A Thakor.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 10 Slide 1 Formal Specification.
Automated Diagnosis of Software Configuration Errors
Impact Analysis of Database Schema Changes Andy Maule, Wolfgang Emmerich and David S. Rosenblum London Software Systems Dept. of Computer Science, University.
Formal Methods 1. Software Engineering and Formal Methods  Every software engineering methodology is based on a recommended development process  proceeding.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Feed Back Directed Random Test Generation Carlos Pacheco1, Shuvendu K. Lahiri2, Michael D. Ernst1, and Thomas Ball2 1MIT CSAIL, 2Microsoft Research Presented.
Mining Windows Kernel API Rules Jinlin Yang 09/28/2005CS696.
2006/09/19AOAsia 21 Towards Locating a Functional Concern Based on a Program Slicing Technique Takashi Ishio 1,2, Ryusuke Niitani 2 and Katsuro Inoue 2.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Custom Templatized Data Structures.
Automatically Inferring Temporal Properties for Program Evolution Jinlin Yang and David Evans 15 th IEEE International Symposium on Software Reliability.
1 A Static Analysis Approach for Automatically Generating Test Cases for Web Applications Presented by: Beverly Leung Fahim Rahman.
Tao Xie ( ) Advisor: David Notkin Department of Computer Science & Engineering, University of Washington, Seattle Syntactically.
1 Automatic Identification of Common and Special Object-Oriented Unit Tests Dept. of Computer Science & Engineering University of Washington, Seattle Oct.
Computer Science and Engineering College of Engineering The Ohio State University Interfaces The credit for these slides goes to Professor Paul Sivilotti.
Software Engineering Research paper presentation Ali Ahmad Formal Approaches to Software Testing Hierarchal GUI Test Case Generation Using Automated Planning.
The Daikon system for dynamic detection of likely invariants MIT Computer Science and Artificial Intelligence Lab. 16 January 2007 Presented by Chervet.
Code Contracts Parameterized Unit Tests Tao Xie. Example Unit Test Case = ? Outputs Expected Outputs Program + Test inputs Test Oracles 2 void addTest()
Page 1 Advanced Technology Center HCSS 03 – April 2003 vFaat: von Neumann Formal Analysis and Annotation Tool David Greve Dr. Matthew Wilding Rockwell.
Jinlin Yang and David Evans [jinlin, Department of Computer Science University of Virginia PASTE 2004 June 7 th 2004
1 Test Selection for Result Inspection via Mining Predicate Rules Wujie Zheng
Exploiting Code Search Engines to Improve Programmer Productivity and Quality Suresh Thummalapenta Advisor: Dr. Tao Xie Department of Computer Science.
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.
Chapter 8 Lecture 1 Software Testing. Program testing Testing is intended to show that a program does what it is intended to do and to discover program.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Cage: A Keyword.
Finding Errors in.NET with Feedback-Directed Random Testing Carlos Pacheco (MIT) Shuvendu Lahiri (Microsoft) Thomas Ball (Microsoft) July 22, 2008.
Directed Random Testing Evaluation. FDRT evaluation: high-level – Evaluate coverage and error-detection ability large, real, and stable libraries tot.
Recording the Context of Action for Process Documentation Ian Wootten Cardiff University, UK
Cooperative Developer Testing: Tao Xie North Carolina State University In collaboration with Xusheng ASE and Nikolai Tillmann, Peli de
Chapter 3 Collections. Objectives  Define the concepts and terminology related to collections  Explore the basic structures of the Java Collections.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
1 Exposing Behavioral Differences in Cross-Language API Mapping Relations Hao Zhong Suresh Thummalapenta Tao Xie Institute of Software, CAS, China IBM.
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
Improving Structural Testing of Object-Oriented Programs via Integrating Evolutionary Testing and Symbolic Execution Kobi Inkumsah Tao Xie Dept. of Computer.
Dynamic Testing.
Winter 2007SEG2101 Chapter 121 Chapter 12 Verification and Validation.
JAVA COLLECTIONS LIBRARY School of Engineering and Computer Science, Victoria University of Wellington COMP T2, Lecture 2 Marcus Frean.
Further Investigations into the Development and Evaluation of Reading Techniques for Object-Oriented Code Inspection Alastair Dunsmore, Marc Roper and.
Symstra: A Framework for Generating Object-Oriented Unit Tests using Symbolic Execution Tao Xie, Darko Marinov, Wolfram Schulte, and David Notkin University.
Finding bugs with a constraint solver daniel jackson. mandana vaziri mit laboratory for computer science issta 2000.
David Evans CS201J: Engineering Software University of Virginia Computer Science Lecture 5: Implementing Data Abstractions.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Test Case Purification for Improving Fault Localization presented by Taehoon Kwak SoftWare Testing & Verification Group Jifeng Xuan, Martin Monperrus [FSE’14]
Automated Object’s Statechart Generation and Testing from Class-Method Contracts Atul Gupta PhD Scholar, IIT Kapur, India.
Jeremy Nimmer, page 1 Automatic Generation of Program Specifications Jeremy Nimmer MIT Lab for Computer Science Joint work with.
Checking Inside the Black Box: Regression Fault Exposure and Localization Based on Value Spectra Differences Tao Xie Advisor: David Notkin Dept.
Chapter 8 – Software Testing
Specification-Based Unit Test Data Selection: Integrating Daikon and Jtest Tao Xie and David Notkin Computer Science & Engineering, University of.
Marcelo d’Amorim (UIUC)
Eclat: Automatic Generation and Classification of Test Inputs
SWE 619 Software Construction Last Modified, Fall 2015 Paul Ammann
Presentation transcript:

1 of 24 Automatic Extraction of Object-Oriented Observer Abstractions from Unit-Test Executions Dept. of Computer Science & Engineering University of Washington, Seattle Nov ICFEM 04, Seattle Tao Xie David Notkin

2 of 24 Motivation Manually created unit tests Valuable but often insufficient Automatically generated unit-test inputs A large number Without specifications, test-result inspection is impractical

3 of 24 Motivation Manually created unit tests Valuable but often insufficient Automatically generated unit-test inputs A large number Without specifications, test-result inspection is impractical Test selection for inspection [Xie&Notkin ASE 03]

4 of 24 Motivation Manually created unit tests Valuable but often insufficient Automatically generated unit-test inputs A large number Without specifications, test-result inspection is impractical Test selection for inspection [Xie&Notkin ASE 03] Test abstraction for inspection

5 of 24 Synopsis Dynamically extract observer abstractions from test executions A set of object state machines States represented by observer returns Focus on both method returns and object-state transitions Succinct and useful for inspection bug finding, bug isolation, component understanding, etc.

6 of 24 Outline Motivation Observer Abstractions Experience Related Work Conclusion

7 of 24 Object State Machine (OSM) M = (I, O, S, δ, λ, INIT) of a class c I: method calls in c’s interface O: returns of method calls S: states of c’s objects δ: S  I  P(S) state transition function λ: S  I  P(O) output function INIT: initial state

8 of 24 Object State Machine (OSM) M = (I, O, S, δ, λ, INIT) of a class c I: method calls in c’s interface O: returns of method calls S: states of c’s objects δ: S  I  P(S) state transition function λ: S  I  P(O) output function INIT: initial state States can be concrete or abstract

9 of 24 Concrete State Representation Rostra includes five techniques for state representation [Xie, Marinov, and Notkin ASE 04] WholeState technique Traversal: collect the values of all the fields transitively reachable from the object Linearization: remove reference addresses but keep reference relationship State comparison is reduced to sequence comparison

10 of 24 Concrete OSM of HashMap 58 concrete states, 5186 tests generated by Parasoft Jtest 4.5, Too complex to be useful (even too complex for graphviz [AT&T])

11 of 24 Abstract State Representation Abstraction function: observer A public method whose return type is not void. Abstract state representation: Return values of observers invoked on the concrete state State comparison is reduced to sequence comparison Observer abstraction An OSM with observer-abstracted states

12 of 24 Construction of Observer Abstractions Run the existing tests (generated by Parasoft Jtest) Collect concrete state representation Augment the existing tests Invoke all method arguments on each concrete state Collect abstract state representations (observer returns) Facilitate inspections (e.g. missing transitions) Generate one OSM for each observer method by default Group transitions (of the same method) with the same starting and ending states

13 of 24 Outline Motivation Observer Abstractions Experience Related Work Conclusion

14 of 24 exception OSM of BinSearchTree Bug/illegal-input isolation where to put preconditions/guard-condition checking? emission count transition count Hide self transitions by default Exception observer Exception state: a state reached after invoking an exception-throwing method Normal state: other states

15 of 24 contains OSM of BinSearchTree Bug/illegal-input isolation add(null) remove(null) new test

16 of 24 contains OSM of BinSearchTree Test 1 (T1): BSTree b1 = new BSTree(); b1.remove(null); Bug/illegal-input isolation add(null) remove(null)

17 of 24 contains OSM of BinSearchTree Test 1 (T1): BSTree b1 = new BSTree(); b1.remove(null); Test 2 (T2): BSTree b1 = new BSTree(); MyInput m1 = new MyInput(0); b1.add(m1); b1.remove(null); Bug/illegal-input isolation add(null) remove(null) when !isEmpty()

18 of 24 exception/repOk OSM of HashMap Illegal input: putAll(null) Class invariant: threshold shall be (int)(capacity * loadFactor). setLoadFactor sets loadFactor without updating threshold

19 of 24 get OSM of HashMap Suspicious transition: put(a0:null;a1:null;)?/ret.v:0![1/1] Expose an error in Java API doc for HashMap

20 of 24 Java API Doc for HashMap Returns: the value to which this map maps the specified key, or null if the map contains no mapping for this key. A return value of null does not necessarily indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to null.

21 of 24 isEmpty OSM of HashMap Almost the same as a manually created state machine for a container structure [Nguyen 98]

22 of 24 Lessons Extracted observer abstractions help investigate causes of uncaught exceptions identify weakness of an initial test suite find bugs in a class implementation or its documentation understand class behavior But some observer abstractions are complex three observers of HashMap produce 43 abstract states (e.g., Collection values() ) user-specified filtering criteria to display a portion of a complex observer abstraction extraction based on a user-specified subset of the initial tests

23 of 24 Related Work Sliced OSM extraction [Xie&Notkin SAVCBS 04] Daikon [Ernst et al. 01] and algebraic spec discovery [Henkel&Diwan 03] Focus on intra-method or method-pair properties Component interface extraction [Whaley et al. 02] and specification mining [Ammons et al. 02] Assume availability of “good” system tests Extract complete graphs from generated unit tests Predicate abstraction [Graf&Saidi 97, Ball et al. 00] Returns of predicates are limited to boolean values Focus on program states between program statements FSM generation from ASM [Grieskamp et al. 02] Require user-defined indistinguishability properties

24 of 24 Conclusion Need tool support to help test inspection too many automatically generated test inputs Extract observer abstractions from test executions succinct and useful object-state-transition information for inspection Provide some benefits of formal methods without the pain of writing specifications.

25 of 24 Questions?