A Constraint Solver for PHP Arrays - Archive ouverte HAL Accéder directement au contenu
Communication Dans Un Congrès Année : 2013

A Constraint Solver for PHP Arrays

Résumé

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

Dates et versions

hal-00935308 , version 1 (23-01-2014)

Identifiants

  • HAL Id : hal-00935308 , version 1

Citer

Ivan Enderlin, Alain Giorgetti, Fabrice Bouquet. A Constraint Solver for PHP Arrays. ICST Workshops, Jan 2013, Luxembourg. pp.218 - 223. ⟨hal-00935308⟩
115 Consultations
673 Téléchargements

Partager

Gmail Facebook X LinkedIn More