The fifty-year quest to prove software can never fail and why the math turned out to be the easy part.
Software bugs cost the United States alone $2.41 trillion per year. The industry tests everything. It cannot prove anything works. And now AI is generating code faster than anyone can check it.
There is a name for the distance between "we tested it" and "it works": the verification gap. It is a mathematical fact, as permanent as any theorem. And it is widening. This is the story of what that gap costs, why it cannot be closed, and the idea born in a free week in Gothenburg that made it a little smaller.
Every time you tap "pay" on your phone, board a plane, or receive a dosage calculated by a hospital system, you are placing trust in software that was tested before it reached you. Testing, it turns out, is not the same as knowing. The computer scientist Edsger Dijkstra put it plainly in 1970: "Program testing can be used to show the presence of bugs, but never to show their absence." The industry heard him, nodded, and kept testing.
The Ariane 5 rocket exploded 37 seconds after launch in 1996 because of an integer overflow in code reused from its predecessor without validation against the new vehicle's higher velocity. The Therac-25 radiation therapy machine killed at least three patients by delivering doses roughly 100 times the intended level due to a race condition triggered only when an operator typed too quickly. The 737 MAX MCAS software contributed to two crashes and 346 deaths between 2018 and 2019. Boeing's direct disclosed costs exceed $20 billion. None of these programs went untested. All of them failed anyway.
The uncomfortable truth is that testing a program is fundamentally different from knowing a program works. No matter how many tests you run, you cannot test every possible situation. And the situation that breaks everything is almost always one you never thought to try. The verification gap is not an engineering problem waiting to be solved. It is a mathematical fact, as permanent as any theorem.
The Consortium for Information and Software Quality placed the US cost of poor software quality at $2.41 trillion in 2022, a figure that has grown 40-fold from the foundational 2002 NIST estimate. The IBM 2024 Cost of a Data Breach Report found the global average breach now costs a record $4.88 million, with healthcare breaches averaging $9.77 million for the fourteenth consecutive year. A Cambridge University study found developers spend roughly 50 percent of their time finding and fixing bugs, at a global cost of $312 billion per year.
The individual cases make the aggregate concrete. In July 2024, a single faulty CrowdStrike update blue-screened 8.5 million Windows devices, costing Fortune 500 companies an estimated $5.4 billion. Only 10 to 20 percent was insured. In 2012, Knight Capital Group lost $440 million in 45 minutes when a deployment error activated dormant trading code from 2003. The firm was acquired within months.
The verification gap is a mathematical structure, not an engineering failure. Karl Popper identified it in 1934 writing about science: no finite set of confirming observations proves a universal theory. One black swan and the theory is done. A passing test tells you the program worked on that input. Passing a million tests tells you only that the program survived a million attempts to find a problem, not that no problem exists.
The bugs that survive are almost never in the cases engineers checked. They live in the cases nobody imagined: unusual input combinations, sequences only triggered under specific conditions, interactions between features written by different teams and never tested together. A test suite that passes feels like safety. But the safety it provides is exactly as good as the imagination of the people who wrote the tests.
If testing cannot prove absence of bugs, perhaps mathematics can. C.A.R. Hoare took the first serious step in 1969, developing a notation for reasoning about programs the way mathematicians reason about equations. If you can prove that specific conditions hold before and after every statement in a program, the program is correct. Not probably correct. Correct.
The seL4 kernel proof, completed in 2009, remains the most celebrated formal verification project in history. The cost: 200,000 lines of proof to verify 8,700 lines of C, consuming 20 person-years. The formally verified CompCert C compiler produced zero wrong-code errors in every test that found bugs in all competing compilers. These are islands of mathematical certainty. The Linux kernel contains more than 25 million lines. Formal verification works. The scale at which software operates places it out of reach for nearly everything.
There is also a subtler problem. Formal verification proves that a program matches its specification. Specifications are written by humans. A perfectly verified program built on a flawed specification still does the wrong thing. This is not a theoretical concern. It is what happened at Volvo.
John Hughes was not thinking about any of this in autumn 1998. He had a free week after a grant ended and decided to build something he found interesting. Hughes was a professor at Chalmers University of Technology in Gothenburg, a specialist in functional programming who had done his doctorate under Tony Hoare himself. His PhD student Koen Claessen saw what he was working on and had a better idea. By the end of the week they had a first version of QuickCheck.
The paper was rejected from the first conference they submitted it to. One reviewer cited an apparently similar tool in Emacs Lisp, a reference neither researcher has ever been able to locate. They resubmitted to the International Conference on Functional Programming in 2000 and it was accepted. The library was 300 lines of Haskell. It won the ACM SIGPLAN Most Influential Paper award in 2010 and was reimplemented in 57 variants across 36 programming languages by 2019. None of that was in anyone's mind that week. Hughes wanted to have fun.
The idea they stumbled onto was neither testing nor proof. It borrowed the honesty of proof and the practicality of testing, starting from a question that seems almost too simple. What if, instead of checking specific examples, you described the rules?
A conventional test asks what should happen with this specific input. A property asks what should always be true, no matter the input. For a sorting function, three properties define correctness for every possible list: the output has the same length as the input, every element in the output appears in the input, and each element is less than or equal to the next. These statements are true for every possible list, not just the ones an engineer thought to check.
Once you have written those properties, QuickCheck generates hundreds of random inputs and checks whether each holds. The randomness is adversarial. It is trying to find an input that breaks the stated rule. And if it finds one, it does not merely report the failure. It shrinks it.
When QuickCheck finds a failing input it is usually large and complex. Shrinking systematically reduces it to the smallest, simplest input that still triggers the same failure: remove an element, simplify a value, shorten a sequence, check whether the failure persists, repeat. At Ericsson, the initial failing case was a sequence of 50 network operations. After shrinking: two operations. A specific action followed by a specific second action, and the base station went down every time. That two-step sequence was not just a smaller bug report. It was an explanation. A 2025 study from UC San Diego found each property-based test catches approximately 50 times as many mutations as the average unit test. Finding bugs is useful. Understanding bugs is transformative.
Hughes and Thomas Arts co-founded Quviq in 2006. Testing a 150,000-line Ericsson media proxy nearly ready for release, QuickCheck found bugs on the first day and five more over six days of property specification. The more striking discovery came at Volvo Cars. Quviq translated portions of AUTOSAR, the automotive software standard spanning thousands of pages reviewed by hundreds of expert engineers, into QuickCheck properties and tested one million lines of C across six suppliers. They found more than 200 problems. Over half were not bugs in any implementation. They were contradictions in the AUTOSAR standard itself. Three of the six official AUTOSAR test cases were wrong. Not the implementations. The standard. The effort required five to eight times less work than conventional manual testing. Writing a property is not a translation exercise. It is a comprehension test. If you cannot state precisely what should always be true, you do not fully understand what you are trying to build.
Code production is accelerating faster than verification can follow. AI tools now generate nearly half of all code written at some organizations, while formal verification remains confined to well under 1% of the world's software.
The verification gap would be serious enough if code volume were stable. It is not. GitHub Copilot now has 20 million users, with active users having 46 percent of their code generated by AI. Sundar Pichai disclosed in April 2025 that over 30 percent of Google's new code is AI-written. Cursor reached $2 billion in annualized revenue by February 2026, the fastest-growing SaaS company in history. Code is being produced at a rate the world has never seen.
The quality evidence is troubling. The CodeRabbit December 2025 analysis found AI-generated code contains 1.7 times more issues than human-written code, with logic errors up 75 percent and certain vulnerability classes nearly three times more likely. A Stanford study found developers using AI produced more security vulnerabilities than a control group while being more confident their code was secure. The METR randomized controlled trial in July 2025 found experienced developers took 19 percent longer with AI tools than without them, despite predicting a 24 percent speedup. GitClear found code duplication rising eightfold from 2020 to 2024. The denominator is exploding. The numerator is not keeping up.
The Basho Technologies case made property-based testing's advantage quantifiable: their Poolboy library had 85 percent test coverage. When Quviq applied QuickCheck, they found at least five bugs. The engineer's note afterward: "At no point did any of the original unit tests fail." Coverage measures which lines were executed. It says nothing about whether those lines were tested with inputs capable of revealing failure. Amazon reported that TLA+, a related technique for verifying distributed system designs, found bugs requiring error sequences of more than 35 steps, sequences no conventional testing would have constructed. The Hypothesis library for Python now sees over 4 million downloads per week. The Jane Street ICSE 2024 study found property-based testing embedded in daily code review and design discussion, not just automated test suites.
The verification gap is still there. It will always be there. Software will continue to fail in ways that surprise people who tested it carefully, because careful testing of examples cannot cover infinite space. That is not a counsel of despair. It is a map of the territory. Hughes, reflecting on what he and Claessen built in that week in Gothenburg, said: "Making testing fun is perhaps one of the most important contributions." The grand failures of both formal verification and exhaustive testing are ultimately motivational. Verification is too expensive. Testing is too tedious. What QuickCheck found was the middle path, demanding enough to force genuine clarity of thought and tractable enough to actually do. The goal was never certainty. The goal was to have failed to find the problem as hard as you possibly could, and to know exactly what you tried.
CISQ, "Cost of Poor Software Quality in the US: A 2022 Report" (Krasner, co-sponsored Synopsys) · IBM/Ponemon, "Cost of a Data Breach Report 2024" · Parametrix, CrowdStrike Fortune 500 loss estimate (July 2024) · Claessen & Hughes, "QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs" (ICFP 2000) · Klein et al., "seL4: Formal Verification of an OS Kernel" (SOSP 2009) · Newcombe et al., "How Amazon Web Services Uses Formal Methods" (CACM 2015) · Goldstein et al., "Property-Based Testing in Practice" (ICSE 2024, ACM SIGSOFT Distinguished Paper) · Coblenz et al., "An Empirical Evaluation of Property-Based Testing in Python" (OOPSLA 2025) · CodeRabbit, "State of AI vs Human Code Generation" (December 2025) · METR, "Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity" (July 2025) · GitClear, "AI Copilot Code Quality: 2025 Data" · MacIver, "Hypothesis: A new approach to property-based testing" (JOSS 2019).
Daice Labs Inc.
Brookline, MA, USA
Roll the "daice"–exploration & programmable adaptation.