Testing Aspect-Oriented Programs with UML Design Models

The new constructs in aspect-oriented programming bring new types of programming faults with respect to crosscutting concerns, such as incorrect pointcuts and advice. This paper presents a UML-based approach to testing whether or not an aspect-oriented program conforms to its expected crosscutting behavior. We explore aspect-oriented UML design models to derive tests for exercising interactions between aspects and classes. Each aspect-oriented model consists of class diagrams, aspect diagrams, and sequence diagrams. For a method under test, we weave the sequence diagrams of the advice on the method into the method's sequence diagram. Based on the woven sequence diagram and class/aspect diagrams, we then generate an AOF (Aspect-Object Flow) tree by applying coverage criteria such as condition coverage, polymorphic coverage, and loop coverage to woven sequence diagrams. In the AOF tree, each path from the root to a leaf is an abstract message sequence, indicating a template of test cases. A concrete test case is obtained by creating objects that satisfy the collective constraints in the template. Our empirical study shows that the model-based testing approach is capable of revealing several types of aspect-specific faults, including incorrect advice type, incorrect (weaker or stronger) pointcut strengths, and incorrect aspect precedence.

[1]  YAN Han A Meta Model and Modeling Notation for AspectJ , 2004 .

[2]  Alexander Pretschner,et al.  One evaluation of model-based testing and its automation , 2005, ICSE.

[3]  Zhihong Zeng,et al.  Functional Test Generation using Constraint Logic Programming , 2001, VLSI-SOC.

[4]  Tzilla Elrad,et al.  UML PROFILE FOR ASPECT-ORIENTED SOFTWARE DEVELOPMENT , 2003 .

[5]  Giovanni Denaro,et al.  An experience on verification of aspect properties , 2001, IWPSE '01.

[6]  Mark R. Blackburn,et al.  Mars Polar Lander fault identification using model-based testing , 2002, Eighth IEEE International Conference on Engineering of Complex Computer Systems, 2002. Proceedings..

[7]  Robert B. France,et al.  Rigorous Testing by Merging Structural and Behavioral UML Representations , 2003, UML.

[8]  Brian Marick,et al.  The craft of software testing - subsystem testing including object-based and object-oriented testing , 1994 .

[9]  Stephen J. Mellor A Framework for Aspect-Oriented Modeling , 2003 .

[10]  Jeff Offutt,et al.  A Controlled Experimental Evaluation of Test Cases Generated from UML Diagrams , 2004 .

[11]  Alexander Pretschner,et al.  Model-Based Testing in Practice , 2005, FM.

[12]  Yves Deville,et al.  Consistency techniques for interprocedural test data generation , 2003, ESEC/FSE-11.

[13]  Kathi Fisler,et al.  Verifying cross-cutting features as open systems , 2002, SIGSOFT '02/FSE-10.

[14]  Weifeng Xu A Model-Based Approach to Test Generation for Aspect-Oriented Programs , 2005 .

[15]  E. Barra,et al.  An approach to Aspect Modelling with UML 2 . 0 , 2004 .

[16]  Oege de Moor,et al.  Static analysis of aspects , 2003, AOSD '03.

[17]  A. Jefferson Offutt,et al.  Using UML Collaboration Diagrams for Static Checking and Test Generation , 2000, UML.

[18]  Jean-Michel Bruel,et al.  Using Aspects to Develop Built-In Tests for Components , 2003 .

[19]  Alexander Pretschner,et al.  Abstractions for Model-Based Testing , 2005, Electron. Notes Theor. Comput. Sci..

[20]  Renaud Pawlak,et al.  On Getting Use Cases and Aspects to Work Together , 2004, J. Object Technol..

[21]  Debra J. Richardson,et al.  Towards A Practical Approach to Test Aspect-Oriented Software , 2004, SOQUA/TECOS.

[22]  Iris Groher,et al.  Generating Aspect Code from UML Models , 2003 .

[23]  Geri Georg,et al.  An Aspect Oriented Approach to Analyzing Dependability Features , .

[24]  Uniform Support for Modeling Crosscutting Struct , 2009 .

[25]  D. Notkin,et al.  Automated Test Generation for AspectJ Programs , 2005 .

[26]  A. Jefferson Offutt,et al.  The dynamic domain reduction procedure for test data generation , 1999, Softw. Pract. Exp..

[27]  Robert V. Binder,et al.  Testing Object-Oriented Systems: Models, Patterns, and Tools , 1999 .

[28]  Ivar Jacobson,et al.  Aspect-oriented software development with use cases , 2005, Addison Wesley object technology series.

[29]  James A. Whittaker,et al.  Model‐Based Software Testing , 2002 .

[30]  Filippo Diotalevi Contract enforcement with AOP: Apply design by contract to Java software development with AspectJ , 2004 .

[31]  Yves Deville,et al.  Automatic test data generation for programs with integer and float variables , 2001, Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001).

[32]  Gregor Kiczales,et al.  Uniform support for modeling crosscutting structure , 2005, MoDELS'05.

[33]  Alexander Pretschner,et al.  Model Based Testing for Real: The Inhouse Card Case Study , 2001 .

[34]  Xiao Ma,et al.  A Constraint Solver for Code-based Test Data Generation , 2005, International Conference on Software Engineering and Knowledge Engineering.

[35]  James M. Bieman,et al.  Towards the Systematic Testing of Aspect-Oriented Programs , 2004 .

[36]  Stefan Hanenberg,et al.  A UML-based aspect-oriented design notation for AspectJ , 2002, AOSD '02.

[37]  Yan Han,et al.  Towards Visual AspectJ by a Meta Model and Modeling Notation , 2005 .

[38]  Tzilla Elrad,et al.  Weaving With Statecharts , 2002 .

[39]  Gregor Kiczales,et al.  Aspect-oriented programming , 1996, CSUR.

[40]  G. Murphy,et al.  ActiveAspect: presenting crosscutting structure , 2005, ACM SIGSOFT Softw. Eng. Notes.

[41]  Gregg Rothermel,et al.  Empirical Studies of a Safe Regression Test Selection Technique , 1998, IEEE Trans. Software Eng..

[42]  Jianjun Zhao,et al.  Data-flow-based unit testing of aspect-oriented programs , 2003, Proceedings 27th Annual International Computer Software and Applications Conference. COMPAC 2003.

[43]  Dianxiang Xu,et al.  State-based testing of integration aspects , 2006, WTAOP '06.

[44]  Dianxiang Xu,et al.  State-based incremental testing of aspect-oriented programs , 2006, AOSD.

[45]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[46]  Tao Xie,et al.  A framework and tool supports for generating test inputs of AspectJ programs , 2006, AOSD.

[47]  Mary Lou Soffa,et al.  Automated test data generation using an iterative relaxation method , 1998, SIGSOFT '98/FSE-6.

[48]  Naoyasu Ubayashi,et al.  Aspect-oriented programming with model checking , 2002, AOSD '02.

[49]  Hridesh Rajan,et al.  Aspect language features for concern coverage profiling , 2005, AOSD '05.

[50]  Dianxiang Xu,et al.  A State-Based Approach to Testing Aspect-Oriented Programs , 2005, SEKE.

[51]  Indrakshi Ray,et al.  An aspect-based approach to modeling access control concerns , 2004, Inf. Softw. Technol..

[52]  Ivar Jacobson,et al.  Use Cases and Aspects-Working Seamlessly Together , 2003, J. Object Technol..

[53]  Robert B. France,et al.  Test adequacy criteria for UML design models , 2003, Softw. Test. Verification Reliab..

[54]  Shaoying Liu,et al.  Generating test data from state‐based specifications , 2003, Softw. Test. Verification Reliab..

[55]  Martin Rinard,et al.  System Dependence Graph Construction for Aspect-Oriented Programs , 2003 .

[56]  Roger T. Alexander,et al.  Distributing classes with woven concerns: an exploration of potential fault scenarios , 2005, AOSD '05.