Aspect-Oriented Programming (AOP) has been proposed as a methodology that provides new modularization of software systems by allowing encapsulation of cross-cutting concerns. AspectJ, an aspect-oriented programming language, provides two major constructs: advice and pointcuts. The scope of pointcuts spans across various objects instantiated from the classes. With the increase in the number of objects, classes, and integration of source code, it is likely that a developer writes a pointcut that does not serve its intended purpose. Therefore, there is a need to test pointcuts for validating the correctness of their expressions.In this paper, we propose APTE, an automated framework that tests pointcuts in AspectJ programs with the help of AJTE, an existing unit-testing framework without weaving. Our new APTE framework identifies joinpoints that satisfy a pointcut expression and a set of boundary joinpoints, which are events that do not satisfy a pointcut expression but are close to the matched joinpoints. The boundary joinpoints are identified as those unmatched join-point candidates whose distance from the matched joinpoints are less than a predefined threshold value. A developer could inspect these matched joinpoints and boundary joinpoints for correctness of the pointcuts.
[1]
Ken Arnold,et al.
The Java Programming Language
,
1996
.
[2]
Christian Koppen,et al.
PCDiff : Attacking the Fragile Pointcut Problem
,
2004
.
[3]
Hewlett-Packard.
An Approach for Adequate Testing of AspectJ Programs
,
2005
.
[4]
Hidehiko Masuhara,et al.
A Unit Testing Framework for Aspects without Weaving
,
2005
.
[5]
Kim Mens,et al.
A Model-driven Pointcut Language for More Robust Pointcuts
,
2006
.
[6]
Tao Xie,et al.
A framework and tool supports for generating test inputs of AspectJ programs
,
2006,
AOSD.
[7]
Frank Yellin,et al.
The Java Virtual Machine Specification
,
1996
.
[8]
Robert V. Binder,et al.
Testing Object-Oriented Systems: Models, Patterns, and Tools
,
1999
.
[9]
Jürgen Graf,et al.
Using pointcut delta analysis to support evolution of aspect-oriented software
,
2005,
21st IEEE International Conference on Software Maintenance (ICSM'05).
[10]
Thomas Ledoux,et al.
Aspect-Oriented Software Development
,
2003
.
[11]
Russell Miles.
Aspectj Cookbook
,
2004
.