IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University.

Slides:



Advertisements
Similar presentations
AspectWerkz 2 - and the road to AspectJ 5 Jonas Bonér Senior Software Engineer BEA Systems.
Advertisements

Mohamed ElBendary and John Boyland University of Wisconsin-Milwaukee.
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.
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
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Modularization.
Secure Systems Research Group - FAU Aspect Oriented Programming Carlos Oviedo Secure Systems Research Group.
University of British Columbia Software Practices Lab Fluid AOP Join Point Models Terry Hon Gregor Kiczales.
Java.sun.com/javaone/sf | 2004 JavaOne SM Conference | Session BUS JavaOne 2004 What is AOP? Gregor Kiczales AspectMentor.com and University of.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
1 Program Analysis Mooly Sagiv Tel Aviv University Textbook: Principles of Program Analysis.
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.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
1 Model Interface Implementation for Two-Way Obliviousness in Aspect-Oriented Modeling Presented by Wuliang Sun Department of Computer Science Baylor University.
A Formal Model of Modularity in Aspect-Oriented Programming Jonathan Aldrich : Objects and Aspects Carnegie Mellon University.
XFindBugs: eXtended FindBugs for AspectJ Haihao Shen, Sai Zhang, Jianjun Zhao, Jianhong Fang, Shiyuan Yao Software Theory and Practice Group (STAP) Shanghai.
Outline Introduction Problem Statement Object-Oriented Design Aspect-Oriented Design Conclusion Demo.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Debugging Support.
Developing Adaptive J2ME Applications Using AspectJ Ayla Débora and Paulo Borba {add, Centro de Informática - UFPE.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Master’s Thesis Defense: Aspectual Concepts John J. Sung.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
Change Impact Analysis for AspectJ Programs Sai Zhang, Zhongxian Gu, Yu Lin and Jianjun Zhao Shanghai Jiao Tong University.
1 A Static Analysis Approach for Automatically Generating Test Cases for Web Applications Presented by: Beverly Leung Fahim Rahman.
What is “model transformation”? Distinction between source and target Source may be same as target May be multiple sources, or targets Reaching a fixed.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
1 Software Testing. 2 Path Testing 3 Structural Testing Also known as glass box, structural, clear box and white box testing. A software testing technique.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Design and Implementation.
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface.
Aspect Oriented Programming Gülşah KARADUMAN.
A Meta-Level Specification and Profile for AspectJ in UML Joerg Evermann School of Information Management Victoria University of Wellington.
Methodology: The AOP Refactoring Process Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton Advisor:
Design Rules for Increasing Modularity with CaesarJ Carlos Eduardo Pontual Advisor: Paulo Borba 17/06/2010.
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
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.
AspectJ – AOP for Java Tom Janofsky. Instructor at Penn State Abington Consultant with Chariot Solutions JUG Member.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
1 Contract-based Verification for Aspect-oriented Refactoring Naoyasu Ubayashi(Kyushu Institute of Technology) Jinji Piao(Kyushu Institute of Technology)
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
Alloy-based Lightweight Verification for Aspect-oriented Architecture Naoyasu Ubayashi(Kyushu Institute of Technology) Yuki Sato(Kyushu Institute of Technology)
Aspect Mining Jin Huang Huazhong University of Science & Technology, China
CS412/413 Introduction to Compilers Radu Rugina Lecture 18: Control Flow Graphs 29 Feb 02.
aspectj tools new and noteworthy Mik Kersten University of British Columbia Adrian Colyer IBM Hursley OOPSLA, October
AOSD'04, Lancaster, UK 1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech) Shigeru Chiba (Tokyo Tech) Michiaki Tatsubori.
CSC450 Software Engineering Devon M. Simmonds University of North Carolina, Wilmington 1.
IWFST'2005, Shanghai Testing Aspect-Oriented Programs: Challenges and Opportunities Jianjun Zhao Department of Computer Science and Engineering Shanghai.
AspectScope: An Outline Viewer for AspectJ Programs Michihiro Horie, Shigeru Chiba Tokyo Institute of Technology, Japan.
UBC software modularity group 1/14/02 UCSD1 Discussion with Kiczales at UBC Ontology of AOP Ontology is the study of what there is, an inventory of what.
AOP with AspectJ Awais Rashid, Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
Aspect-oriented Code Generation Approaches Abid Mehmood & Dayang N. A. Jawawi Department of Software Engineering Faculty of Computer Science and Information.
Precisely Selecting Regression Test for Aspect-Oriented Programs Guoqing Xu The Ohio State University
Software Engineering Lecture 7
An Interface Mechanism for Encapsulating Weaving in Class-based AOP
Control Flow Testing Handouts
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Discussion with Gregor Kiczales at UBC
Outline of the Chapter Basic Idea Outline of Control Flow Testing
A Test Case + Mock Class Generator for Coding Against Interfaces
Structuring Adaptive Applications using AspectJ and AOM
Presentation transcript:

IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University

Outline  Motivation and Background  Difference Analysis Algorithm  Evaluation of Quality and Feasibility  Conclusions

Motivation and Background

Static Semantic Difference Analysis  static: source code analysis at compile time  semantic: differences in behavior PP’ modified

Why solve the Problem?  Motivation  Reduce testing costs  Produce correct software  Possible applications  Debugging support  Regression test selection  Program slicing

AOP and AspectJ  AOP encapsulates crosscutting concerns  AspectJ  implementation of AOP  extension to Java public class C { int i; void m1() { } … } Base Code aspect A { double C.d; before() : … { } …. } Aspect Code Introduce Advise

AspectJ Example 1 aspect Constraints { 2 public boolean Shape.immovable = false; 2 void around(Shape s) : execution (public Shape+.set*(..)) && target(s) { 3 if (!s.immovable) {proceed( ) ; } } } ITD around advice

Hammocks  Single entry  Single exit  For any directed graph S E

Motivational Example 1 public class Point extends Shape { 2 private int x, y; 3 public void setX(int i){ 4 x = i; } 5 public void setY(int i){ 6 y = i; } 1 public class Point extends Shape { 2 private int x, y; 3 public void setX(int i){ 4 x = i; } 5 void setY(int i){ 6 y = i; } a change in visibility alters program execution

for AspectJ Programs Difference Analysis Algorithm

Algorithm Outline 1. For every module in P find a matching module in P’ (module-level matching) 2. Build extended CFGs for all modules in P and P’ and identify hammocks 3. Perform node-by-node comparison on every pair of hammock graphs (node-level matching)

Matching at Module Level  Signature matching  Disjunctive matching  Obtain best match from multiple candidates public void p1.C1.add(int, Object) P:P: boolean p1.C1.add(int, Object) P’: public void p1.C1.add(int, Object) P:P: boolean p1.C1.add(double, Object) P’:

1. Matching at Module Level  Problem: Not every AspectJ construct has a signature (most importantly: advices)  Solution: a)Define new AspectJ signatures (e.g. [strictfp] before (Formals) : [throws TypeList] : Pointcut {Body} ) b)Define disjunctive patterns for these signatures

2. Build CFGs and Hammocks

3. Matching at Node Level  Simultaneous graph traversal  Node-by-node comparison  Recursive  Two user inputs  Similarity threshold (S)  Maximum lookahead (LH)

3. Matching at Node Level X E Y H P X E Y H P’ S UV e P S UV’ e P’ Similarity Threshold S = 0.5; Lookahead LH = 1

Quality and Feasibility Tests and Evaluation

ProgramLOCDiffsAffectedMatchedErrors ants (100%)0 bean (100%)0 cona-stack (100%)0 dcm (100%)0 figure (100%)0 introduction (98.3%)6 nullcheck (98.2%)78 quicksort (100%)0 spacewar (100%)0 tracing (100%)0  Signature definitions and disjunctive matching  Minimal change with maximal effect  Deficits: some combinations and swapped statements

 S < 0.6: LH has only minor impact  LH  20: within one minute  S  0.6: slow for LH > 20, but not needed

New Findings and Open Tasks Conclusions

What we did  New signatures for AspectJ modules  Disjunctive matching  for AspectJ and Java modules  a solution for modified signatures  Application of hammock algorithm  from OO to AO  Evaluations using a tool implementation

Conclusions  Disjunctive matching is a good idea  modules are correctly matched  more work for node-level matching  eliminates work of type-level matching  replaces user interaction  Type-level matching is not required  Hammock graph matching can be applied given: a) correctly matched modules b) appropriately modeled and labeled CFGs

Future Work  Improve disjunctive matching patterns  Extend CFG representations  Solve the swapping problem  Handle dynamic pointcuts

Questions? Thank You for listening