• DocumentCode
    626363
  • Title

    A Constraint Solver for PHP Arrays

  • Author

    Enderlin, Ivan ; Giorgetti, A. ; Bouquet, Fabrice

  • Author_Institution
    Inst. FEMTO-ST, Univ. of Franche-Comte, Besancon, France
  • fYear
    2013
  • fDate
    18-22 March 2013
  • Firstpage
    218
  • Lastpage
    223
  • 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.
  • Keywords
    constraint handling; program testing; specification languages; PHP array; Praspel; constraint solver; contract-based testing; data type; formal precondition; generation algorithm; specification language; strings; test data generation; unit test generator; Arrays; Context; Contracts; Electronic mail; Generators; Syntactics; Testing; array; constraint; php; praspel; realistic domain; solver;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Software Testing, Verification and Validation Workshops (ICSTW), 2013 IEEE Sixth International Conference on
  • Conference_Location
    Luxembourg
  • Print_ISBN
    978-1-4799-1324-4
  • Type

    conf

  • DOI
    10.1109/ICSTW.2013.80
  • Filename
    6571634