Contract-based testing: from objects to components

Philippe Collet, Daniel Deveaux, Roger J. Rousseau, Yves Le Traon · 2006

Contracts on object-oriented classes have been first developed as a software design approach. They were also quickly used for supporting class testing, providing a form of design for testability. In this paper, we identify the tracks to extend the contract-based built-in test technique to hierarchical components. To do that, we build on our previous work on STclass, a framework supporting design by contract and built-in test for Java, and on ConFract, a contracting system for the Fractal component platform. Tests are embedded in the components and are generated with respect to a category of contract (library, interface, composition). In this paper we study how this approach, firstly dedicated to objects, can be valuable for component testability. As a result of the test process, the embedded contracts are more robust and offer an original way to improve the observability of the component-based system. Contracts make it aware of its execution, and thus able to detect erroneous behaviors at runtime.

Read the paper · More papers on PaperTik