Close search

CSTVA 2013

Logo de ICST The conference ICST (International Conference on Software Testing, Verification and Validation) is an international conference about the software quality, mainly about the verification and the validation. This conference proposes several workshops whose CSTVA (Constraints in Software Testing Verification and Analysis) to whom Ivan Enderlin was present to make a presentation of its latest researches (we can found in Hoa).

A Constraint Solver for PHP Arrays

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.

Article and presentation

The article and the presentation are available in PDF format.