Precisely Selecting Regression Test for Aspect-Oriented Programs Guoqing Xu The Ohio State University

Slides:



Advertisements
Similar presentations
Analyzing Regression Test Selection Techniques
Advertisements

1 Improving Cluster Selection Techniques of Regression Testing by Slice Filtering Yongwei Duan, Zhenyu Chen, Zhihong Zhao, Ju Qian and Zhongjun Yang Software.
Testing Coverage Test case
Towards a Standard Interface for Runtime Inspection in AOP Environments OOPSLA Workshop on Tool for AOSD, Seattle, November 2002 Katharina Mehner and Awais.
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
Computer Science Automated Test Data Generation for Aspect-Oriented Programs Mark Harman (King’s College London, UK) Fayezin Islam (T-Zero Processing Services,
A Regression Test Selection Technique for Aspect- Oriented Programs Guoqing Xu The Ohio State University
1 Integrating Influence Mechanisms into Impact Analysis for Increased Precision Ben Breech Lori Pollock Mike Tegtmeyer University of Delaware Army Research.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION REGRESSION TESTING Autumn 2011.
ASPECT ORIENTED SOFTWARE DEVELOPMENT Prepared By: Ebru Doğan.
A High Performance Application Representation for Reconfigurable Systems Wenrui GongGang WangRyan Kastner Department of Electrical and Computer Engineering.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Regression Test Selection for AspectJ Software Guoqing Xu and Atanas.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University A Framework for Source-Code- Level Interprocedural Dataflow Analysis.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
XFindBugs: eXtended FindBugs for AspectJ Haihao Shen, Sai Zhang, Jianjun Zhao, Jianhong Fang, Shiyuan Yao Software Theory and Practice Group (STAP) Shanghai.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Debugging Support.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University ICSE 2003 Java.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University STATIC ANALYSES FOR JAVA IN THE PRESENCE OF DISTRIBUTED COMPONENTS AND.
Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
Path Testing + Coverage Chapter 9 Assigned reading from Binder.
Abc Compiler Zak Fry. Who and Where Programming Tools Group at Oxford University, UK – Oege de Moor Sable Research Group at McGill University, Quebec.
Change Impact Analysis for AspectJ Programs Sai Zhang, Zhongxian Gu, Yu Lin and Jianjun Zhao Shanghai Jiao Tong University.
Flow-Augmented Call Graph: A New Foundation for Taming API Complexity Qirun Zhang
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Introduction to Software Testing Chapter 8.1 Building Testing Tools –Instrumentation Paul Ammann & Jeff Offutt
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface.
Aspect Oriented Programming Gülşah KARADUMAN.
Chapter 13: Regression Testing Omar Meqdadi SE 3860 Lecture 13 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Rethinking Soot for Summary-Based Whole- Program Analysis PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Dacong Yan.
A Distributed Aspect-Oriented System for J2EE Applications Muga Nishizawa and Shigeru Chiba (Tokyo Institute of Technology, Japan) Background - As benefits.
1 Program Slicing Amir Saeidi PhD Student UTRECHT UNIVERSITY.
IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University.
Region Pointcut for AspectJ Shumpei Akai Shigeru Chiba Muga Nishizawa.
Slicing AspectJ Woven Code Luca Cavallaro Mattia Monga Antonio Castaldo D'Ursi Davide Balzarotti Politecnico di Milano.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
An Undergraduate Course on Software Bug Detection Tools and Techniques Eric Larson Seattle University March 3, 2006.
Chapter 8: Aspect Oriented Programming Omar Meqdadi SE 3860 Lecture 8 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Aspect Mining Jin Huang Huazhong University of Science & Technology, China
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Reducing Combinatorics in Testing Product Lines Chang Hwan Peter Kim, Don Batory, and Sarfraz Khurshid University of Texas at Austin.
AOSD'04, Lancaster, UK 1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech) Shigeru Chiba (Tokyo Tech) Michiaki Tatsubori.
AOP with AspectJ Awais Rashid, Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Regression Testing with its types
Software Testing.
Compositional Pointer and Escape Analysis for Java Programs
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
A Test Case + Mock Class Generator for Coding Against Interfaces
Aditya P. Mathur Purdue University
Structural testing, Path Testing
White-Box Testing.
Regression Testing.
Dataflow Testing G. Rothermel.
Program Slicing Baishakhi Ray University of Virginia
White-Box Testing.
Test Case Purification for Improving Fault Localization
Inlining and Devirtualization Hal Perkins Autumn 2011
Inlining and Devirtualization Hal Perkins Autumn 2009
Estimating Timing Profiles for Simulation of Embedded Systems
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
OMEN: A Strategy for Testing Object-Oriented Software
Regression Testing.
Paul Ammann & Jeff Offutt
By Hyunsook Do, Sebastian Elbaum, Gregg Rothermel
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Mitigating the Effects of Flaky Tests on Mutation Testing
Presentation transcript:

Precisely Selecting Regression Test for Aspect-Oriented Programs Guoqing Xu The Ohio State University

Outline Big picture and background Problem statement and motivation Our analysis Implementation status Related work

Big Picture AOSD improves separation of concerns Challenges for analysis of AO programs  Control flow in bytecode is not equivalent to the program logic in source code  Compiler-specific weaving  Dynamic/static parts of pointcut designators  No analysis framework implementation available Challenges for testing of AO programs  Coverage criteria; test generation for exercising of aspects; regression test selection

Big Picture Long-term goals  Framework that supports static analyses similar to popular analyses for OO program  Develop AO-specific techniques for analysis and testing Topic of this talk  Regression test selection for AO programs  Work in progress

Regression Test Selection Testing after software modifications Re-running the entire regression test suite is expensive Select a subset of tests to run Safe test selection chooses every test case that may reveal a fault

Related Previous Work Rothermel and Harrold, TOSEM 97  Graph traversal algorithms Harrold et al., OOPSLA 01  Java interclass graph (JIG) Copied from [Harrold et al., OOPSLA 01] Execute P/ Record Coverage Identify Dangerous Entities Select Tests Program P Program P’ Program P Program P’ P’s Edge Coverage Matrix Dangerous Entities containing edges in P

Regression Testing for AOSD When AO features are added/modified, the program needs to be regression tested Case 1: P is an OO program and P’ is an AO version of P Case 2: Both P and P’ are AO programs How should regression test selection be performed for AO software? How should regression test selection be performed for AO software?

Outline Big picture and background Problem statement and motivation Our analysis Implementation status Related work

Existing Work Applied to AO Programs How to compare two JIGs?  The JIG of the woven code includes redundant nodes and edges and does not correspond to the logical control flow as presented in the source  Need new representations How to recover CFG edges from the execution trace when computing edge- coverage matrix? (when P is AO program)  The execution trace is compiler-specific  Need instrumentation before/during weaving

Existing Work Applied to AO Programs 1.class C { 2. public void m(int i) {…} 3. } 4. 5.void bar(C p, int k) { 6. p.m(k); 7. } Java version P CFG edge Call edge Java Interclass Graph (JIG) bar() p.m() return C.m() … exit

Example 1.class C { 2. public void m(int i){…}; 3. } 4. 5.void bar(C p, int k) { 6. p.m(k); 7. } aspect Sample{ 10. void around(C c, int i): 11. call(C.m(int)) && 12. target(c) && 13. args(i) { 14. proceed(p, x); 15. } bar() p.m() Retur n C.m() … exit JIG for P AspectJ Version P’ C. m () … exit bar().. around$0 return … c.m() return JIG for P’ (from woven code)..Sample. around$0

Some Results When we applied the [Harrold et.al. 01] algorithm to several subjects: SubjectsV1 (java version) Num of tests V2 (AspectJ version) Num of selected tests bean 10 introduction 40 observer 10 telecom 30 tjp 10 tracing 40 testReadFile 20 19

Possible Approach Create “clean” CFGs in which the wrapper code inserted during weaving is removed  Graph traversal and comparison corresponds to the “logical” structure of the code, not the compiler-specific woven code New representation: AJIG  AspectJ Inter-module Graph – more later For regression test selection, need to consider additional issues

A More Complex Problem 1.class C { 2. public void m(int i){…}; 3. } 4. 5.void bar(C p, int k) { 6. C.m(k); 7. } aspect Sample{ 10. void around(C c, int i): 11. call(C.m(int)) && 12. target(c) && 13. args(i) { 14. System.out.println(i); 15. proceed(p, x); 15. } C. m () bar() return m() AJIG for P’ … exit System. out…. Do we need to select all the tests that go through the edge marked in red?

Why it needs to be addressed This is an issue not only for AO software, but also for procedural and OO software Advices are often free of side effects  Study in [Rinard et al. FSE 04] reported 6 “observer” advices out of ten inspected advices  Recommended for “safe” AO programming Adding side-effect-free advices should not result in overly conservative regression test selection Approach: use side-effect analysis

Outline Big picture and background Problem statement and motivation Our analysis Implementation status Related work

Our Work Consider both situations:  Case 1: P is an OO version, P’ is an AO version  Case 2: both P and P’ are AO versions Analysis to select regression tests  Build a new control flow representation: AJIG  Apply existing graph-traversal algorithm on AJIG  Side-effect analysis when comparing AJIGs

AJIG AspectJ Inter-module Graph (recent work)  For the Java parts, same as JIG.  Shadow node  A shadow node is associated with  a set of JIGs of advices  the precedence of these advices  an integrated shadow advice JIG  AJIG supports all static AspectJ join point types  Conservatively approximate the dynamic part of pointcut designators.

Side Effect Side effect node  Mutate the objects that have existed before the method/advice is invoked For an advice,  All the nodes in the CFG path that does not contain a proceed node  The proceed node has side effect if its actual parameters and parameters of the advice don’t point to same objects.  Mutates the object returned by the proceed node  The return node has side effect if the return value of the advice and that of the proceed node don’t point to the same object

Side Effect (Cont’d) Side effect related node in AJIG  Has side effects  Has some dependency on the nodes that have side effects Safe edge in AJIG  An edge is safe edge, if the sink node of this edge is not side effect related.

New Test Selection criterion New Test Selection criterion:  Dangerous set S computation: for each edge e in P, and its counter part e’ in P’ e is not equivalent to e’ and Neither e nor e’ is a safe edge. Select a test that execute one or more edges in S

Selection Computing dangerous set S by comparing AJIGs. We plan to use some form of side-effect analysis  Large body of existing work Selecting tests

Implementation progress The implementation of algorithms described in [Harrold et.al. 01] √ Building AspectJ Inter-module Graph √  Make an extension for the abc compiler that generates the Jimple based CFGs for aspects between the weaving of inter-type declarations and advices.  Instrument advices at different phases. Side effect analysis ongoing work Evaluation

Evaluation Plan Benchmarks: ten to twenty moderate size ( classes) AO projects taken from tmbenches, used by the abc compiler. Experiments  collect data. The number of tests selected over versions. The comparison between enabling side-effect analysis and disabling it.

Related Work Static/Dynamic Analysis for AO programs.  abc compiler [AOSD 05] [PLDI 05] [TR 04].  Static analysis of aspects [Sereni and Moor, AOSD 02].  Zhao’s work on the analysis and testing of AO programs [COMPSAC 03] [WPC 02][AOSD 06].  Classification system for AO programs [Rinard et. al. FSE 04].

Related Work (Cont’d) Regression Test Selection  [LW ICSM 91], [CRV ISCE 94], [RH TOSEM 97], [Ball ISSTA 98], [Harrold+ OOPSLA 01], [OSH FSE 04]… Change Impact Analysis  [KGH+ ICSM 94], [RT PASTE 01], [OAH FSE 03], [OAL+ ICSE 04], [RST+ OOPSLA 04], …

Thank you!! Questions??