Skip to Main content Skip to Navigation
New interface
Reports (Research report)

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 (UMR 6174), 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.
Document type :
Reports (Research report)
Complete list of metadata

Cited literature [39 references]  Display  Hide  Download
Contributor : Alain Giorgetti Connect in order to contact the contributor
Submitted on : Monday, September 8, 2014 - 5:00:30 PM
Last modification on : Wednesday, October 26, 2022 - 8:16:39 AM
Long-term archiving on: : Tuesday, December 9, 2014 - 12:35:16 PM


Files produced by the author(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⟩



Record views


Files downloads