PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Regression Test Selection for AspectJ Software Guoqing Xu and Atanas.

Slides:



Advertisements
Similar presentations
Analyzing Regression Test Selection Techniques
Advertisements

Uncovering Performance Problems in Java Applications with Reference Propagation Profiling PRESTO: Program Analyses and Software Tools Research Group, Ohio.
CPSC 388 – Compiler Design and Construction
ASSUMPTION HIERARCHY FOR A CHA CALL GRAPH CONSTRUCTION ALGORITHM JASON SAWIN & ATANAS ROUNTEV.
Effective Static Deadlock Detection
Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers Presentation by Patrick Kaleem Justin.
SSA.
ASTA Aspect Software Testing Assistant Juha Gustafsson, Juha Taina, Jukka Viljamaa University of Helsinki.
A Regression Test Selection Technique for Aspect- Oriented Programs Guoqing Xu The Ohio State University
1 Program Slicing Purvi Patel. 2 Contents Introduction What is program slicing? Principle of dependences Variants of program slicing Slicing classifications.
Reverse Engineering © SERG Code Cloning: Detection, Classification, and Refactoring.
1 Integrating Influence Mechanisms into Impact Analysis for Increased Precision Ben Breech Lori Pollock Mike Tegtmeyer University of Delaware Army Research.
Today’s Agenda  HW #1 Due  Quick Review  Finish Input Space Partitioning  Combinatorial Testing Software Testing and Maintenance 1.
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
The Use of Traces for Inlining in Java Programs Borys J. Bradel Tarek S. Abdelrahman Edward S. Rogers Sr.Department of Electrical and Computer Engineering.
Recap from last time We were trying to do Common Subexpression Elimination Compute expressions that are available at each program point.
Aspect-Oriented Software Development (AOSD) Tutorial #2 AspectJ Basics.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
Aspect-Oriented Software Development (AOSD) Tutorial #2 AspectJ Basics.
Synthesis of Interface Specifications for Java Classes Rajeev Alur University of Pennsylvania Joint work with P. Cerny, G. Gupta, P. Madhusudan, W. Nam,
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University A Framework for Source-Code- Level Interprocedural Dataflow Analysis.
XFindBugs: eXtended FindBugs for AspectJ Haihao Shen, Sai Zhang, Jianjun Zhao, Jianhong Fang, Shiyuan Yao Software Theory and Practice Group (STAP) Shanghai.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Static Control-Flow Analysis for Reverse Engineering of UML Sequence Diagrams Atanas (Nasko) Rountev Ohio State University with Olga Volgin and Miriam.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University STATIC ANALYSES FOR JAVA IN THE PRESENCE OF DISTRIBUTED COMPONENTS AND.
PRESTO Research Group, Ohio State University Interprocedural Dataflow Analysis in the Presence of Large Libraries Atanas (Nasko) Rountev Scott Kagan Ohio.
Understanding Parallelism-Inhibiting Dependences in Sequential Java Programs Atanas (Nasko) Rountev Kevin Van Valkenburgh Dacong Yan P. Sadayappan Ohio.
Change Impact Analysis for AspectJ Programs Sai Zhang, Zhongxian Gu, Yu Lin and Jianjun Zhao Shanghai Jiao Tong University.
1 Semantic Analysis Aaron Bloomfield CS 415 Fall 2005.
Bug Localization with Machine Learning Techniques Wujie Zheng
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Predicated Static Single Assignment (PSSA) Presented by AbdulAziz Al-Shammari
JCMP: Linking Architecture with Component Building Guoqing Xu, Zongyuan Yang and Haitao Huang Software Engineering Lab, East China Normal University SACT-01,
Coverage Criteria for Testing of Object Interactions in Sequence Diagrams Atanas (Nasko) Rountev Scott Kagan Jason Sawin Ohio State University.
Rethinking Soot for Summary-Based Whole- Program Analysis PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Dacong Yan.
AOSD1 Aspect-Oriented Software Design Karl Lieberherr Theo Skotiniotis.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
Virtual Support for Dynamic Join Points C. Bockisch, M. Haupt, M. Mezini, K. Ostermann Presented by Itai Sharon
Compiler Principles Fall Compiler Principles Lecture 0: Local Optimizations Roman Manevich Ben-Gurion 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.
Inter-Type Declarations in AspectJ Awais Rashid Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
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.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Efficient Checkpointing of Java Software using Context-Sensitive Capture.
An Undergraduate Course on Software Bug Detection Tools and Techniques Eric Larson Seattle University March 3, 2006.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Reducing Combinatorics in Testing Product Lines Chang Hwan Peter Kim, Don Batory, and Sarfraz Khurshid University of Texas at Austin.
1 Control Flow Analysis Topic today Representation and Analysis Paper (Sections 1, 2) For next class: Read Representation and Analysis Paper (Section 3)
CS412/413 Introduction to Compilers Radu Rugina Lecture 18: Control Flow Graphs 29 Feb 02.
1 Control Flow Graphs. 2 Optimizations Code transformations to improve program –Mainly: improve execution time –Also: reduce program size Can be done.
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
Pointer and Escape Analysis for Multithreaded Programs Alexandru Salcianu Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology.
5/7/03ICSE Fragment Class Analysis for Testing of Polymorphism in Java Software Atanas (Nasko) Rountev Ohio State University Ana Milanova Barbara.
SCoPE: an AspectJ Compiler for Supporting User-Defined Analysis-Based Pointcuts Tomoyuki Aotani Hidehiko Masuhara
Object Naming Analysis for Reverse- Engineered Sequence Diagrams Atanas (Nasko) Rountev Beth Harkness Connell Ohio State University.
Symstra: A Framework for Generating Object-Oriented Unit Tests using Symbolic Execution Tao Xie, Darko Marinov, Wolfram Schulte, and David Notkin University.
ECE 750 Topic 8 Meta-programming languages, systems, and applications Automatic Program Specialization for J ava – U. P. Schultz, J. L. Lawall, C. Consel.
CS223: Software Engineering Lecture 26: Software Testing.
Precisely Selecting Regression Test for Aspect-Oriented Programs Guoqing Xu The Ohio State University
Chapter 8: Recursion Data Structures in Java: From Abstract Data Types to the Java Collections Framework by Simon Gray.
Static Analysis of Object References in RMI-based Java Software
Atanas (Nasko) Rountev Ohio State University
White-Box Testing.
Program Slicing Baishakhi Ray University of Virginia
White-Box Testing.
Inlining and Devirtualization Hal Perkins Autumn 2011
Demand-Driven Context-Sensitive Alias Analysis for Java
Control Flow Analysis (Chapter 7)
Presentation transcript:

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Regression Test Selection for AspectJ Software Guoqing Xu and Atanas Rountev Ohio State University ICSE’07

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 2 Outline  Background and motivation - Regression test selection - AspectJ semantics and challenges  Contributions - A control-flow representation for AspectJ software - A graph traversal algorithm for test selection - Experimental evaluation  Conclusions

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 3 Regression Test Selection  Select a safe subset of regression tests  Harrold et al., OOPSLA 01 - Java interclass graph (JIG): intra- and inter-procedural flow of control - Simultaneous JIG traversal for P and P' Program P Execute P and record coverage Program P Identify dangerous entities Program P' Select tests JIG edge coverage matrix Dangerous edges in P

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 4 Motivation and Challenges  Aspects can change dramatically the behavior of the original code  Why not select tests based on the woven bytecode? - The discrepancy between the source code and the bytecode can be significant - Compiler-specific artificial code - Shown in our experimental study  A more general question - What is an appropriate static representation for AspectJ software for regression test selection and other analyses?

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 5 AspectJ Semantics  Join points, pointcuts, and advices - before, around (with proceed), after  Shadow - Textual part of the program executed during the time span of a join point  Dynamic pointcut/advice: triggered only when certain run-time conditions hold - if …  Advice precedence rules

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 6 Running Example class Point { int x; void setX(int x) { this.x = x; } static void main(String[] a) { Point p = new Point(); p.setX(10); } } aspect BoundPoint { pointcut setterX(Point p) : call(void Point.setX(*)) && target(p); … // advices } /* before1 */ before(Point p, int x) : setterX(p) && args(x) throws … { … if (…) throw ex … } /* around1 */ void around(Point p, int x) : setterX(p) && args(x) && if(x==0) { … proceed(p,x); … } /* before2 */ before(Point p) : setterX(p) { … } /* after1 */ after(Point p) : setterX(p) { … }

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 7 AspectJ Semantic try { before1(); if (x==0) around1(); else { before2(); p.setX(); } } catch(Throwable e) { after1(); throw e; } after1(); around1() { before2(); p.setX(); } main(…) { … p.setX(10); … }

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 8 Control-Flow Representation  AspectJ Inter-module Graph (AJIG) - JIG-like representation for “ normal ” calls  No join points - New representation for interactions at join points  Interaction graph  Multiple advices applicable at a join point - Model complex interactions among multiple advices  Dynamic advices - E.g. model the invocation of around1 in the example  void around(Point p, int x) : … if(x==0)

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 9 Multiple Advice Invocation  Input: a list of advices that statically match a shadow  Sort the list using precedence rules, taking into account the shadow - before1, around1, before2, p.setX, after1  Build advice nesting tree - Create a root node, and put every advice under root - Scan the list, build around subtrees; advices that are invoked within an around advice A are the children of A - Parent-child relationships represent nesting of advice time span

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 10 Advice Nesting Tree before1 root before1 around1 before2 p.setX after1 around1 before2 p.setX after1

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 11 Modeling of “ proceed ”  Important observation - Advices at one level are invoked by the call to proceed in their parent advice  Introduction of placeholder methods ph_* - A call to a ph_proceed represents a call to proceed - ph_root is called to replace the shadow - The CFG for a ph_proceed method contains a sequence of call/return nodes pairs for all advices that are invoked by proceed

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 12 root around1 before2 p.setX before1 after1

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 13 Handling of After Advices  Normal subgraph - {after1}  Exceptional subgraph - {after1} Normal subgraph Exceptional subgraph

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 14 Handling of Dynamic Advices  Challenges - No way to know whether a dynamic advice is invoked at run time - Advices that are nested within a dynamic around advice A are still invoked even if A is not invoked  Solutions - Introduce placeholder decision making nodes ph_decision - Create a ph_decision node before the call node of each dynamic advice

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 15 Example  Create a ph_decison node  Create a “T” edge going from ph_decison to the guarded advice  Create an “F” edge - For a non-around advice, link the edge to the next call node - For an around advice, link the edge to the call node of its ph_proceed - Redirect edges before1 return around1 return ph_decision T T F ph_proceed1 F F exit return

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 16 Graph Traversal Algorithm  Edge-level comparison for edges outside the interaction graph  Interaction graph comparison - Interprocedural traversal  Compare the calling structure  Schedule advice bodies for further processing - Intraprocedural comparison  Edge-level comparison for advice bodies

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 17 Inter-procedural traversal Case 1: if ad1 != ad2 e is dangerous

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 18 Inter-procedural traversal Case 2: e is dangerous

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 19 Inter-procedural traversal Case 3: if ad1 == ad2 e is dangerous else ‘T’ is dangerous 3a: if ad1 is non-around compare(e’’, e’) 3b: else compare(ph, e’)

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 20 Empirical Evaluation Subject#Shadows#versions#Tests bean11742 tracing Telecom quicksort nullcheck dcm lod

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 21 35% more 23.8% more

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 22 Study 1 (Cond.)  Compiler changes names of existing advices when adding a new advice  Compiler inlines an advice when removing some control flow paths from it  Compiler generates try-catch block, when adding an afterThrowing advice  Compiler inserts dynamic residue that performs run-time check before dynamic advice  Conclusion - These are not program changes - Such changes prevent JIG-based approach from selecting the changes only made in the source.

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 23 Study 2-Test Suite Reduction bean tracing telecom quicksort

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 24 Study 2-Test Suite Reduction nullcheckdcm loc JIG- 98.8% AJIG- 69.0%

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 25 Conclusions  Bytecode level analysis does not work for AspectJ program  A source code level control-flow representation AJIG - Multiple advice invocation - Dynamic advice  A graph traversal algorithm  Evaluation - Our approach outperforms the JIG-based approach

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 26  Questions?

PRESTO: Program Analyses and Software Tools Research Group, Ohio State University 27 Empirical Evaluation Subject#Shadows#versions#Tests%mc%ic bean tracing Telecom quicksort nullcheck dcm lod %ic = #dynamic interactions/#static interactions