arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.16239cs.SE
收藏

将测试与证明结合以提升软件验证

Combining Tests and Proofs for Better Software Verification

Constructor University Bremen(不来梅构造大学);Eiffel Software(艾菲尔软件);Constructor University(构造大学)

Li Huang, Bertrand Meyer, Manuel Oriol

AI总结:

通过结合测试与证明技术,利用设计契约和反例生成,提升软件验证的质量与效率。

摘要:

测试或证明?这两种软件验证方法长期以来被视为对立面。一种是动态的,另一种是静态的:测试执行程序,证明只分析程序文本。一种新的视角正在出现,即测试和证明是互补而非竞争的技术,用于产生经过验证的高质量软件。过去几年进行的工作,经过此处回顾,通过利用Eiffel中的设计契约,以及现代基于“可满足性模理论”(SMT)的程序证明工具的特性——反例生成——来发展这种互补性。反例是一种使程序失败的输入组合。如果我们试图证明程序的正确性,我们希望找不到任何反例。然而,可以将反例生成应用于错误的程序,作为自动测试生成的工具。我们也可以在正确的程序中引入故障,并将反例转换为自动生成功能测试套件,具有完整的覆盖。此外,我们还可以利用这些机制帮助生成错误程序的修复,保证修复是正确的。这三种应用,利用Eiffel和设计契约的机制,有潜力解决程序测试、软件维护和自动程序修复的一些挑战。

英文摘要:

Test or prove? These two approaches to software verification have long been presented as opposites. One is dynamic, the other static: a test executes the program, a proof only analyzes the program text. A different perspective is emerging, in which testing and proving are complementary rather than competing techniques for producing software of verified quality. Work performed over the past few years and reviewed here develops this complementarity by taking advantage of Design by Contract, as available in Eiffel, and exploiting a feature of modern program-proving tools based on ``Satisfiability Modulo Theories'' (SMT): counterexample generation. A counterexample is an input combination that makes the program fail. If we are trying to prove a program correct, we hope not to find any. One can, however, apply counterexample generation to incorrect programs, as a tool for automatic test generation. We can also introduce faults into a correct program and turn the counterexamples into an automatically generated regression test suite with full coverage. Additionally, we can use these mechanisms to help produce program fixes for incorrect programs, with a guarantee that the fixes are correct. All three applications, leveraging on the mechanisms of Eiffel and Design by Contract, hold significant promise to address some of the challenges of program testing, software maintenance and Automatic Program Repair.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑