Praspel: Contract-Driven Testing for PHP using Realistic Domains - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Rapport (Rapport De Recherche) Année : 2014

Praspel: Contract-Driven Testing for PHP using Realistic Domains

Résumé

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.
Fichier principal
Vignette du fichier
RR-8592.pdf (1.04 Mo) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)
Loading...

Dates et versions

hal-01061900 , version 1 (08-09-2014)

Identifiants

  • HAL Id : hal-01061900 , version 1

Citer

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⟩
377 Consultations
504 Téléchargements

Partager

Gmail Facebook X LinkedIn More