inria-00403568, version 1
Reusing and Composing Tests with Traits
Stéphane Ducasse 1Damien Pollet 1Alexandre Bergel 1Damien Cassou 2
47th International Conference on Objects, Components, Models and Patterns 33 (2009) 252-271
Résumé : Single inheritance often forces developers to duplicate code and logic. This widely recognized situation affects both business code and tests. In a large and complex application whose classes implement many groups of methods (protocols), duplication may also follow the application's idiosyncrasies, making it difficult to specify, maintain, and reuse tests. The research questions we faced are (i) how can we reuse test specifications across and within complex inheritance hierarchies, especially in presence of orthogonal protocols; (ii) how can we test interface behavior in a modular way; (iii) how far can we reuse and parametrize composable tests. In this paper, we compose tests out of separately specified behavioral units of reuse —traits. We propose test traits, where: (i) specific test cases are composed from independent specifications; (ii) executable behavior specifications may be reused orthogonally to the class hierarchy under test; (iii) test fixtures are external to the test specifications, thus are easier to specialize. Traits have been successfully applied to test two large and critical class libraries in Pharo, a new Smalltalk dialect based on Squeak, but are applicable to other languages with traits.
- 1 : RMOD (INRIA Lille - Nord Europe)
- INRIA – CNRS : UMR8022 – Université Lille 1 - Sciences et Technologies
- 2 : PHOENIX (INRIA Bordeaux - Sud-Ouest)
- INRIA – Université Sciences et Technologies - Bordeaux I – École Nationale Supérieure d'Électronique, Informatique et Radiocommunications de Bordeaux (ENSEIRB) – CNRS : UMR
- Domaine : Informatique/Réseaux et télécommunications
- inria-00403568, version 1
- http://hal.inria.fr/inria-00403568
- oai:hal.inria.fr:inria-00403568
- Contributeur : Lse Lse
- Soumis le : Vendredi 10 Juillet 2009, 15:42:23
- Dernière modification le : Mercredi 2 Décembre 2009, 16:49:21






Documents associés
Exporter