Praspel: Contract-Driven Testing for PHP using Realistic Domains

Ivan Enderlin 1, 2 Fabrice Bouquet 1, 2 Frédéric Dadeau 1, 2 Alain Giorgetti 1, 2
1 CASSIS - Combination of approaches to the security of infinite states systems
FEMTO-ST - Franche-Comté Électronique Mécanique, Thermique et Optique - Sciences et Technologies, Inria Nancy - Grand Est, LORIA - FM - Department of Formal Methods
Abstract : We present an integrated contract-based testing framework for PHP. It relies on a behavioral interface specification language called Praspel, for "PHP Realistic Annotation and Specification Language". Using Praspel developers can easily annotate their PHP scripts with formal contracts, namely class invariants, and method pre- and postconditions. These contracts describe assertions either by predicates or by assigning realistic domains to data. Realistic domains introduce types in PHP and describe complex structures frequently encountered in applications, such as email addresses or SQL queries. Realistic domains display two properties: predicability, which allows to check if a data belongs to a given realistic domain, and samplability, which allows to generate valid data. This paper introduces coverage criteria dedicated to contracts, designed to exhibit relevant behaviors of the annotated methods. Test data are then computed to satisfy these coverage criteria, by using dedicated data generators for complex realistic domains, such as arrays or strings. This framework has been implemented and disseminated within the PHP community, which gave us feedback on their usage of the tool and the relevance of this integrated process with respect to their practice of manual testing.
Type de document :
[Research Report] RR-8592, INRIA. 2014, pp.39
Liste complète des métadonnées

Littérature citée [39 références]  Voir  Masquer  Télécharger
Contributeur : Alain Giorgetti <>
Soumis le : lundi 8 septembre 2014 - 17:00:30
Dernière modification le : jeudi 11 janvier 2018 - 06:24:26
Document(s) archivé(s) le : mardi 9 décembre 2014 - 12:35:16


Fichiers produits par l'(les) auteur(s)


  • HAL Id : hal-01061900, version 1


Ivan Enderlin, Fabrice Bouquet, Frédéric Dadeau, Alain Giorgetti. Praspel: Contract-Driven Testing for PHP using Realistic Domains. [Research Report] RR-8592, INRIA. 2014, pp.39. 〈hal-01061900〉



Consultations de la notice


Téléchargements de fichiers