An Approach for Testing Pointcut Descriptors in AspectJ

Abstract : 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.
Type de document :
Article dans une revue
Software Testing, Verification and Reliability, Wiley, 2011
Liste complète des métadonnées

Littérature citée [31 références]  Voir  Masquer  Télécharger

https://hal.inria.fr/hal-00641263
Contributeur : Benoit Baudry <>
Soumis le : mardi 15 novembre 2011 - 11:57:59
Dernière modification le : vendredi 16 novembre 2018 - 01:22:32
Document(s) archivé(s) le : jeudi 16 février 2012 - 02:25:36

Fichier

delamare11.pdf
Fichiers produits par l'(les) auteur(s)

Identifiants

  • HAL Id : hal-00641263, version 1

Citation

Romain Delamare, Benoit Baudry, Sudipto Ghosh, Shashank Gupta, Yves Le Traon. An Approach for Testing Pointcut Descriptors in AspectJ. Software Testing, Verification and Reliability, Wiley, 2011. 〈hal-00641263〉

Partager

Métriques

Consultations de la notice

593

Téléchargements de fichiers

196