JAOUT: automated generation of aspect-oriented unit test

Unit testing is a methodology for testing small parts of an application independently of whatever application uses them. It is time consuming and tedious to write unit tests, and it is especially difficult to write unit tests that model the pattern of usage of the application. Aspect-oriented programming (AOP) addresses the problem of separation of concerns in programs which is well suited to unit test problems. What's more, unit tests should be made from different concerns in the application instead of just from functional assertions of correctness or error. In this paper, we firstly present a new concept, application-specific Aspects, which mean top-level aspects picked up from generic low-level aspects in AOP for specific use. It can be viewed as the separation of concerns on applications of generic low-level aspects. Second, this paper describes an aspect-oriented test description language (AOTDL) and techniques to build top-level aspects for testing on generic aspects. Third, we generate JUnit unit testing framework and test oracles from AspectJ programs by integrating our tool with AspectJ and JUnit. We use runtime exceptions thrown by testing aspects to decide whether methods work well. Finally, we present a double-phase testing way to filter out meaningless test cases in our framework.

[1]  K. Beck,et al.  Extreme Programming Explained , 2002 .

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

[3]  William G. Griswold,et al.  Dynamically discovering likely program invariants to support program evolution , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[4]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[5]  A. Jefferson Offutt,et al.  Generating Tests from UML Specifications , 1999, UML.

[6]  David Garlan,et al.  Reasoning about implicit invocation , 1998, SIGSOFT '98/FSE-6.

[7]  David Notkin,et al.  Mutually Enhancing Test Generation and Specification Inference , 2003, FATES.

[8]  Jeffrey M. Voas,et al.  Quality Time - Can Aspect-Oriented Programming Lead to More Reliable Software? , 2000, IEEE Softw..

[9]  Daniel Jackson,et al.  Alcoa: the Alloy constraint analyzer , 2000, Proceedings of the 2000 International Conference on Software Engineering. ICSE 2000 the New Millennium.

[10]  Gary T. Leavens,et al.  A Simple and Practical Approach to Unit Testing: The JML and JUnit Way , 2002, ECOOP.

[11]  Hans-Martin Hörcher,et al.  Improving Software Tests Using Z Specifications , 1995, ZUM.

[12]  Ivar Jacobson,et al.  Unified Modeling Language User Guide, The (2nd Edition) (Addison-Wesley Object Technology Series) , 2005 .

[13]  Harold Ossher,et al.  Multi-Dimensional Separation of Concerns and the Hyperspace Approach , 2002 .

[14]  Ivar Jacobson,et al.  The unified modeling language reference manual , 2010 .

[15]  Debra J. Richardson,et al.  Structural specification-based testing: automated support and experimental evaluation , 1999, ESEC/FSE-7.

[16]  J. Michael Spivey,et al.  The Z notation - a reference manual , 1992, Prentice Hall International Series in Computer Science.

[17]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[18]  Karl J. Lieberherr,et al.  Aspect-oriented programming with adaptive methods , 2001, CACM.

[19]  Guoqing Xu,et al.  JMLAutoTest: A Novel Automated Testing Framework Based on JML and JUnit , 2003, FATES.

[20]  Jürgen Dingel,et al.  Evaluating and improving the automatic analysis of implicit invocation systems , 2003, ESEC/FSE-11.

[21]  Gary T. Leavens,et al.  Obliviousness, Modular Reasoning, and the Behavioral Subtyping Analogy , 2003 .

[22]  Sarfraz Khurshid,et al.  Korat: automated testing based on Java predicates , 2002, ISSTA '02.

[23]  S. L. Gerhart,et al.  Toward a theory of test data selection , 1975, IEEE Transactions on Software Engineering.

[24]  Sarfraz Khurshid,et al.  TestEra: a novel framework for automated testing of Java programs , 2001, Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001).

[25]  Sriram Sankar,et al.  Specifying and Testing Software Components using ADL , 1994 .

[26]  Lodewijk Bergmans,et al.  Composing crosscutting concerns using composition filters , 2001, CACM.

[27]  Albert L. Baker,et al.  Preliminary design of JML: a behavioral interface specification language for java , 2006, SOEN.

[28]  Gary T. Leavens,et al.  Observers and Assistants: A Proposal for Modular Aspect-Oriented Reasoning , 2002 .

[29]  Manu Sridharan,et al.  A micromodularity mechanism , 2001, ESEC/FSE-9.

[30]  Bogdan Korel,et al.  Automated regression test generation , 1998, ISSTA '98.

[31]  David Notkin,et al.  ArchJava: connecting software architecture to implementation , 2002, ICSE '02.

[32]  David Notkin,et al.  Tool-assisted unit test selection based on operational violations , 2003, 18th IEEE International Conference on Automated Software Engineering, 2003. Proceedings..

[33]  Kent Beck,et al.  Test-infected: programmers love writing tests , 2000 .

[34]  Mattia Monga,et al.  Reasoning on AspectJ Programmes , 2003 .