A Constraint Solver for PHP Arrays

Ivan Enderlin 1, 2 Alain Giorgetti 1, 2 Fabrice Bouquet 1, 2
2 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 : In previous works, we have proposed Praspel, a framework for contract-based testing in PHP. Among others, it includes a specification language and a unit test generator which automatically generates test data from formal preconditions. The generator sometimes rejects data, when they do not satisfy parts of the preconditions. In many cases, generation with rejection is not efficient enough. Thus we investigate practical contexts where more efficient generation algorithms can be designed and we extend Praspel with their implementation. After strings, that we have already considered, the most frequent data type in PHP is arrays. They cover most of the needs for collections, because they can store key-value pairs of any kind, they do not have a specific length or depth, and they are efficiently implemented. In this paper, we report on a study to know what are the most popular constraints on PHP arrays. Then we formalize these constraints and we present an implementation in PHP of a constraint solver for these constraints. In this context, the constraint-based approach removes all the rejections.
Document type :
Conference papers
Complete list of metadatas

Cited literature [16 references]  Display  Hide  Download

https://hal.archives-ouvertes.fr/hal-00909202
Contributor : Alain Giorgetti <>
Submitted on : Tuesday, November 26, 2013 - 9:27:01 AM
Last modification on : Tuesday, December 18, 2018 - 4:38:25 PM
Long-term archiving on : Thursday, February 27, 2014 - 5:45:12 AM

File

EGB13.pdf
Files produced by the author(s)

Identifiers

Citation

Ivan Enderlin, Alain Giorgetti, Fabrice Bouquet. A Constraint Solver for PHP Arrays. ICSTW - Sixth International IEEE Conference on Software Testing, Verification and Validation Workshops - 2013, Mar 2013, Luxembourg, Luxembourg. pp.218-223, ⟨10.1109/ICSTW.2013.80⟩. ⟨hal-00909202⟩

Share

Metrics

Record views

346

Files downloads

1220