Reusing and Composing Tests with Traits

Stéphane Ducasse 1 Damien Pollet 1 Alexandre Bergel 1 Damien Cassou 2
1 RMOD - Analyses and Languages Constructs for Object-Oriented Application Evolution
LIFL - Laboratoire d'Informatique Fondamentale de Lille, Inria Lille - Nord Europe
2 Phoenix - Programming Language Technology For Communication Services
EA4136 - Handicap et système nerveux :Action, communication, interaction: rétablissement de la fonction et de la participation [Bordeaux], Inria Bordeaux - Sud-Ouest, LaBRI - Laboratoire Bordelais de Recherche en Informatique
Abstract : 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.
Document type :
Conference papers
Complete list of metadatas

Cited literature [13 references]  Display  Hide  Download

https://hal.inria.fr/inria-00403568
Contributor : Lse Lse <>
Submitted on : Friday, July 10, 2009 - 3:42:23 PM
Last modification on : Thursday, February 21, 2019 - 10:52:50 AM
Long-term archiving on : Monday, October 15, 2012 - 3:11:17 PM

File

Reusing_Composing.pdf
Files produced by the author(s)

Identifiers

  • HAL Id : inria-00403568, version 1

Citation

Stéphane Ducasse, Damien Pollet, Alexandre Bergel, Damien Cassou. Reusing and Composing Tests with Traits. TOOLS'09: 47th International Conference on Objects, Components, Models and Patterns, Oct 2009, New York, United States. pp.252-271. ⟨inria-00403568⟩

Share

Metrics

Record views

507

Files downloads

387