An Approach for Testing Pointcut Descriptors in AspectJ - Université de Rennes Accéder directement au contenu
Article Dans Une Revue Journal of Software Testing, Verification and Reliability Année : 2011

An Approach for Testing Pointcut Descriptors in AspectJ

Résumé

Aspect-oriented programming (AOP) promises better software quality through enhanced modularity. Crosscutting concerns are encapsulated in separate units called aspects and are introduced at specific points in the base program at compile-time or runtime. However, aspect-oriented mechanisms also introduce new risks for reliability that must be tackled by specific testing techniques in order to fully benefit from the use of AOP. This paper focuses on the pointcut descriptor (PCD) that declares the set of points in the base program's execution where the crosscutting concern must be woven. A fault in the PCD can have a ripple effect and result in many different faults. New behavior may be added in unexpected places, or places where new behavior should be added may be missed. When implementing aspect-oriented programs with AspectJ, JUnit is most commonly used to test the program. However, JUnit does not offer any mechanism to look for faults specifically located in the PCD. As a consequence, these faults can be detected only through complex test scenarios and side effects that are difficult to trigger and observe. This paper proposes to monitor the execution of advices in an aspect-oriented program and use this information to build test cases that target faults in PCDs. The AdviceTracer tool has been developed to automatically monitor and store all information related to advice executions. It also offers a set of operations that can be used to check the presence or absence of advices at specific points in the execution. These operations improve the definition of an oracle for PCD test cases. An empirical study is performed to compare JUnit and AdviceTracer for testing PCDs in terms of the complexity of test cases and their ability to detect faults. The study is performed on a Healthwatcher system that has 93 classes and 19 PCDs. It reveals that test cases that use AdviceTracer to test PCDs are easier to write (shorter test cases and written in less time than with JUnit) and detect more faults.
Fichier principal
Vignette du fichier
delamare11.pdf (464.29 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)
Loading...

Dates et versions

hal-00641263 , version 1 (15-11-2011)

Identifiants

  • HAL Id : hal-00641263 , version 1

Citer

Romain Delamare, Benoit Baudry, Sudipto Ghosh, Shashank Gupta, Yves Le Traon. An Approach for Testing Pointcut Descriptors in AspectJ. Journal of Software Testing, Verification and Reliability, 2011. ⟨hal-00641263⟩
334 Consultations
711 Téléchargements

Partager

Gmail Facebook X LinkedIn More