Regression Test Selection for C++ Software

Similar documents
A Safe, Efficient Regression Test Selection Technique

Scaling Regression Testing to Large Software Systems

Lecture 21. Regression Testing Path Spectra. EE 382V Spring 2009 Software Evolution - Instructor Miryung Kim

Integrating White- and Black-Box Techniques for Class-Level Regression Testing

Ingegneria del Software II academic year: Course Web-site: [

A METRIC BASED EVALUATION OF TEST CASE PRIORITATION TECHNIQUES- HILL CLIMBING, REACTIVE GRASP AND TABUSEARCH

Efficient Regression Test Model for Object Oriented Software

Review of Regression Test Case Selection Techniques

Identification of Differences Between Aspect-Oriented Programs. Marija Katic, PhD Student

Dr. N. Sureshkumar Principal Velammal College of Engineering and Technology Madurai, Tamilnadu, India

Information System Design (IT60105)

Improving Test Suites via Operational Abstraction

Coverage Criteria for GUI Testing. Research focus

A Taxonomy of OO Classes to Support the Mapping of Testing Techniques to a Class

Using the code to measure test adequacy (and derive test cases) Structural Testing

Coverage Criteria for GUI Testing. Research focus. GUI Test Case. Sequence of Events. Not just individual events

TEST CASE PRIORITIZATION ALGORITHM BASED UPON MODIFIED CODE COVERAGE IN REGRESSION TESTING

CompuScholar, Inc. 9th - 12th grades

Testing Component-Based Software

Dataflow testing of Java programs with DFC

Class Analysis for Testing of Polymorphism in Java Software

OOPLs - call graph construction. Example executed calls

Introduction to Dynamic Analysis

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

WYSE Academic Challenge Regional Computer Science 2008 Solution Set

Efficiently Monitoring Data-Flow Test Coverage

Regression Test Case Prioritization Based on Historical Test Case Performance Data

Data Structures and Programming with C++


Study and Analysis of Regression Test Case Selection Techniques

Chapter 2: Java OO II X I A N G Z H A N G

Performance Profiling

Directed Test Suite Augmentation

Java Software Solutions for AP Computer Science 3rd Edition, Lewis et al. 2011

A safe regression test selection technique for database driven applications

Program Analysis. Program Analysis

Qualifying Exam in Programming Languages and Compilers

[ L5P1] Object-Oriented Programming: Advanced Concepts

JVA-103. Java Programming

A Differencing Algorithm for Object-Oriented Programs

Programming II. Modularity 2017/18

A Graphical Class Representation for Integrated Black- and White-Box Testing

Lecture 23: Object Lifetime and Garbage Collection

C++ Important Questions with Answers

Lecture 2: Control Flow Analysis

Graphical User Interfaces. Regression Testing of GUIs. GUI Regression Testing Problem. New Event-flow Model. GUI Regression Testing Problem

An Empirical Model for Predicting Cross-Core Performance Interference on Multicore Processors

Assessing the Cost-Benefits of Using Type Inference Algorithms to Improve the Representation of Exceptional Control Flow in Java

IMACS: AP Computer Science A

Samples of Evidence to Satisfy the AP Computer Science AB Curricular Requirements

Testing Role in Unified Approach Coverage: Structural/Coverage Model Based Test Generation from Model Checking (project) Interaction of

What is Object-Oriented Programming

CHAPTER 5 GENERATING TEST SCENARIOS AND TEST CASES FROM AN EVENT-FLOW MODEL

An Empirical Study of Regression Test Selection Techniques

Lecture 20: SW Testing Presented by: Mohammad El-Ramly, PhD

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

JAVA CONCEPTS Early Objects

In this paper, we present the results of a comparative empirical study of two safe RTS techniques. The two techniques we studied have been implemented

Chapter 11 Object and Object- Relational Databases

A Differencing Algorithm for Object-Oriented Programs

Automatically Repairing Broken Workflows for Evolving GUI Applications

Software System Design and Implementation

CGS 2405 Advanced Programming with C++ Course Justification

Testing Methods: White Box Testing II

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

How Developers Use the Dynamic Features of Programming Languages: The Case of Smalltalk

White Box Testing with Object Oriented programming

In this Lecture you will Learn: Testing in Software Development Process. What is Software Testing. Static Testing vs.

Testing3. State-based Testing

Research Article Regression Test Selection for C# Programs

TeenCoder : Java Programming (ISBN )

XVIII. Software Testing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

STUDENT LESSON A5 Designing and Using Classes

CPS 506 Comparative Programming Languages. Programming Language

Information Extraction from Real-time Applications at Run Time

Orifice Flow Meter

COMSC-051 Java Programming Part 1. Part-Time Instructor: Joenil Mistal

QUIZ. Write the following for the class Bar: Default constructor Constructor Copy-constructor Overloaded assignment oper. Is a destructor needed?

Interprocedural Analysis. Motivation. Interprocedural Analysis. Function Calls and Pointers

Object-Oriented Programming

An Empirical Evaluation of Test Adequacy Criteria for Event-Driven Programs

Using Component Metadata to Support the Regression Testing of Component-Based Software

Testing: Test design and testing process

B16 Object Oriented Programming

Practice for Chapter 11

INFORMATION TECHNOLOGY COURSE OBJECTIVE AND OUTCOME

Object-Oriented Concepts and Design Principles

Understanding Data Dependences in the Presence of Pointers

Refactoring Practice: How it is and How it Should be Supported

Lecture 5: Inheritance

Programming Assignment IV Due Monday, November 8 (with an automatic extension until Friday, November 12, noon)

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Garbage Collection. Lecture Compilers SS Dr.-Ing. Ina Schaefer. Software Technology Group TU Kaiserslautern. Ina Schaefer Garbage Collection 1

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming

Testing Inter-Layer and Inter-Task Interactions in Real-Time Embedded Systems

Test Automation. 20 December 2017

Course Syllabus. Programming Language Paradigms. Spring - DIS Copenhagen. Semester & Location: Elective Course - 3 credits.

CompuScholar, Inc. Alignment to Nevada "Computer Science" Course Standards

Method-Level Phase Behavior in Java Workloads

Cpt S 122 Data Structures. Course Review FINAL. Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University

Transcription:

Technical Report 99-60-01, Computer Science Department, Oregon State University, January 1999 Regression Test Selection for C++ Authors: Gregg Rothermel Mary Jean Harrold Jeinay Dedhia Software Sanjay Kulhari PhD Student, Computer Science Department UC Riverside

Regression test selection Given: P : A method, class or a program. T: Test suite to test P. P : Modified version of P Problem definition: Given P, T and P, choose an appropriate subset of T that executes the new or modified code and tests the formerly executed code that has now been deleted.

Motivation Modified code should behave as expected and should not break the behavior of unmodified code. Time spent on test selection should be minimal and combined time of selection and execution should not exceed time for testing all the existing tests for previous version. Regression testing can be expensive in object oriented paradigm due to code reuse, so efficient test selection can be very beneficial.

Outline Background Regression testing/ Regression testing in object oriented software. CFG/ICFG/Code Instrumentation Regression test selection technique for modified application programs modified and derived classes OOP features handled by the test selection technique. Experimental results Related work Conclusion and Future work

Regression testing Regression test selection Select a subset of existing test cases. Coverage identification Create additional tests to cover new functionality. Test suite execution Execute tests to establish correctness Test suite maintenance Create the new test suite and test history.

Regression testing in OO software Testing modified class Test driver invokes sequence of methods and verifies that objects have attained proper states. Testing dependent application programs Test application programs that use the modified class. Testing derived classes Test classes derived from the modified class.

Control Flow Graph

Interprocedural Control Flow Graph

Code instrumentation Branch trace Given a program P with ICFG G, execution of instrumented version of P with test t gives branches taken during execution. Edge trace Using branch trace determine the edges in G, that were traversed when t was executed. Edge trace for a test t on P is linear in size with number of edges in G.

Code instrumentation Test History Gather edge trace information for each test in T such that for each test, a set of traversed edges (n1,n2) is recorded. Method TestOnEdge(n1,n2) returns the test cases that traverse edge (n1,n2)

Test selection technique Approach Traverse ICFGs of original and modified program to look for nodes that are not equivalent (modification traversing) Using test history, select all tests that have reached that point. All tests are considered at once and no separate traversals for each test. Nodes are marked visited and algorithm terminates in time proportional to graph size.

Test selection algorithm (SelectTests)

Test selection algorithm (SelectTests) Input: Program P, modified version P and test suite T for P. Output: T a subset of T that contains tests that are modification traversing for P and P. Processing Constructs ICFGs for P and P Traverse the graphs recursively using compare method to get edges through which tests are modification traversing. Use TestOnEdge method to retrieve tests from the test history.

Test selection algorithm (SelectTests) Compare inserts edge (36,40) Algorithm traverses other portions of graph and does not go further 40 Tests t3 and t4 are selected ElevatorApp ElevatorApp

Test selection algorithm (SelectTests) Performance Cost(SelectTests) = Cost(ICFG construction for P and P ) + Cost(Compare) + Cost(set unions) = O(n + n + nn + n T )

Regression test selection for modified and derived classes Class can have multiple entry points therefore previous technique doesn t work. Naïve approach Create driver programs and use SelectTests algorithm. Disadvantage: Unnecessary construction and traversal of each driver s ICFG. New representation of C++ class Class Control Flow Graph (CCFG)

Class Control Flow Graph (CCFG) Collection of individual control flow graphs for the methods in a class. Frame Abstraction of a driver program, to simulate arbitrary sequence of calls to public methods. Nodes of individual CFGs are connected with frame to give CCFG.

CCFGs and SelectTests SelectTests can be run on CCFGs of modified or derived classes to select regression test. SelectTests is invoked on the two versions of CCFGs for the base class when a method is modified. When a derived class redefines base class s method SelectTests is invoked on CCFGs of base and derived class. If test suite T is available for derived class and the base class is modified, SelectTests is run on CCFGs of the derived classes.

Other issues Interclass and Intraclass testing Test selection for interclass can be done in similar way by including the CFGs of other classes. Polymorphism and dynamic binding Build ICFGs that include polymorphic call nodes and edges to other possible CFGs Objects as parameters Similar to handling polymorphism, build ICFGs that include polymorphic call nodes and edges to other possible CFGs

Other issues Handling changes in non executable statements Mark affected statements that refer to variables whose declaration is changed. Distinguishing driver, setup and Oracle code from code under test. Test the setup methods independently. Specification and code based testing Black box selection technique should be used in conjunction to select test relevant to changed specification.

Experimental results Setup Experimented with 6 versions of commercial C+ + library. 186 classes, 24849 lines of code. 61 C++ driver programs (test cases) Used simulation technique, because C++ analyzer to develop CFG for the code is not available.

Experimental results Test selection results

Follow up study Categorized modifications as due to Constructors Operators Other Collected test selection data for different modifications On two versions constructor and operator changes accounted for 22 35 % so in those cases it is better to test them separately.

Related work Program dependence graph Construction of CFGs is costly as compared to SelectTests. ORD (Object relational Diagram) Describes static relationship among classes. Determines all classes exercised by test cases. Less precise than SelectTests.

Future work To obtain empirical data on effects of polymorphism on graph size and algorithm runtime. To empirically investigate the approach to handle non executable statements. To identify if the changes have made existing test cases inadequate and new test cases are needed.

Questions