Property-Based Testing via Proof Reconstruction

被引:2
|
作者
Blanco, Roberto [1 ]
Miller, Dale [2 ,3 ]
Momigliano, Alberto [4 ]
机构
[1] INRIA Paris, Paris, France
[2] INRIA Saclay, Palaiseau, France
[3] Ecole Polytech, LIX, Palaiseau, France
[4] Univ Milan, DI, Milan, Italy
关键词
LOGIC; SYSTEM; GENERATION; SEARCH;
D O I
10.1145/3354166.3354170
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Property-based testing (PBT) is a technique for validating code against an executable specification 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 framework to describe test generators. We do this by presenting certain kinds of "proof outlines" that can be used to 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 towards their explanation. Once generation is accomplished, the testing phase boils down to a standard logic programming search. After illustrating our techniques on simple, first-order (algebraic) data structures, we lift it to data structures containing bindings using.-tree syntax. The lambda Prolog programming language is capable of performing both the generation and checking of tests. We validate this approach by tackling benchmarks in the metatheory of programming languages coming from related tools such as PLT-Redex.
引用
收藏
页数:13
相关论文
共 50 条
  • [1] Property-Based Testing by Elaborating Proof Outlines
    Miller, Dale
    Momigliano, Alberto
    THEORY AND PRACTICE OF LOGIC PROGRAMMING, 2024,
  • [2] Developments in Property-Based Testing
    Midtgaard, Jan
    PROCEEDINGS OF THE ACM SIGPLAN WORKSHOP ON PARTIAL EVALUATION AND PROGRAM MANIPULATION (PEPM'18), 2018, : 1 - 1
  • [3] Targeted Property-Based Testing
    Loscher, Andreas
    Sagonas, Konstantinos
    PROCEEDINGS OF THE 26TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS (ISSTA'17), 2017, : 46 - 56
  • [4] A Primer on Property-Based Testing
    Koparkar, Chaitanya
    XRDS: Crossroads, 2024, 30 (02): : 40 - 41
  • [5] Property-Based Mutation Testing
    Bartocci, Ezio
    Mariani, Leonardo
    Nickovic, Dejan
    Yadav, Drishti
    2023 IEEE CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION, ICST, 2023, : 222 - 233
  • [6] Foundational Property-Based Testing
    Paraskevopoulou, Zoe
    Hritcu, Catalin
    Denes, Maxime
    Lampropoulos, Leonidas
    Pierce, Benjamin C.
    INTERACTIVE THEOREM PROVING, 2015, 9236 : 325 - 343
  • [7] Teaching students Property-based Testing
    Earle, Clara Benac
    Fredlund, Lars-Ake
    Marino, Julio
    Arts, Thomas
    2014 40TH EUROMICRO CONFERENCE SERIES ON SOFTWARE ENGINEERING AND ADVANCED APPLICATIONS (SEAA 2014), 2014, : 437 - 442
  • [8] Property-Based Testing - The ProTest Project
    Derrick, John
    Walkinshaw, Neil
    Arts, Thomas
    Earle, Clara Benac
    Cesarini, Francesco
    Fredlund, Lars-Ake
    Gulias, Victor
    Hughes, John
    Thompson, Simon
    FORMAL METHODS FOR COMPONENTS AND OBJECTS, 2010, 6286 : 250 - +
  • [9] Advances in Property-Based Testing for αProlog
    Cheney, James
    Momigliano, Alberto
    Pessina, Matteo
    TESTS AND PROOFS, TAP 2016, 2016, 9762 : 37 - 56
  • [10] PrologCheck - Property-Based Testing in Prolog
    Amaral, Claudio
    Florido, Mario
    Costa, Vitor Santos
    FUNCTIONAL AND LOGIC PROGRAMMING, FLOPS 2014, 2014, 8475 : 1 - 17