Achievements and Challenges

Size: px
Start display at page:

Download "Achievements and Challenges"

Transcription

1 Improving Automation in Developer Testing: Achievements and Challenges Tao Xie Department of Computer Science North Carolina State University An up-to-date version of the slides is available at:

2 Who Am I? Tao Xie, Assistant Professor (2005-), Department of Computer Science, North Carolina State Univ. Received Ph.D. from Univ. of Washington Work on Automated Software Testing + Mining Software Engineering Data Automated Testing of Traditional Programs (especially OO programs) Software Security (including Security Policies) Aspect-Oriented Programs Web Services and Applications Software Designs 2

3 Why Am I Here? My research closely related to testing practices Focus on real problems Develop practical solutions Collaborate with industry Main objectives of the presentation Communicate research achievements/challenges Discuss promising solutions to address challenges Explore common ways to compare/assess tools Provide a basis for academia-industry collaborations 3

4 Why Automate Testing? Software testing is important Software errors cost the U.S. economy about $59.5 billion each year (0.6% of the GDP) [NIST 02] Improving testing infrastructure could save 1/3 cost [NIST 02] Software testing is costly Account for even half the total cost of software development [Beizer 90] Automated testing reduces manual testing effort Test execution: JUnit framework Test generation: AgitarOne, Parasoft Jtest, etc. Test-behavior checking: AgitarOne, Parasoft Jtest, etc. 4

5 Automation in Developer Testing Background on developer testing Kent Beck s 2004 talk on Future of Developer Testing This talk focuses on developer testing Not system testing etc. conducted by testers This talk focuses on automation in developer testing Not tester training/education, test process, test management, etc. This talk focuses on both research and industrial test automation tools 5

6 Software Testing Setup Test inputs + Program Outputs? = Expected Outputs Test Oracles 6

7 Software Testing Problems Test inputs + Program Outputs? = Expected Outputs Test Oracles Faster: How can tools help developers create and run tests faster? 7

8 Software Testing Problems Test inputs + Program Outputs? = Expected Outputs Test Oracles Faster: How can tools help developers create and run tests faster? Better Test Inputs: How can tools help generate new better test inputs? 8

9 Software Testing Problems Test inputs + Program Outputs? = Expected Outputs Test Oracles Faster: How can tools help developers create and run tests faster? Better Test Inputs: How can tools help generate new better test inputs? Better Test Oracles: How can tools help generate better test oracles? 9

10 Example Unit Test Case Test inputs + Program Outputs? = Expected Outputs Test Oracles void addtest() { ArrayList a = new ArrayList(1); Object o = new Object(); a.add(o); AssertTrue(a.get(0) == o); } Test Case = Test Input + Test Oracle Appropriate method sequence Appropriate primitive argument values Appropriate assertions 10

11 Faster Test inputs + Program Outputs? = Expected Outputs Test Oracles Create test inputs faster Run test inputs faster 11

12 Faster with Capture/Replay Originally used in GUI/Web testing E.g., IBM Rational Robot/Functional Tester, Mercury WinRunner, Seapine QA Wizard, AutomatedQA TestComplete, Segue SilkTest. Capture and replay the interactions between a program unit in a system and the rest of the system Capture: run a system manually or with system tests and capture interactions to the unit Replay: run unit tests created from the interactions 12

13 Capture/Replay - example System code:... ArrayList a = new ArrayList(1); HashMap h = new HashMap(); h.add(a); Object o = new Object(); a.add(o);... public void test1() { ArrayList a = new ArrayList(1); Object o = new Object(); a.add(o); } 13

14 Capture/Replay: benefits & limitations Create test inputs faster Otherwise, need manually write these unit tests Run test inputs faster Run only less-expensive unit tests (not the whole system tests) with the same effects w.r.t. the unit Limitations No new program behavior is exercised (e.g., no new bugs/coverage can be exercised beyond the whole system tests) Useful primarily for regression testing 14

15 Capture/Replay: example tools SilverMark Test Mentor Object Interaction Recording Limited on only methods with primitive arguments Parasoft Jtest Test Case Sniffer/Jtest Tracer Research Prototypes Orso&Kennedy WODA 05, Saff et al. ASE 05, Elbaum et al. FSE 06 15

16 Capture/Replay: challenges Non-primitive argument value in unit interface (De)serialization: too sensitive to implementation details Method sequence: need instrument many call sites Expensive method calls on objects (including argument objects) inside the unit E.g., DB interactions, Eclipse plugin interactions Solution: automatic mock object creation Capture/replay [Saff&Ernst PASTE 04][Parasoft Jtest]: too sensitive to changes on behavior of these method calls Upon needed by usage logics of API rets [Tillmann&Schulte ASE 06] at Microsoft Research Pex (different purpose) 16

17 Stub Creation in Parasoft Jtest Stubs are replacements for references to external methods Related to mock object creation Used e.g., when a class that uses interfaces for which an implementation has not yet been written When Jtest automatically generates test inputs, it adds stubs to test cases if a class references external resources. Allow user-defined stubs (Jtest creates templates) 17

18 Assisting Developers to Write Tests (Faster) Motivation: There exist IDE supports for developers to write production code faster but few for developers to write test code faster Example prototype: UnitPlus at NCSU Keep track of historical test code Analyze the unit code under test Recommend historical method sequences to choose for non-primitive arguments Recommend assertions to choose for asserting method behavior (more details later) [Song, Thummalapenta, and Xie ETX 07] 18

19 Software Testing Problems Test inputs + Program Outputs? = Expected Outputs Test Oracles Faster: How can tools help developers create and run tests faster? Better Test Inputs: How can tools help generate new better test inputs? Method-argument generation Method-sequence generation Better Test Oracles: How can tools help generate better test oracles? 19

20 Better Test Inputs Objectives are to make the unit execution crash (throwing uncaught exception) if possible most tools report crashes violate properties if possible cover all coverable entities (e.g., statements, blocks, and branches) most tools report code coverage Existing test inputs may not be sufficient Recall that capture/replay techniques don t go beyond the behavior exercised by existing system tests Need generate new test inputs to achieve objectives 20

21 Deal with Illegal Test Inputs Design by Contract (e.g., Parasoft Jtest, CodePro AnalytiX, MSR Spec Explorer) Define preconditions Tools generate only test inputs that satisfy preconditions Defensive Programming (e.g., AgitatorOne) Write illegal-input handling code in the beginning of the method body Tools may generate test inputs that violate preconditions 21

22 Challenges in Test-Input Generation Method-argument generation Covering branches involving complex logics in code require sophisticated argument values Need to deal with non-primitive arguments Receiver-object-state generation Similar to non-primitive-argument generation Covering branches involving complex logics in code require sophisticated receiver-object states (field values) 22

23 Method-Argument Generation Default values for specific types E.g., -1, 0, 1 for int Random values Heuristics E.g., based on values at switch, conditionals Constraint solving Example tool: Avaya Labs Research exvantage Symbolic execution [King CACM 76] Example tools: Parasoft Jtest, AgitarOne, MSR Pex 23

24 Symbolic Execution: example Adapted from slide by D. Rietmann Adapted from slide by D. Rietmann 24

25 Method-Sequence Generation What if method arguments are objects? Most tools use null or one constructor call Often need method sequences to produce desirable argument object states Similarly need method sequences to produce desirable receiver-object states of the class under test 25

26 Method-Sequence Generation cont. Random sequences within length bound Most tools use method-call sequence of length 1 i.e., constructor call + one public method call + some observer calls Parasoft Jtest 4.5 allows up to length 3 but disable this configuration in later releases (which generate tests often with length 1 by default) Sequences generated by heuristics (MSR Pex) Constructors Methods (modify this, modify any other formal parameters, or return a new result) 26

27 Method-Sequence Generation cont. Bounded exhaustive sequences Parasoft Jtest 4.5 considered as quasi-boundedexhaustive sequences Bounded exhaustive sequences by pruning equivalent concrete states [Xie et al. ASE 04][Visser et al. ISSTA 04] Bounded exhaustive sequences by pruning equivalent/subsumed symbolic states [Xie et al. TACAS 05] 27

28 Limitations of Automation Machines may not be good at guessing/generating some types of test inputs Need collaboration from developers Implicit: exploiting existing tests written by developers Explicit: allowing developers to contribute Operational profiles may be helpful [Woit ISSTA 03][Musa 04][Binder SoftwareTech 04] 28

29 Exploiting Existing Tests Manually written test code (call sites in the rest of the system) incorporates valuable domain/application knowledge Worthwhile to exploit in automated test generation Tradeoff between two extremes Exactly capture and replay in test generation Totally ignore existing tests in test generation Exploiting existing tests to help reuse/adapt existing method arguments reuse/adapt existing method sequences 29

30 Exploiting Existing Tests cont. Reuse method arguments Rostra [Xie et al. ASE 04] Reuse method sequence skeletons MSR Pex [Tillmann&Schulte IEEE Software 06] Generalize program states Jov [Xie&Notkin ASE 03], Eclat [Pacheco&Ernst ECOOP 05] Generalize method sequences/program states Substra [Yuan&Xie AST 06] 30

31 Allowing Developers to Contribute Allow to specify data factory for a class type E.g., test-input factories/test helpers in AgitarOne E.g., object repositories in Parasoft Jtest E.g., factory classes in CodePro AnalytiX and Pex Suggest quick fixes E.g., add precondition in Parasoft Jtest E.g., add defensive-programming check in Pex Allow to edit generated tests E.g., CodePro AnalytiX, Parasoft Jtest 31

32 Test Editing in CodePro AnalytiX Image from 32

33 Software Testing Problems Test inputs + Program Outputs? = Expected Outputs Test Oracles Faster: How can tools help developers create and run tests faster? Better Test Inputs: How can tools help generate new better test inputs? Better Test Oracles: How can tools help generate better test oracles? Assert behavior of individual test inputs Assert behavior of multiple test inputs 33

34 Levels of Test Oracles Expected output for an individual test input In the form of assertions in test code Properties applicable for multiple test inputs Crash (uncaught exceptions) or not, related to robustness issues, supported by most tools Properties in production code: Design by Contract (precondition, postcondition, class invariants) supported by Parasoft Jtest, CodePro AnalytiX Properties in test code: parameterized unit tests supported by MSR Pex, AgitarOne 34

35 Economics of Test Oracles Expected output for an individual test input Easy to manually verify for one test input Expensive/infeasible to verify for many test inputs Limited benefits: only for one test input Properties applicable for multiple test inputs Not easy to write (need abstraction skills) But once written, broad benefits for multiple test inputs 35

36 Assert behavior of individual test inputs Capture and Assert Capture and Assert [Xie ECOOP 06] Phase I: Capture the return values of observer methods Phase II: Create assertions to assert return values Also assert uncaught exception throwing Example tools: Parasoft Jtest, CodePro AnalytiX, AgitarOne 36

37 Capture and Assert: example public void test1() { Stack s1 = new Stack(); s1.push(3); s1.top(); s1.ismember(3); } public void test1() { Stack s1 = new Stack(); s1.push(3); assertequals(s1.top(), 3); assertequals(s1.ismember(3), true); } 37

38 Capture and Assert: issues For regression testing only unless you verify If your current version has a bug, the assertion makes sure your bug exists in a future version! Ask developers to verify assertions/exceptions in test code Example tools: Parasoft Jtest and CodePro AnalytiX 38

39 Verify Outcomes in Parasoft Jtest Image from 39

40 Capture and Assert: issues For regression testing only unless you verify If your current version has a bug, the assertion makes sure your bug exists in a future version! Ask developer to verify assertions/exceptions in test code Challenge: which observer methods to invoke? (i.e., which assertions to add?) 40

41 Recommend Assertions to Developers [Song, Thummalapenta, and Xie ETX 07] [Song, Thummalapenta, and Xie ETX 07] 41

42 Assert behavior of multiple test inputs Design by Contract Example tools: Parasoft Jtest, CodePro AnalytiX, Microsoft Research Spec Explorer, MSR Pex Class invariant: properties being satisfied by an object (in a consistent state) [AgitarOne allows a class invariant helper method used as test oracles] Precondition: conditions to be satisfied (on receiver object and arguments) before a method can be invoked Postcondition: properties being satisfied (on receiver object and return) after the method has returned Other types of specs also exist 42

43 Microsoft Research Spec Explorer - Slide adapted from MSR FSE Group

44 Assert behavior of multiple test inputs Parameterized Unit Tests Adding parameters turns unit tests into general specs [TestMethod] void AddParameterizedTest(ArrayList a, object o) { Assume.IsTrue(a!= null); int len = a.count; a.add(o); Assert.IsTrue(a[len] == o); } Read as forall a, o: the given assertion holds Tool chooses argument values that cover all implementation paths // 1. case: existing storage used AddParameterizedTest(new ArrayList(1), new object()) // 2. case: new storage allocated AddParameterizedTest(new ArrayList(0), new object()); Supported by MSR Pex [Tillmann&Schulte FSE 05] and AgitarOne - Slide adapted from MSR FSE Group 44

45 Parameterized Unit Tests in Pex Image from 45

46 Assert behavior of multiple test inputs Software Agitation in AgitarOne Software Agitation Code Observations on code behavior, plus Test Coverage data If an Observation reveals a bug, fix it Code Compile Agitate If it describes desired behavior, click to create a Test Assertion Review - Slide adapted from Agitar Software Inc. 46

47 Software Agitation in AgitarOne Image from 47

48 Test Selection/Abstraction Test selection based on code coverage, e.g., Parasoft Jtest new behavior [Xie&Notkin ASE 03, d'amorim et al. ASE 06] special behavior [Xie&Notkin ISSRE 05] Test abstraction for overall behavior [Xie&Notkin ICFEM 04] r(a(s, e).state).state == a (r(s).state, e).state 48

49 Conclusion Software testing is important and yet costly; needs automation Faster: help developers create and run tests faster Capture/replay techniques IDE supports for writing test code Better Test Inputs: help generate new better test inputs Generate method arguments Generate method sequences Better Test Oracles: help generate better test oracles Assert behavior of individual test inputs Assert behavior of multiple test inputs 49

50 Example Industrial Developer Testing Tools Agitar AgitatorOne Parasoft Jtest CodePro AnalytiX SilverMark Test Mentor Microsoft Research Pex (for.net) Microsoft Research Spec Explorer (for.net) Avaya Labs Research exvantage 50

51 ICST 2008 First International Conference on Software Testing, Verification and Validation Lillehammer, Norway April 9-11, 2008 Call for Participation Conference program includes Research papers Industry papers Student papers Various workshops

52 Questions? Contact info: Tao Xie Automated Software Engineering Group North Carolina State University Acknowledgment of feedback especially from Dave Weiss

Automated Software Testing in the Absence of Specifications

Automated Software Testing in the Absence of Specifications Automated Software Testing in the Absence of Specifications Tao Xie North Carolina State University Department of Computer Science Nov 2005 http://www.csc.ncsu.edu/faculty/xie/ Why Automate Testing? Software

More information

Automated Test-Input Generation

Automated Test-Input Generation Automated Test-Input Generation Tao Xie North Carolina State University Department of Computer Science Nov 2005 http://www.csc.ncsu.edu/faculty/xie/ Why Automate Testing? Software testing is important

More information

Automatic Extraction of Abstract- Object-State Machines Based on Branch Coverage

Automatic Extraction of Abstract- Object-State Machines Based on Branch Coverage Automatic Extraction of Abstract- Object-State Machines Based on Branch Coverage Hai YUAN Tao XIE Department of Computer Science North Carolina State University hyuan3@ncsu.edu xie@csc.ncsu.edu Agenda

More information

An Empirical Comparison of Automated Generation and Classification Techniques for Object-Oriented Unit Testing

An Empirical Comparison of Automated Generation and Classification Techniques for Object-Oriented Unit Testing An Empirical Comparison of Automated Generation and Classification Techniques for Object-Oriented Unit Testing Marcelo d Amorim (UIUC) Carlos Pacheco (MIT) Tao Xie (NCSU) Darko Marinov (UIUC) Michael D.

More information

Evolving Testing and Analysis for Evolving Software Tao Xie Peking University ( ), China North Carolina State University Raleigh, NC, USA

Evolving Testing and Analysis for Evolving Software Tao Xie Peking University ( ), China North Carolina State University Raleigh, NC, USA Evolving Testing and Analysis for Evolving Software Tao Xie Peking University (2011-2012), China North Carolina State University Raleigh, NC, USA In Collaboration with Microsoft Research Redmond/Asia,

More information

Automatically Identifying Special and Common Unit Tests for Object-Oriented Programs

Automatically Identifying Special and Common Unit Tests for Object-Oriented Programs Automatically Identifying Special and Common Unit Tests for Object-Oriented Programs Tao Xie North Carolina State University Raleigh, NC David Notkin University of Washington Seattle, WA Automated Testing

More information

Mutually Enhancing Test Generation and Specification Inference

Mutually Enhancing Test Generation and Specification Inference Mutually Enhancing Test Generation and Specification Inference Tao Xie David Notkin Department of Computer Science & Engineering University of Washington August 15th, 2003 Foundations of Software Engineering,

More information

Jtest Tutorial. Tutorial

Jtest Tutorial. Tutorial Jtest Jtest Welcome to the Jtest. This tutorial walks you through how to perform common Jtest tasks using example files. Please note that although the four types of tests (static analysis, white-box testing,

More information

Directed Random Testing*

Directed Random Testing* Directed Random Testing* Wolfram Schulte Microsoft Research Soqua 11/2006 Wasformerlyanouncedas: ChalengeProblemsinTesting 1 What my team does Static program verification & language design Verifying multi-threaded

More information

Detecting Redundant Unit Tests for AspectJ Programs

Detecting Redundant Unit Tests for AspectJ Programs Detecting Redundant Unit Tests for AspectJ Programs Tao Xie 1 Jianjun Zhao 2 Darko Marinov 3 David Notkin 4 1 North Carolina State University 2 Shanghai Jiaotong University 3 University of Illinois at

More information

An Introduction To Software Agitation

An Introduction To Software Agitation An Introduction To Software Agitation Alberto Savoia Chief Technology Officer Agitar Software Inc. www.agitar.com java.sun.com/javaone/sf Agenda The Developer Testing Revolution Four Types of Tests Software

More information

Automatic Extraction of Abstract-Object-State Machines Based on Branch Coverage

Automatic Extraction of Abstract-Object-State Machines Based on Branch Coverage Automatic Extraction of Abstract-Object-State Machines Based on Branch Coverage Hai Yuan Department of Computer Science North Carolina State University Raleigh, NC 27695 hyuan3@ncsu.edu Tao Xie Department

More information

State Extensions for Java PathFinder

State Extensions for Java PathFinder State Extensions for Java PathFinder Darko Marinov University of Illinois at Urbana-Champaign JPF Workshop May 1, 2008 Broader Context: Work on JPF at UIUC Two lines of work Extend functionality Improve

More information

Test automation / JUnit. Building automatically repeatable test suites

Test automation / JUnit. Building automatically repeatable test suites Test automation / JUnit Building automatically repeatable test suites Test automation n Test automation is software that automates any aspect of testing n Generating test inputs and expected results n

More information

Test automation Test automation / JUnit

Test automation Test automation / JUnit Test automation Test automation / JUnit Building automatically repeatable test suites Test automation is software that automates any aspect of testing Generating test inputs and expected results Running

More information

Software Engineering

Software Engineering Software Engineering Lecture 13: Testing and Debugging Testing Peter Thiemann University of Freiburg, Germany SS 2014 Recap Recap Testing detect the presence of bugs by observing failures Recap Testing

More information

Fitness-Guided Path Exploration in Automated Test Generation

Fitness-Guided Path Exploration in Automated Test Generation Fitness-Guided Path Exploration in Automated Test Generation Tao Xie Department of North Carolina State University http://ase.csc.ncsu.edu/ Joint work with Nikolai Tillmann, Peli de Halleux, Wolfram Schulte

More information

Exploiting Synergy Between Testing and Inferred Partial Specifications

Exploiting Synergy Between Testing and Inferred Partial Specifications Exploiting Synergy Between Testing and Inferred Partial Specifications Tao Xie David Notkin Department of Computer Science & Engineering, University of Washington {taoxie, notkin}@cs.washington.edu Technical

More information

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Lecture 04 Software Test Automation: JUnit as an example

More information

Feedback-directed Random Test Generation

Feedback-directed Random Test Generation Feedback-directed Random Test Generation (ICSE 07 with minor edits) Carlos Pacheco Shuvendu Lahiri Michael Ernst Thomas Ball MIT Microsoft Research Random testing Select inputs at random from a program

More information

Software Engineering Testing and Debugging Testing

Software Engineering Testing and Debugging Testing Software Engineering Testing and Debugging Testing Prof. Dr. Peter Thiemann Universitt Freiburg 08.06.2011 Recap Testing detect the presence of bugs by observing failures Debugging find the bug causing

More information

Leveraging Test Generation and Specification Mining for Automated Bug Detection without False Positives

Leveraging Test Generation and Specification Mining for Automated Bug Detection without False Positives Leveraging Test Generation and Specification Mining for Automated Bug Detection without False Positives Michael Pradel and Thomas R. Gross Department of Computer Science ETH Zurich 1 Motivation API usage

More information

A Novel Approach to Unit Testing: The Aspect-Oriented Way

A Novel Approach to Unit Testing: The Aspect-Oriented Way A Novel Approach to Unit Testing: The Aspect-Oriented Way Guoqing Xu and Zongyuan Yang Software Engineering Lab, Department of Computer Science East China Normal University 3663, North Zhongshan Rd., Shanghai

More information

Exploring Code with Microsoft Pex

Exploring Code with Microsoft Pex Exploring Code with Microsoft Pex Tutorial for Automated Whitebox Testing for.net Applications Abstract Microsoft Pex 2010 is a Microsoft Visual Studio add-in that provides a runtime code analysis tool

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany Softwaretechnik Lecture 08: Testing and Debugging Overview Peter Thiemann University of Freiburg, Germany SS 2012 Literature Essential Reading Why Programs Fail: A Guide to Systematic Debugging, A Zeller

More information

Test Factoring: Focusing test suites on the task at hand

Test Factoring: Focusing test suites on the task at hand Test Factoring: Focusing test suites on the task at hand, MIT ASE 2005 1 The problem: large, general system tests My test suite One hour Where I changed code Where I broke code How can I get: Quicker feedback?

More information

Testing, Debugging, Program Verification

Testing, Debugging, Program Verification Testing, Debugging, Program Verification Automated Test Case Generation, Part II Wolfgang Ahrendt & Vladimir Klebanov & Moa Johansson 12 December 2012 TDV: ATCG II /GU 2011-12-12 1 / 17 Recap Specification-/Model-Based

More information

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany Softwaretechnik Lecture 08: Testing and Debugging Overview Peter Thiemann University of Freiburg, Germany SS 2012 Literature Essential Reading Why Programs Fail: A Guide to Systematic Debugging, A Zeller

More information

Utilizing Fast Testing to Transform Java Development into an Agile, Quick Release, Low Risk Process

Utilizing Fast Testing to Transform Java Development into an Agile, Quick Release, Low Risk Process Utilizing Fast Testing to Transform Java Development into an Agile, Quick Release, Low Risk Process Introduction System tests, often called slow tests, play a crucial role in nearly every Java development

More information

Tool-Assisted Unit Test Selection Based on Operational Violations

Tool-Assisted Unit Test Selection Based on Operational Violations Nominated for the best paper award at ASE 2003. Appears in Proceedings of the 18th IEEE International Conference on Automated Software Engineering (ASE 2003) An extended version is invited for submission

More information

assertion-driven analyses from compile-time checking to runtime error recovery

assertion-driven analyses from compile-time checking to runtime error recovery assertion-driven analyses from compile-time checking to runtime error recovery sarfraz khurshid the university of texas at austin state of the art in software testing and analysis day, 2008 rutgers university

More information

BERT: BEhavioral Regression Testing

BERT: BEhavioral Regression Testing BERT: BEhavioral Regression Testing Alessandro Orso College of Computing Georgia Institute of Technology orso@cc.gatech.edu Tao Xie Department of Computer Science North Carolina State University xie@csc.ncsu.edu

More information

Data Structures. BSc in Computer Science University of New York, Tirana. Assoc. Prof. Marenglen Biba 1-1

Data Structures. BSc in Computer Science University of New York, Tirana. Assoc. Prof. Marenglen Biba 1-1 Data Structures BSc in Computer Science University of New York, Tirana Assoc. Prof. Marenglen Biba 1-1 General info Course : Data Structures (3 credit hours) Instructor : Assoc. Prof. Marenglen Biba Office

More information

Introduction to Programming System Design CSCI 455x (4 Units)

Introduction to Programming System Design CSCI 455x (4 Units) Introduction to Programming System Design CSCI 455x (4 Units) Description This course covers programming in Java and C++. Topics include review of basic programming concepts such as control structures,

More information

Generating Parameterized Unit Tests

Generating Parameterized Unit Tests Generating Parameterized Unit Tests Gordon Fraser Saarland University Computer Science Saarbrücken, Germany fraser@cs.uni-saarland.de Andreas Zeller Saarland University Computer Science Saarbrücken, Germany

More information

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)?

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)? Testing CMSC 433 Programming Language Technologies and Paradigms Spring 2007 Testing Feb. 15, 2007 Some slides adapted from FSE 98 Tutorial by Michal Young and Mauro Pezze Execute program on sample input

More information

Combined Static and Dynamic Automated Test Generation

Combined Static and Dynamic Automated Test Generation Combined Static and Dynamic Automated Test Generation Sai Zhang University of Washington Joint work with: David Saff, Yingyi Bu, Michael D. Ernst 1 Unit Testing for Object-oriented Programs Unit test =

More information

Top Down Design vs. Modularization

Top Down Design vs. Modularization 6.170 Quiz Review Topics: 1. Decoupling 2. 3. AF & RI 4. Iteration Abstraction & Iterators 5. OMs and Invariants 6. Equality, Copying, Views 7. 8. Design Patterns 9. Subtyping 10. Case Studies Decomposition

More information

No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages

No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages No Source Code : Software Testing Black-Box Testing Test-Driven Development No access to source code So test cases don t worry about structure Emphasis is only on ensuring that the contract is met Specification-Based

More information

Program Correctness and Efficiency. Chapter 2

Program Correctness and Efficiency. Chapter 2 Program Correctness and Efficiency Chapter 2 Chapter Objectives To understand the differences between the three categories of program errors To understand the effect of an uncaught exception and why you

More information

Motivation. Correct and maintainable software Cost effective software production Implicit assumptions easily broken

Motivation. Correct and maintainable software Cost effective software production Implicit assumptions easily broken Spec# Andreas Vida Motivation Correct and maintainable software Cost effective software production Implicit assumptions easily broken Need more formal f specification Integration into a popular language

More information

Program Verification (6EC version only)

Program Verification (6EC version only) Program Verification (6EC version only) Erik Poll Digital Security Radboud University Nijmegen Overview Program Verification using Verification Condition Generators JML a formal specification language

More information

Software LEIC/LETI. Lecture 5

Software LEIC/LETI. Lecture 5 Software Engineering @ LEIC/LETI Lecture 5 Last Lecture Verification and Validation Reviews and Inspections Software Testing Coverage Statement, branch, and path coverage Equivalence partitioning Boundary

More information

MSO Lecture Design by Contract"

MSO Lecture Design by Contract 1 MSO Lecture Design by Contract" Wouter Swierstra (adapted by HP, AL) October 8, 2018 2 MSO SO FAR Recap Abstract Classes UP & Requirements Analysis & UML OO & GRASP principles Design Patterns (Facade,

More information

Static Analysis in Practice

Static Analysis in Practice in Practice 17-654/17-754: Analysis of Software Artifacts Jonathan Aldrich 1 Quick Poll Who is familiar and comfortable with design patterns? e.g. what is a Factory and why use it? 2 1 Outline: in Practice

More information

Black Box Testing. EEC 521: Software Engineering. Specification-Based Testing. No Source Code. Software Testing

Black Box Testing. EEC 521: Software Engineering. Specification-Based Testing. No Source Code. Software Testing Black Box Testing EEC 521: Software Engineering Software Testing Black-Box Testing Test-Driven Development Also known as specification-based testing Tester has access only to running code and the specification

More information

DyGen: Automatic Generation of High-Coverage Tests via Mining Gigabytes of Dynamic Traces

DyGen: Automatic Generation of High-Coverage Tests via Mining Gigabytes of Dynamic Traces DyGen: Automatic Generation of High-Coverage Tests via Mining Gigabytes of Dynamic Traces Suresh Thummalapenta 1, Jonathan de Halleux 2, Nikolai Tillmann 2, Scott Wadsworth 3 1 Department of Computer Science,

More information

EECS 4313 Software Engineering Testing

EECS 4313 Software Engineering Testing EECS 4313 Software Engineering Testing Topic 03: Test automation / JUnit - Building automatically repeatable test suites Zhen Ming (Jack) Jiang Acknowledgement Some slides are from Prof. Alex Orso Relevant

More information

Self-checking software insert specifications about the intent of a system

Self-checking software insert specifications about the intent of a system Assertions Reading assignment A. J. Offutt, A Practical System for Mutation Testing: Help for the Common Programmer, Proceedings of the 12th International Conference on Testing Computer Software, Washington,

More information

Environment Modeling for Automated Testing of Cloud Applications

Environment Modeling for Automated Testing of Cloud Applications Environment Modeling for Automated Testing of Cloud Applications Linghao Zhang 1,2, Tao Xie 2, Nikolai Tillmann 3, Peli de Halleux 3, Xiaoxing Ma 1, Jian lv 1 1 Nanjing University, China, 2 North Carolina

More information

Assertions, pre/postconditions

Assertions, pre/postconditions Programming as a contract Assertions, pre/postconditions Assertions: Section 4.2 in Savitch (p. 239) Specifying what each method does q Specify it in a comment before method's header Precondition q What

More information

Automatic Generation of Program Specifications

Automatic Generation of Program Specifications Automatic Generation of Program Specifications Jeremy Nimmer MIT Lab for Computer Science http://pag.lcs.mit.edu/ Joint work with Michael Ernst Jeremy Nimmer, page 1 Synopsis Specifications are useful

More information

AJAX: Automating an Informal Formal Method for Systematic JUnit Test Suite Generation

AJAX: Automating an Informal Formal Method for Systematic JUnit Test Suite Generation AJAX: Automating an Informal Formal Method for Systematic JUnit Test Suite Generation David Stotts Dept. of Computer Science Univ. of North Carolina at Chapel Hill stotts@cs.unc.edu Abstract The JUnit

More information

Programming Embedded Systems

Programming Embedded Systems Programming Embedded Systems Lecture 8 Overview of software testing Wednesday Feb 8, 2012 Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se 1/53 Lecture outline Testing in general Unit testing

More information

Testing. Prof. Clarkson Fall Today s music: Wrecking Ball by Miley Cyrus

Testing. Prof. Clarkson Fall Today s music: Wrecking Ball by Miley Cyrus Testing Prof. Clarkson Fall 2017 Today s music: Wrecking Ball by Miley Cyrus Review Previously in 3110: Modules Specification (functions, modules) Today: Validation Testing Black box Glass box Randomized

More information

Code Contracts in C#

Code Contracts in C# Code Contracts in C# Hans-Wolfgang Loidl School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh Semester 1 2018/19 H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC

More information

Automated Random Testing to Detect Specification-Code Inconsistencies

Automated Random Testing to Detect Specification-Code Inconsistencies Automated Random Testing to Detect Specification-Code Inconsistencies Yoonsik Cheon TR #07-07 February 2007; revised March 2007 Keywords: random testing, test data generator, test oracle, pre and postconditions,

More information

Test automation / JUnit. Building automatically repeatable test suites

Test automation / JUnit. Building automatically repeatable test suites Test automation / JUnit Building automatically repeatable test suites JUnit in Eclipse For this course, we will use JUnit in Eclipse It is automatically a part of Eclipse One documentation site (all one

More information

hwu-logo.png 1 class Rational { 2 int numerator ; int denominator ; 4 public Rational ( int numerator, int denominator ) {

hwu-logo.png 1 class Rational { 2 int numerator ; int denominator ; 4 public Rational ( int numerator, int denominator ) { Code Contracts in C# Hans-Wolfgang Loidl School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh Semester 1 2017/18 Motivation Debugging programs is time-consuming

More information

Software Testing Workshop 2014 Introduction

Software Testing Workshop 2014 Introduction Software Testing Workshop 2014 Introduction May 3 rd 2014. FAST, Islamabad. About Us Majd Uddin 15+ years of experience with a decade in software testing Promoting software quality: M.Sc. (CS) from PUCIT,

More information

CS 215 Software Design Homework 3 Due: February 28, 11:30 PM

CS 215 Software Design Homework 3 Due: February 28, 11:30 PM CS 215 Software Design Homework 3 Due: February 28, 11:30 PM Objectives Specifying and checking class invariants Writing an abstract class Writing an immutable class Background Polynomials are a common

More information

Cpt S 122 Data Structures. Course Review Midterm Exam # 2

Cpt S 122 Data Structures. Course Review Midterm Exam # 2 Cpt S 122 Data Structures Course Review Midterm Exam # 2 Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Midterm Exam 2 When: Monday (11/05) 12:10 pm -1pm

More information

Continuous Testing in Eclipse. David Saff, Michael D. Ernst MIT CSAIL etx 2004, Barcelona, Spain

Continuous Testing in Eclipse. David Saff, Michael D. Ernst MIT CSAIL etx 2004, Barcelona, Spain Continuous Testing in Eclipse David Saff, Michael D. Ernst MIT CSAIL etx 2004, Barcelona, Spain Continuous testing: inspired by continuous compilation Continuous compilation, as in Eclipse, notifies the

More information

Static program checking and verification

Static program checking and verification Chair of Software Engineering Software Engineering Prof. Dr. Bertrand Meyer March 2007 June 2007 Slides: Based on KSE06 With kind permission of Peter Müller Static program checking and verification Correctness

More information

Learning outcomes. Systems Engineering. Debugging Process. Debugging Process. Review

Learning outcomes. Systems Engineering. Debugging Process. Debugging Process. Review Systems Engineering Lecture 9 System Verification II Dr. Joanna Bryson Dr. Leon Watts University of Bath Department of Computer Science 1 Learning outcomes After both lectures and doing the reading, you

More information

Static Analysis in Practice

Static Analysis in Practice in Practice 15-313: Foundations of Software Engineering Jonathan Aldrich 1 Outline: in Practice Case study: Analysis at ebay Case study: Analysis at Microsoft Analysis Results and Process Example: Standard

More information

Steps for project success. git status. Milestones. Deliverables. Homework 1 submitted Homework 2 will be posted October 26.

Steps for project success. git status. Milestones. Deliverables. Homework 1 submitted Homework 2 will be posted October 26. git status Steps for project success Homework 1 submitted Homework 2 will be posted October 26 due November 16, 9AM Projects underway project status check-in meetings November 9 System-building project

More information

InsECTJ: A Generic Instrumentation Framework for Collecting Dynamic Information within Eclipse

InsECTJ: A Generic Instrumentation Framework for Collecting Dynamic Information within Eclipse InsECTJ: A Generic Instrumentation Framework for Collecting Dynamic Information within Eclipse Arjan Seesing and Alessandro Orso College of Computing Georgia Institute of Technology a.c.seesing@ewi.tudelft.nl,

More information

17. Assertions. Outline. Built-in tests. Built-in tests 3/29/11. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen

17. Assertions. Outline. Built-in tests. Built-in tests 3/29/11. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen 17. Assertions Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen Outline Introduction (BIT, assertion, executable assertion, why?) Implementation-based vs responsability-based assertions Implementation

More information

Test Automation. 20 December 2017

Test Automation. 20 December 2017 Test Automation 20 December 2017 The problem of test automation Testing has repetitive components, so automation is justified The problem is cost-benefit evaluation of automation [Kaner] Time for: test

More information

17. Assertions. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen

17. Assertions. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen 17. Assertions Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen Outline Introduction (BIT, assertion, executable assertion, why?) Implementation-based vs responsability-based assertions Implementation

More information

GenUTest: An Automatic Unit Test & Mock Aspect Generation Tool

GenUTest: An Automatic Unit Test & Mock Aspect Generation Tool Tel Aviv University The Raymond and Beverly Sackler Faculty of Exact Sciences GenUTest: An Automatic Unit Test & Mock Aspect Generation Tool Thesis submitted in partial fulfillment of the requirements

More information

EXAMINATIONS 2012 END-OF-YEAR SWEN222. Software Design. Question Topic Marks 1. Design Quality Design Patterns Design by Contract 12

EXAMINATIONS 2012 END-OF-YEAR SWEN222. Software Design. Question Topic Marks 1. Design Quality Design Patterns Design by Contract 12 T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Student ID:..................... EXAMINATIONS 2012 END-OF-YEAR SWEN222 Software Design Time

More information

Test-Driven Development JUnit

Test-Driven Development JUnit Test-Driven Development JUnit Click to edit Master EECS text 2311 styles - Software Development Project Second level Third level Fourth level Fifth level Wednesday, January 18, 2017 1 Simulator submission

More information

DART: Directed Automated Random Testing

DART: Directed Automated Random Testing DART: Directed Automated Random Testing Patrice Godefroid Nils Klarlund Koushik Sen Bell Labs Bell Labs UIUC Presented by Wei Fang January 22, 2015 PLDI 2005 Page 1 June 2005 Motivation Software testing:

More information

Tao Xie. Nikolai i Tillmann, Peli de Halleux, Wolfram Schulte hlt. North Carolina State University. Microsoft Research

Tao Xie. Nikolai i Tillmann, Peli de Halleux, Wolfram Schulte hlt. North Carolina State University. Microsoft Research Tao Xie North Carolina State University Nikolai i Tillmann, Peli de Halleux, Wolfram Schulte hlt Microsoft Research Unit Testing Parameterized Unit Testing (PUT) Mutation Analysis for PUT public class

More information

CS 520 Theory and Practice of Software Engineering Fall 2018

CS 520 Theory and Practice of Software Engineering Fall 2018 CS 520 Theory and Practice of Software Engineering Fall 2018 Nediyana Daskalova Monday, 4PM CS 151 Debugging October 30, 2018 Personalized Behavior-Powered Systems for Guiding Self-Experiments Help me

More information

Testing and Debugging

Testing and Debugging Testing and Debugging Comp-303 : Programming Techniques Lecture 14 Alexandre Denault Computer Science McGill University Winter 2004 March 1, 2004 Lecture 14 Comp 303 : Testing and Debugging Page 1 Announcements...

More information

Unit Testing in Java with an Emphasis on Concurrency Corky Cartwright Rice and Halmstad Universities Summer 2013

Unit Testing in Java with an Emphasis on Concurrency Corky Cartwright Rice and Halmstad Universities Summer 2013 Unit Testing in Java with an Emphasis on Concurrency Corky Cartwright Rice and Halmstad Universities Summer 2013 Software Engineering Culture Three Guiding Visions Data-driven design Test-driven development

More information

Combined Static and Dynamic Mutability Analysis 1/31

Combined Static and Dynamic Mutability Analysis 1/31 Combined Static and Dynamic Mutability Analysis SHAY ARTZI, ADAM KIEZUN, DAVID GLASSER, MICHAEL D. ERNST ASE 2007 PRESENTED BY: MENG WU 1/31 About Author Program Analysis Group, Computer Science and Artificial

More information

Automated Unit Testing of Large Industrial Embedded Software using Concolic Testing

Automated Unit Testing of Large Industrial Embedded Software using Concolic Testing Automated Unit Testing of Large Industrial Embedded Software using Concolic Testing, Moonzoo Kim SW Testing & Verification Group KAIST, South Korea Youil Kim, Taeksu Kim, Gunwoo Lee, Yoonkyu Jang Samsung

More information

Memory Safety (cont d) Software Security

Memory Safety (cont d) Software Security Memory Safety (cont d) Software Security CS 161: Computer Security Prof. Raluca Ada Popa January 17, 2016 Some slides credit to David Wagner and Nick Weaver Announcements Discussion sections and office

More information

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM Objectives Defining a wellformed method to check class invariants Using assert statements to check preconditions,

More information

Javadoc. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 7

Javadoc. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 7 Javadoc Computer Science and Engineering College of Engineering The Ohio State University Lecture 7 Motivation Over the lifetime of a project, it is easy for documentation and implementation to diverge

More information

In this lab we will practice creating, throwing and handling exceptions.

In this lab we will practice creating, throwing and handling exceptions. Lab 5 Exceptions Exceptions indicate that a program has encountered an unforeseen problem. While some problems place programmers at fault (for example, using an index that is outside the boundaries of

More information

Reproducing Crashes. Shifting Role of Testing. Shifting Role of Testing. Waterfall Model, V-Model

Reproducing Crashes. Shifting Role of Testing. Shifting Role of Testing. Waterfall Model, V-Model Reproducing Crashes Andreas Leitner Universität des Saarlandes 11.12.2008 1 Shifting Role of ing ing often ne towards release-time Modern development processes move testing to the center of development

More information

CSE 331 Final Exam 3/16/15 Sample Solution

CSE 331 Final Exam 3/16/15 Sample Solution Question 1. (12 points, 3 each) A short design exercise. Suppose Java did not include a Set class in the standard library and we need to store a set of Strings for an application. We know that the maximum

More information

JML tool-supported specification for Java Erik Poll Radboud University Nijmegen

JML tool-supported specification for Java Erik Poll Radboud University Nijmegen JML tool-supported specification for Java Erik Poll Radboud University Nijmegen Erik Poll - JML p.1/41 Overview The specification language JML Tools for JML, in particular runtime assertion checking using

More information

CS18000: Programming I

CS18000: Programming I CS18000: Programming I Testing Basics 19 April 2010 Prof. Chris Clifton Testing Programs Your programs are getting large and more complex How do you make sure they work? 1. Reason about the program Think

More information

Formal Methods for Java

Formal Methods for Java Formal Methods for Java Lecture 1: Introduction Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg October 26, 2011 Jochen Hoenicke (Software Engineering) Formal Methods for Java October

More information

Symbolic Execution, Dynamic Analysis

Symbolic Execution, Dynamic Analysis Symbolic Execution, Dynamic Analysis http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Symbolic execution Pavel Parízek Symbolic Execution, Dynamic Analysis

More information

Inf1-OOP. OOP Exam Review. Perdita Stevens, adapting earlier version by Ewan Klein. March 16, School of Informatics

Inf1-OOP. OOP Exam Review. Perdita Stevens, adapting earlier version by Ewan Klein. March 16, School of Informatics Inf1-OOP OOP Exam Review Perdita Stevens, adapting earlier version by Ewan Klein School of Informatics March 16, 2015 Overview Overview of examinable material: Lectures Topics S&W sections Week 1 Compilation,

More information

Intermediate Programming & Design (C++) Classes in C++

Intermediate Programming & Design (C++) Classes in C++ Classes in C++ A class is a data type similar to a C structure. It includes various local data (called data members) together with constructors, destructors and member functions. All of them are called

More information

Announcements. Lab tomorrow. Quiz Thursday P3 due Friday. Exceptions and unit testing

Announcements. Lab tomorrow. Quiz Thursday P3 due Friday. Exceptions and unit testing Announcements Lab tomorrow Exceptions and unit testing Quiz Thursday P3 due Friday Follow-ups Exceptions and Try-catch Using try-catch with loops Comparison to switch vs. if-else if Realistic examples

More information

Advanced Testing. Testing Tools. Software Reliability and Testing

Advanced Testing. Testing Tools. Software Reliability and Testing Advanced Testing Testing Tools Software Reliability and Testing 2006 1 Testing activities and tools Some open source testing tools Some commercial/closed source testing tools Summary Plan Software Reliability

More information

Testing Object-Oriented Software. 22 November 2017

Testing Object-Oriented Software. 22 November 2017 Testing Object-Oriented Software 22 November 2017 Testing Object-Oriented Software 2 Problems in object-oriented testing [Binder] Each level in the class hierarchy creates a new context for inherited features:

More information

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming Goals of Lecture Lecture 27: OO Design Patterns Cover OO Design Patterns Background Examples Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2001 April 24, 2001 Kenneth

More information

Homework #1, on the class web pages later today

Homework #1, on the class web pages later today Assertions Reading assignment A. J. Offutt, A Practical System for Mutation Testing: Help for the Common Programmer, Proceedings of the 12th International Conference on Testing Computer Software, Washington,

More information

10 Java Collections; Equality, JUnit

10 Java Collections; Equality, JUnit 10 Java Collections; Equality, JUnit Activities 1. Familiarize yourself with some of the Java Collections Framework. 2. Learn the basics of overriding the hashcode and equals methods. 3. Learn the basics

More information