SMT2Test: From SMT Formulas to Effective Test Cases
Open Access
- 8 October 2024
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 8 (OOPSLA2) , 222-245
Abstract
One of the primary challenges in software testing is generating high-quality test inputs and obtaining corresponding test oracles. This paper introduces a novel methodology to mitigate this challenge in testing program verifiers by employing SMT (Satisfiability Modulo Theories) formulas as a universal test case generator. The key idea is to transform SMT formulas into programs and link the satisfiability of the formulas with the safety property of the programs, allowing the satisfiability of the formulas to act as a test oracle for program verifiers. This method was implemented as a framework named SMT2Test , which enables the transformation of SMT formulas into Dafny and C programs. An intermediate representation was designed to augment the flexibility of this framework, streamlining the transformation for other programming languages and fostering modular transformation strategies. We evaluated the effectiveness of SMT2Test by finding defects in two program verifiers: the Dafny verifier and CPAchecker. Utilizing the SMT2Test framework with the SMT formulas from the SMT competition and SMT solver fuzzers, we discovered and reported a total of 14 previously unknown defects in these program verifiers that were not found by previous methods. After reporting, all of them have been confirmed, and 6 defects have been fixed. These findings show the effectiveness of our method and imply its potential application in testing other programming language infrastructures.Keywords
This publication has 53 references indexed in Scilit:
- Competition on Software Verification and Witness Validation: SV-COMP 20232023
- cvc5: A Versatile and Industrial-Strength SMT Solver2022
- Dione: A Protocol Verification System Built with Dafny for I/O AutomataLecture Notes in Computer Science, 2019
- StringFuzz: A Fuzzer for String Solvers2018
- The SeaHorn Verification Framework2015
- Yices 2.22014
- Boogie: A Modular Reusable Verifier for Object-Oriented Programs2006
- MathSAT: Tight Integration of SAT and Mathematical Decision Procedures2005
- SMT-COMP: Satisfiability Modulo Theories Competition2005
- ANTLR: A predicated‐LL(k) parser generatorSoftware: Practice and Experience, 1995