Software systems are now getting huge and complicated. There are many programming problems for which neither procedural nor object-oriented programming technique is sufficient to capture the design of programs clearly. It makes implementations of the design to be tangled, and cross-cutting concepts make difficult to develop and maintain the programs. So we need a new module unit, called Aspect that can express real world.
It is the main concept of Aspect-Oriented Programming that makes it possible to clearly express programs involving such Aspects, including appropriate isolation, composition and reuse of the Aspect code. AspectJ is an apsect language specification with Aspect Weaver of Aspect-Oriented Programming in Java.
JUnit is a simple testing java framework to write repeatable tests. Unit Testing makes softwares firm. Unit Testing is testing whether units work rightly or not. MockObject is used for virtual and temporary implemetation of inteface. Testing concepts can be seperated from and joined together with tested objects.
There are some problems and difficulties in JUnit and MockObject. JUnit can test only public methods. MockObject is always reprogrammed as interface changing. Testing modules and mockobjects are managed seperately. That makes programmers confused and design unclear.
We propose AspectJUnit to combine the merits of Aspect-Oriented Programming and JUnit framework. AspectJUnit is well organized Unit Testing Environment. It consists of two parts: class level(JUnit, MockObject) and aspect level(MockObject Generator, Innver Value Testing, Tracing). Extracting Aspects from JUnit and MockObject helps more modularizations. Adding new Aspects to our framework gives more functions.
There are some tangled codes in result expressions of user interfaces in JUnit and logic evaluations in MockObject. Those codes can be separted as Aspects. New Aspects such as MockObject Generator, Inner Value Testing and Tracing add new functions to our framework. MockObject Generator can create and maintain mockobjects automatically. Inner Value Testing Aspect shows changed values of arguments in methods. Tracing Aspect shows method calling sequences. All Aspects can control the range of affecting methods. Our framework provides ability to test other than public method : private and protected.
Our AspectJUnit is integration of JUnit, MockObject and Aspects above, which offers convenient programming environment.