一句话:提出将 SMT 公式转换为程序、以可满足性作为测试预言来测试程序验证器的方法与框架。
软件测试的核心挑战之一是生成高质量输入并获取测试预言。本文提出面向程序验证器测试的新方法:将 SMT 公式作为通用测试用例生成器,把公式转换为程序,并令公式可满足性对应程序安全性质,从而以可满足性充当测试预言。作者实现了 SMT2Test,并设计中间表示以提升扩展性与模块化转换能力,目前支持转换为 Dafny 和 C 程序。评估使用 SMT 竞赛及 SMT 求解器 fuzzer 产生的公式测试 Dafny verifier 与 CPAchecker,发现并报告 14 个此前未知缺陷;它们均获确认,其中 6 个已修复。结果表明该方法有效,并有望用于测试其他编程语言基础设施。
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.