AspectWrapper CHALFOUN Pierre et BUIST Éric. Overview Introduction – what and why In a nutshell – main components Our approach – how we did it Demo –

Slides:



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

Services. Application component No user interface Two main uses Performing background processing Supporting remote method execution.
And so to Code. Forward, Reverse, and Round-Trip Engineering Forward Engineering Reverse Engineering Round-Trip Engineering.
Towards a Standard Interface for Runtime Inspection in AOP Environments OOPSLA Workshop on Tool for AOSD, Seattle, November 2002 Katharina Mehner and Awais.
Automated Evaluation of Runtime Object States Against Model-Level States for State-Based Test Execution Frank(Weifeng) Xu, Gannon University Dianxiang.
© 2008 by Borland Software Corp; made available under the EPL v1.0 | 17 March 2008 Introduction to the Graphical Modeling Framework Artem Tikhomirov, Borland.
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
An Aspect-Oriented Approach For Web Application Access Control Presented by: Mohamed Hassan Carleton University Carleton University
ASTA Aspect Software Testing Assistant Juha Gustafsson, Juha Taina, Jukka Viljamaa University of Helsinki.
1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
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.
Aspect-Oriented Programming In Eclipse ® Aspect-Oriented Programming in Eclipse with AspectJ Dr Helen Hawkins and Sian January.
Aspect-Oriented Programming: An Overview Brandon Wirick Feb
ASPECT ORIENTED SOFTWARE DEVELOPMENT Prepared By: Ebru Doğan.
DAIMI(c) Henrik Bærbak Christensen1 JUnit A tool for test case management.
Aspect-Oriented Software Development (AOSD) Tutorial #3 AspectJ - continued.
Unit Testing Tips and Tricks: Database Interaction Louis Thomas.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
JUnit The framework. Goal of the presentation showing the design and construction of JUnit, a piece of software with proven value.
Outline Introduction Problem Statement Object-Oriented Design Aspect-Oriented Design Conclusion Demo.
Supporting Automatic Model Inconsistency Fixing Yingfei Xiong University of Tokyo, Japan Zhenjiang HuNational Institute of Informatics, Japan Haiyan ZhaoPeking.
1 v1.6 08/02/2006 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Refactoring 5.Debugging 6.Testing.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Spring core v3.x Prepared by: Nhan Le. History v3.0 Spring Expression Language Java based bean metadata v3.1 Cache Abstraction Bean Definition Profile.
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.
VERIFICATION OF ASPECT ORIENTED MODELS BY DON MARTIN JAYASHREE VENKIPURAM PATHANGI PIYUSH SRIVASTAVA REFERENCES F. Mostefaoui and J. Vachon,” Design level.
1 Metamodel Access Protocols for Extensible Aspect-Oriented Modeling Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Shinji Sano(Kyushu Institute.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
A Novel Approach to Unit Test: The Aspect-Oriented Way Guoqing Xu and Zongyuan Yang Software Engineering Lab (SEL) East China Normal University
Junit At the forefront of Test Driven Development.
Aspect Oriented Programming Gülşah KARADUMAN.
VERIFICATION OF ASPECT-ORIENTED MODELS Review of Aspect-Oriented Definitions aspect – crosscutting concern that may involve multiple classes pointcut –
JCMP: Linking Architecture with Component Building Guoqing Xu, Zongyuan Yang and Haitao Huang Software Engineering Lab, East China Normal University SACT-01,
A Meta-Level Specification and Profile for AspectJ in UML Joerg Evermann School of Information Management Victoria University of Wellington.
1 OCL Tools Supervised by Prof. Daniel Amyot May Khalil Nadia Spido Submitted to Professor Daniel Amyot in partial fulfillment of the requirements for.
Methodology: The AOP Refactoring Process Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton Advisor:
A Distributed Aspect-Oriented System for J2EE Applications Muga Nishizawa and Shigeru Chiba (Tokyo Institute of Technology, Japan) Background - As benefits.
First BlueJ Day Houston, 2006 Unit Testing with BlueJ Bruce Quig Deakin University.
TRANSPARENT EXTENSION OF SINGLE- USER APPLICATIONS TO MULTI-USER REAL-TIME COLLABORATIVE SYSTEMS An Aspect Oriented Approach to Framework Integration ICEIS.
A Presentation By V AIBHAV S AHARAN Web-enHanced Information Management COMS E6125.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
1 An Aspect-Oriented Implementation Method Sérgio Soares CIn – UFPE Orientador: Paulo Borba.
ModelPedia Model Driven Engineering Graphical User Interfaces for Web 2.0 Sites Centro de Informática – CIn/UFPe ORCAS Group Eclipse GMF Fábio M. Pereira.
© Siemens AG, CT SE 2 C O R P O R A T E T E C H N O L O G Y 1 Model-Driven Development for Pluggable Collaborations Iris Groher, Stephan Bleicher, Christa.
Aspect-Oriented Action Semantics Descriptions Luis Menezes University of Pernambuco
Inter-Type Declarations in AspectJ Awais Rashid Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
AspectJ – AOP for Java Tom Janofsky. Instructor at Penn State Abington Consultant with Chariot Solutions JUG Member.
Course Progress Lecture 1 –Java data binding: Basket example: UML class diagram -> class dictionary without tokens-> language design -> class dictionary.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Jairson Vitorino, Cin UFPE May, 2nd 2005
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
1 OO Analysis & Design - Introduction to main ideas in OO Analysis & design - Practical experience in applying ideas -A large element is use of UML as.
JAOUT: Automated Generation of Aspect Oriented Unit Test Guoqing Xu, Z. Yang, H. Huang, Q. Chen, L. Chen and F. Xu Software Engineering Lab (SEL) East.
Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems.
问题 Code scattering Blocks of duplicated code Blocks of complementary code, and different modules implementing complementary parts of the concern Code.
Comparison of Different AOP Approaches Presented by: Xiaojing Wang.
AOSD'04, Lancaster, UK 1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech) Shigeru Chiba (Tokyo Tech) Michiaki Tatsubori.
Applying Aspect-Orientation in Designing Security Systems Shu Gao Florida International University Center for Advanced Distributed Systems Engineering.
CSC450 Software Engineering Devon M. Simmonds University of North Carolina, Wilmington 1.
1 An AOP Implementation Framework for Extending Join Point Models Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Hidehiko Masuhara(University.
1 Aspectual Caml an Aspect-Oriented Functional Language Hideaki Tatsuzawa Hidehiko Masuhara Akinori Yonezawa University of Tokyo.
PPL 2004, Gamagori, AICHI1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech, Japan) Shigeru Chiba (Tokyo Tech, Japan)
Aspect-oriented Code Generation Approaches Abid Mehmood & Dayang N. A. Jawawi Department of Software Engineering Faculty of Computer Science and Information.
Mechanisms for Requirements Driven Component Selection and Design Automation 최경석.
SWE 434 SOFTWARE TESTING AND VALIDATION LAB2 – INTRODUCTION TO JUNIT 1 SWE 434 Lab.
Arrays and Collections
AspectAda Aspect-Oriented Programming for Ada95
Introducing Java.
Presentation transcript:

AspectWrapper CHALFOUN Pierre et BUIST Éric

Overview Introduction – what and why In a nutshell – main components Our approach – how we did it Demo – a taste of things to come Conclusion – “wrap” things up Introduction – what and why In a nutshell – main components Our approach – how we did it Demo – a taste of things to come Conclusion – “wrap” things up

Introduction Problematic – in two words  Testing  A pain in the … “you know where”  Nevertheless … important !  Nevertheless … tedious and time consuming  Please, do automate ! Problematic – in two words  Testing  A pain in the … “you know where”  Nevertheless … important !  Nevertheless … tedious and time consuming  Please, do automate ! Introduction In a nutshell Our approach Demo Conclusion  Aspect-oriented programming  Crosscutting … How can you test that ?  Composition impact on code  Specifications are required when modeling ( UML )  Aspect-oriented programming  Crosscutting … How can you test that ?  Composition impact on code  Specifications are required when modeling ( UML )

Introduction Problematic – in one word  Specification-based automatic testing of aspect-oriented programs Problematic – in one word  Specification-based automatic testing of aspect-oriented programs Introduction In a nutshell Our approach Demo Conclusion

Introduction Motivation : an illustrated version Modeling aspects Test data report Generating oracles Running oracles Introduction In a nutshell Our approach Demo Conclusion

- In a nutshell - Testing Framework Test runners  Automate execution  Report results Test oracles  How to perform the test Test data – domain specific Two approaches  Specification-based (black box)  Program-based (white box) Test runners  Automate execution  Report results Test oracles  How to perform the test Test data – domain specific Two approaches  Specification-based (black box)  Program-based (white box) Introduction In a nutshell Our approach Demo Conclusion

- In a nutshell – Aspect Modeling 1/2 Aspect-UML – Mostefaoui et Vachon 2005  Language independent  Validate aspect composition  Aspect defined by stereotype « Aspect »  Pointcut defined by stereotype « PointCut »  Constraints are written in OCL  Cannot model inter-type declarations Aspect-UML – Mostefaoui et Vachon 2005  Language independent  Validate aspect composition  Aspect defined by stereotype « Aspect »  Pointcut defined by stereotype « PointCut »  Constraints are written in OCL  Cannot model inter-type declarations Introduction In a nutshell Our approach Demo Conclusion

- In a nutshell – Aspect Modeling 2/2 Aspect-UML – Mostefaoui et Vachon 2005 Introduction In a nutshell Our approach Demo Conclusion OCL constraint for the opDrop advice context Billing : :opDrop inv : connection=c inv : c.getTime() !=Null post : c.getCaller.getCharge() >=

- In a nutshell – Dresden : OCL to Java Dresden – Dresden University Group 2005  Parses OCL constraints in UML diagrams  Applicable only to Java and OOP  Long series of try and catch Dresden – Dresden University Group 2005  Parses OCL constraints in UML diagrams  Applicable only to Java and OOP  Long series of try and catch /** A wrapper for injection. Generated automatically, DO NOT #Person(tudresden.ocl.injection.lib.WrapperDummy) */ public Person(){ this((tudresden.ocl.injection.lib.WrapperDummy)null); try{ tudresden.ocl.injection.ocl.lib.Invariant.checking_flag=true; tudresden.ocl.injection.ocl.lib.Invariant.checkVacantInvariants(); }finally{ tudresden.ocl.injection.ocl.lib.Invariant.checking_flag=false; } }/** Introduction In a nutshell Our approach Demo Conclusion

- In a nutshell – aUnit 1/2 aUnit – Russ Miles 2005 “ Similar to how JUnit provides unit testing for Java, aUnit will provide mechanisms by which developers can test their aspects in isolation in support of Test Driven Development.” – Russ Miles 2004 Idea : calling an advice explicitly  Code manually the JoinPoint  One advice = 1 step  Get all the steps together and sort them  Execute each step in turn Idea : calling an advice explicitly  Code manually the JoinPoint  One advice = 1 step  Get all the steps together and sort them  Execute each step in turn Introduction In a nutshell Our approach Demo Conclusion

- In a nutshell – aUnit 2/2 Introduction In a nutshell Our approach Demo Conclusion

- Our approach - Aspect-UML to AspectJ Extending the mapping between UML and Java  1 « Aspect » = 1 java file Annotation AdviceName for the advice Attaching OCL constraints with annotations Extending the mapping between UML and Java  1 « Aspect » = 1 java file Annotation AdviceName for the advice Attaching OCL constraints with annotations Introduction In a nutshell Our approach Demo Conclusion /* When timing stops, calculate and add the charge from the * connection >= "+ " after(Connection conn): Timing.endTiming(conn) { long time = Timing.aspectOf().getTimer(conn).getTime(); long rate = conn.callRate(); long cost = rate * time; getPayer(conn).addCharge(cost); }

- Our approach - OCL annotation to Java Extending Dresden to take advice into account OCL is converted to JAVA in a class_Test.java file Each constraint has an associated non-static method Extending Dresden to take advice into account OCL is converted to JAVA in a class_Test.java file Each constraint has an associated non-static method Introduction In a nutshell Our approach Demo Conclusion public void prep$adv$opDrop (telecom.Connection conn) { […] final tudresden…OclInteger tudOclNode13= tudresden…toOclInteger(tudOclNode12.getFeature("totalCharge")); final tudresden…OclAnyImpl tudOclNode14= tudresden…toOclAnyImpl(tudOclNode11.getFeature("getPayer", tudOclParam1)); tudOclNode15=tudresden…toOclInteger(tudOclNode14. getFeature("totalCharge")); final tudresden…OclBoolean tudOclNode16= tudOclNode13.isGreaterEqual(tudOclNode15); } public tudresden…OclBoolean check$adv$pre$opDrop (telecom.Connection conn) { return tudresden…OclBoolean.TRUE; }

- Our approach - aUnit Revisited 1/2 Extending aUnit to support method calls : re- implement TestStep and subclass Extending aUnit to support method calls : re- implement TestStep and subclass Introduction In a nutshell Our approach Demo Conclusion public class MethodTestStep implements TestStep { protected Object testedObject; protected Method testedMethod; protected Object[] arguments; protected Object returnValue; protected List results = new ArrayList(); […] } public class CheckMethodTestStep Extends MethodTestStep { […] public void runStep() throws TestFailException { super.runStep(); OclBoolean oclBoolean = (OclBoolean)getResults().get (0); if (oclBoolean.isFalse()) { throw new TestFailException(); } }

- Our approach - aUnit Revisited 2/2 Usage example Introduction In a nutshell Our approach Demo Conclusion TestStep[] steps = new TestStep[2]; MockApplication mock = new MockApplication(); Class[] paramTypes = { int.class }; Method barMethod = mock.getClass().getMethod("bar", paramTypes); JoinPoint.StaticPart staticPart = Factory.makeEncSJP(barMethod); Object[] args = { 10 }; JoinPoint joinPoint = Factory.makeJP(staticPart, mock, mock, args); JoinPointContext context = new JoinPointContext(joinPoint); String adviceSelectorExpression = "id3"; TestStep Step1 = TestStepFactory.createControlledTestStep( (AspectObject) AfterAdviceExampleAspect.aspectOf(), context, adviceSelectorExpression); steps[0] = Step1; // our contribution MockApplication_Test mockTest = new MockApplication(mock); Method checkPost = mockTest.getClass().getMethod(“check$adv$pre$opDrop”,…); CheckMethodTestStep checkStep = new MethodTestStep(mock,checkPost,args,…); steps[1] = checkStep;

Demo OCL annotation to Java Introduction In a nutshell Our approach Demo Conclusion

Demo aUnit in action Introduction In a nutshell Our approach Demo Conclusion

Our contribution – missing piece of the puzzle Introduction In a nutshell Our approach Demo Conclusion Modeling aspects Generating oracles Running oracles Extend the mapping between UML and Java Extend the Dresden tool Extend the aUnit tool

Conclusion Related Work  Theme/UML  ArgoUML (Dresden toolbox)  JAOUT (JML) Future Work  Fully implement the framework and adapt to future releases of aUnit, Dresden and AspectJ 5  Propose extensions to Aspect-UML to model module interaction via new OCL constraints Related Work  Theme/UML  ArgoUML (Dresden toolbox)  JAOUT (JML) Future Work  Fully implement the framework and adapt to future releases of aUnit, Dresden and AspectJ 5  Propose extensions to Aspect-UML to model module interaction via new OCL constraints Introduction In a nutshell Our approach Demo Conclusion

Thank You AspectWrapper CHALFOUN Pierre & BUIST Eric