Property-based testing (PBT) is a technique for validating code against an executable specifica- tion by automatically generating test-data. We present a proof-theoretical reconstruction of this style of testing for relational specifications and employ the Foundational Proof Certificate frame- work to describe test generators. We do this by encoding certain kinds of “proof outlines” as proof certificates that can describe various common generation strategies in the PBT literature, ranging from random to exhaustive, including their combination. We also address the shrinking of counterexamples as a first step toward their explanation. Once generation is accomplished, the testing phase is a standard logic programing search. After illustrating our techniques on simple, first-order (algebraic) data structures, we lift it to data structures containing bindings by using the λ-tree syntax approach to encode bindings. The λProlog programing language can perform both generating and checking of tests using this approach to syntax. We then further extend PBT to specifications in a fragment of linear logic.

Property-Based Testing by Elaborating Proof Outlines / D. Miller, A. Momigliano. - In: THEORY AND PRACTICE OF LOGIC PROGRAMMING. - ISSN 1471-0684. - 24:6(2024 Nov), pp. 1123-1162. [10.1017/s1471068424000176]

Property-Based Testing by Elaborating Proof Outlines

A. Momigliano
Ultimo
2024

Abstract

Property-based testing (PBT) is a technique for validating code against an executable specifica- tion by automatically generating test-data. We present a proof-theoretical reconstruction of this style of testing for relational specifications and employ the Foundational Proof Certificate frame- work to describe test generators. We do this by encoding certain kinds of “proof outlines” as proof certificates that can describe various common generation strategies in the PBT literature, ranging from random to exhaustive, including their combination. We also address the shrinking of counterexamples as a first step toward their explanation. Once generation is accomplished, the testing phase is a standard logic programing search. After illustrating our techniques on simple, first-order (algebraic) data structures, we lift it to data structures containing bindings by using the λ-tree syntax approach to encode bindings. The λProlog programing language can perform both generating and checking of tests using this approach to syntax. We then further extend PBT to specifications in a fragment of linear logic.
property-based testing; relational specifications; meta-theory of programing languages; λ-tree syntax; linear logic
Settore INFO-01/A - Informatica
Settore MATH-01/A - Logica matematica
nov-2024
21-gen-2024
https://hdl.handle.net/2434/1072028
Article (author)
File in questo prodotto:
File Dimensione Formato  
property-based-testing-by-elaborating-proof-outlines-1.pdf

accesso aperto

Descrizione: Online First
Tipologia: Publisher's version/PDF
Dimensione 1.35 MB
Formato Adobe PDF
1.35 MB Adobe PDF Visualizza/Apri
property-based-testing-by-elaborating-proof-outlines.pdf

accesso aperto

Tipologia: Publisher's version/PDF
Dimensione 1.37 MB
Formato Adobe PDF
1.37 MB Adobe PDF Visualizza/Apri
Pubblicazioni consigliate

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/2434/1120939
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 0
  • ???jsp.display-item.citation.isi??? 0
  • OpenAlex ND
social impact