Automated State-Based Unit Testing for Aspect-Oriented Programs: A Supporting Framework.
Mourad Badri, Linda N. Badri, Maxime Bourque-Fortin · The Journal of Object Technology · 2009
Interactions between aspects and classes are a new source for faults.Existing objectoriented testing techniques are not adequate for testing aspect-oriented programs.As a consequence, new testing techniques must be developed.We present, in this paper, a state-based unit testing technique for aspect-oriented programs and associated tool (AJUnit).The technique focuses on the integration of one or several aspects to a class.The objective is to ensure that the integration is done without affecting the original behavior of the class.AJUnit, based on the model of JUnit, generates testing sequences covering an aspect(s)-class block of code.It also supports the execution and verification of the generated sequences.We focus on AspectJ programs.Testing an aspect(s)-class block is done incrementally.Furthermore, the generated sequences are archived.In the case of a change instantiated on a class or on one of its related aspects, only the testing sequences corresponding to the affected parts of the code are retested.The same approach is followed when introducing a new aspect influencing the class under test.The technique is based on several testing criteria that we defined.The generation and verification process of the testing sequences is completely automated.