Skip to content
Review

Combining Tests and Proofs with Contracts for Better Software Verification

Aug 2026 · Communications of the ACM · Vol 69, pp. 76 - 85 · 0 citations · 38 references

TL;DR

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.

Abstract

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. Moving past the traditional opposition between tests and proofs, current work on software verification treats them as complementary.

View source

Similar papers

#software testing Book Open access Oct 2026

CoVerif: An Automated Contract Verifier for Java using Symbolic Execution

Specifying contracts as program behavior using Hoare triples is an established practice in software engineering. Compared to traditional testing approaches, formal verification of these contracts provides stronger guarantees of functional correctness. However, its practical adoption has remained limited since significa...

Aryan Kumar, Alex Toppo, Sandip Ghosal · 0 citations
Open access Oct 2026

STARS: Static Analysis-Guided Assertion Synthesis using Large Language Models

Automated unit test generation promises to reduce the cost of software quality assurance, and hence, is attracting attention from both academia and industry. Yet, generating assertions that are executable, meaningful to developers, and able to catch faults remains an unsolved challenge. Existing approaches either rando...

Jia-Lun Cao, Hao-Yu Wang, Hao-Ran Yan et al. · 0 citations
Open access Aug 2026

QuickChecking Convergence of Rewriting Systems (Functional Pearl)

A QuickCheck testing method based on generating and shrinking random execution traces based on checking if the first and last terms of a generated trace share the same deterministic normal form that efficiently finds counterexamples and enables fast, robust shrinking.

Koen Claessen · 0 citations
#artificial intelligence Preprint Oct 2026

Cost-Efficient Theorem Proving via Agent Orchestration in Program Verification

Program verification establishes software correctness through machine-checkable proofs constructed in theorem provers. It's a guarantee especially valuable for code generated by large language models (LLMs), which is fluent but carries no assurance of correctness. Almost all existing provers, however, pursue pass rates...

Shuang-Jie Yao, Nikolaus Holzer, Mark Santolucito et al. · 0 citations
Preprint Sep 2026

Synthesizing Proofs Using Proof Sharding and Exploration

Distributed systems are hard to implement correctly, and subtle bugs can go undetected using traditional testing. Formal verification offers an alternative for proving the correctness of complex distributed systems. Despite previous efforts to automate and facilitate formal verification, it is still hard to integrate f...

Seyed Armin Vakil Ghahani, M. Kapritsos · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.