Formal verification
Formal verification uses mathematical checks to establish whether a software design or implementation satisfies a stated property. It has found defects in designs, such as three in DynamoDB’s replication at Amazon Web Services (AWS), and proved implementations match their specifications (Newcombe et al., 2015; Hawblitzel et al., 2015). A proof covers only the specification and assumptions it starts from. The original seL4 kernel proof assumed a correct compiler, assembly code and hardware, and one evaluation found ten specification bugs across six verified systems (Klein et al., 2009; Goldweber et al., 2024). Comparisons with testing are limited: they come from single projects whose phases overlap or whose tools cover different errors (King et al., 2000; Brat et al., 2004b).
What each method can establish
The three main methods differ in what they check: a model of a design, a program against its contract, or a proof of any statement. Formal verification tools compares the tools that implement them. A formal specification, the starting point of each, states requirements in a precise language.
A model checker explores the possible behaviours of a model and reports any that break a property. TLC does this for designs written in the TLA+ language, for both safety (nothing bad happens) and liveness (something good eventually happens). Apalache can search for a bad behaviour up to a chosen number of steps, or check an inductive invariant, which covers runs of any length (Lamport, 2022).
Deductive verification checks the program code itself against a contract. In Dafny, the contract states what must hold before a call, what the call guarantees, what memory it may change, and why it terminates (Leino et al., 2022).
A proof assistant checks a proof of any statement its logic can express. In Lean, tactics help build the proof, and a small core called the kernel checks the result (Lean FRO, n.d.). Type systems covers how such proofs relate to the types of programs.
What a proof depends on
A verified property is only as useful as the specification and the trusted components behind it.
The specification can describe the wrong behaviour, and the proof will still go through. Researchers who checked the specifications of six verified real-world systems found ten specification bugs across them (Goldweber et al., 2024).
Verified systems also trust components they do not check, and later seL4 work moved that boundary rather than removing it. The first seL4 proof reached the C code and trusted the compiler, assembly code and hardware. Later work carried the proof down to the compiled binary on supported configurations. It replaced trust in the compiler with trust in binary loading and a processor model (Klein et al., 2009; Sewell et al., 2013; seL4 Foundation, n.d.; Klein et al., 2014a).
Other verified systems trust their tools in the same way. The IronFleet proofs assumed that Dafny, the .NET compiler and runtime, and Windows behaved correctly (Hawblitzel et al., 2015). Verifying code that uses encryption describes another field where the choice of trusted components sets the scope of a guarantee.
Verification of distributed systems
In a distributed system, separate computers coordinate by exchanging messages, following rules called a protocol.
Checking designs
Model checking a design can find errors that take long sequences of events to reach. At AWS, checking the DynamoDB replication and membership design found three bugs, with traces of up to 35 steps. The engineer who wrote that specification learned TLA+ and wrote it in a couple of weeks (Newcombe et al., 2015). The same report leaves open whether the running code matches the checked design (Newcombe et al., 2015).
A model can also help explain failures in a system already running. A Microsoft team used a model of its service architecture, including CosmosDB, to find an outage’s root cause. It also found problems in CosmosDB’s documentation along the way (Hackett & Kuppe, 2023).
Proofs about protocols and code
An inductive invariant proves a protocol safe for runs of any length. It is a condition that holds at the start and that every allowed step preserves. Padon and colleagues used one to prove the safety of a model of the Paxos protocol (Padon et al., 2017).
A second step, called refinement, carries the guarantee from the protocol to the code: every behaviour of the code must match a behaviour the protocol allows. IronFleet proved this for its implementations, while trusting its top-level specification and main event loop (Hawblitzel et al., 2015).
Safety and progress
Some verified systems prove safety only, and proofs of progress rest on assumptions about the network. A 2016 proof for the Raft protocol strengthened its safety result but left liveness, such as a client eventually getting a reply, for future work (Woos et al., 2016). IronFleet’s IronRSL proved that a repeatedly requesting client eventually gets a reply, under one condition. A live quorum, enough working replicas for the protocol to proceed, must eventually have a synchronous network (Hawblitzel et al., 2015).
Where verified systems still fail Weak evidence: few or small studies support this
In one study of three verified systems, the bugs sat at the edges of the proof, not in the verified protocol. Review and testing of IronFleet, Verdi and Chapar found 16 bugs. They lay in specifications, in the interfaces to other components and in supporting tools, and none was at the protocol level (Fonseca et al., 2017).
Checking running code against a formal model has also found defects. AWS checked its ShardStore storage node against executable reference models and reports that this kept 16 issues out of production. TraceLink compares recorded runs with the formal design and found nine unknown defects in trusted parts of the PGo toolchain (Bornholt et al., 2021; Hackett & Beschastnikh, 2025).
Simulation and fault injection test the real code under failures, within limits of their own. FoundationDB runs its database in a deterministic simulation with random workloads and injected faults, but cannot test third-party code or code outside its Flow language (Zhou et al., 2021). The Molly tool found bugs in seven of 14 fault-tolerance cases, and gave bounded guarantees for the other seven (Alvaro et al., 2015).
Adoption and barriers
Formal verification is used in industry, but the surveys cannot show how widely. A 2007–2008 survey covered 62 projects already known to use formal techniques, so it describes users rather than the industry as a whole. Transport and finance were its largest named domains (Woodcock et al., 2009). In cloud infrastructure, AWS and Microsoft teams have reported using models of distributed designs (Newcombe et al., 2015; Hackett & Kuppe, 2023).
In railways, few published studies document real products. Of 328 studies of formal methods in railways, 5% documented the development of actual railway products (Ferrari & ter Beek, 2022).
Surveys of experts and practitioners name training and fit with existing processes among the main barriers. In a survey of 130 experts, 71.5% chose a lack of training among engineers, and 66.9% chose poor integration into industrial development (Garavel et al., 2020). A survey with 216 responses, at an estimated 1–2% response rate, ranked scalability, skills and education first. Seven practitioners of the Dezyne tool named scalability, ease of use and process integration (Gleirscher & Marmsoler, 2020; Chiari et al., 2025).
Effort and defects found
Effort
Fully verifying a system takes person-years, and the published figures count different work. The seL4 team estimated under 14 person-years for the kernel’s design, development and verification, not counting work on reusable proof tools. IronFleet reported about 3.7 person-years to develop its method and build and verify two systems (Andronick et al., 2012; Hawblitzel et al., 2015).
Proofs must be maintained as the code changes, at a cost that depends on the change. After the seL4 proof was finished, upkeep averaged roughly one full-time person in the period observed (Andronick et al., 2012). One system call extension needed under a quarter of a person-month of proof work, while an extension touching interrupts, page tables and address spaces took 1.5–2 person-years to re-verify (Klein et al., 2014a). The authors of one survey of deployed verification projects say its evidence mostly concerned initial development (Huang et al., 2024c).
Defects found compared with testing Weak evidence: few or small studies support this
In one project, proof and testing found different shares of the faults at different effort. In the SHOLIS project, proving the specification found 16% of recorded faults with 2.5% of the effort, while system validation testing found 21.5% with 9.5%. Its phases overlapped, so the shares do not isolate either technique (King et al., 2000).
In an experiment on a Mars rover prototype, the authors reported strong performance of advanced verification tools on concurrency errors and weak performance of traditional testing. Concurrency errors arise from interactions between tasks. The tools covered different kinds of error, which limits comparisons between them (Brat et al., 2004a; Brat et al., 2004b). Test-driven development covers the evidence on a workflow built around tests.
AI assistance
Language models can produce verified programs and proof hints, with success rates that depend on the task (Misu et al., 2024; Loughridge et al., 2024). A verifier checks the code against its contract, but whether the contract says what the user meant needs a separate check (Leino et al., 2022; Lahiri, 2024).
| Benchmark task | Reported result |
|---|---|
| Generate Dafny solutions for 178 short programming problems | With its best prompt, GPT-4 produced verified, human-reviewed methods for 58% of the problems (Misu et al., 2024). |
| Supply missing verifier hints for existing Dafny programs | The DafnyBench preprint reported a best success rate of 68% (Loughridge et al., 2024). |
| Generate annotations that enable verification of existing programs | DafnyPro with Claude 3.5 Sonnet and a budget of ten attempts verified 86.18% of the DafnyBench programs and 97.76% of the MBPP programs in its evaluation (Banerjee et al., 2026). |
Tests offer one check on whether a generated contract is right. Lahiri compared a measure based on symbolic tests, which represent possible inputs in logic, with human judgments on roughly 150 mostly AI-generated Dafny specifications. Another workflow checked generated preconditions and postconditions with test assertions, and produced correct annotations for 98.2% of 110 tasks within eight repair rounds (Lahiri, 2024; Faria et al., 2026).
Further reading
- (Newcombe et al., 2015). Industrial cases of model checking distributed designs, including DynamoDB.
- (Hawblitzel et al., 2015). Refinement proofs connecting distributed implementations to a protocol layer.
- (Fonseca et al., 2017). A review and testing study of three verified distributed implementations.
- (King et al., 2000). Project records on defect discovery and effort across proof and testing phases.
- (Garavel et al., 2020). An expert survey on the state of formal methods and the barriers to their use.
First published .
Known gaps
What this article cannot tell you yet.
- The effect of verification on production defect rates and lifetime costs remains open for comparable projects.
- Published maintenance estimates cover particular changes or periods, with little evidence on proof upkeep over a system’s lifetime.
- Adoption rates and trends across software teams are uncertain because surveys recruited professionals, specialists or known projects.
- AI benchmarks leave open how well generated specifications capture evolving requirements in deployed software.
References
- Solid source
- Rated highly trustworthy by the research, and every passage taken from it was found in it.
- Weak source
- Rated low, or a passage taken from it was not found in it.
- Medium trust
- Rated medium by the research.
- Not checked
- Rated high, but its passages could not all be checked against it.
Show all 33 references
- Alvaro, P., Rosen, J., & Hellerstein, J. M. (2015). Lineage-driven Fault Injection. Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data. https://people.ucsc.edu/~palvaro/molly.pdf Solid source Peer-reviewed, read in large part.
- Andronick, J., Jeffery, R., Klein, G., Kolanski, R., Staples, M., Zhang, H., et al. (2012). Large-scale formal verification in practice: A process perspective. International Conference on Software Engineering. https://trustworthy.systems/publications/nicta_full_text/5396.pdf Medium trust Peer-reviewed, read in large part.
- Banerjee, D., Bouissou, O., & Zetzsche, S. (2026). DafnyPro: LLM-assisted automated verification for Dafny programs. arXiv. https://arxiv.org/abs/2601.05385 Medium trust Preprint, read in large part.
- Bornholt, J., Joshi, R., Astrauskas, V., Cully, B., Kragl, B., Markle, S., et al. (2021). Using lightweight formal methods to validate a key-value storage node in Amazon S3. ACM SIGOPS 28th Symposium on Operating Systems Principles. https://pm.inf.ethz.ch/publications/BornholtJoshiAstrauskas2021.pdf Medium trust Peer-reviewed, read in large part.
- Brat, G., Drusinsky, D., Giannakopoulou, D., Goldberg, A., Havelund, K., Lowry, M., et al. (2004b). Experimental evaluation of verification and validation tools on Martian rover software (journal version). Formal Methods in System Design. https://www.havelund.com/Publications/k9-exp-fmsdjournal.pdf Medium trust Read in large part.
- Brat, G., Giannakopoulou, D., Goldberg, A., Havelund, K., Lowry, M., Pasareanu, C., et al. (2004a). Experimental evaluation of verification and validation tools on Martian rover software. NASA Technical Reports Server. https://ntrs.nasa.gov/api/citations/20040010327/downloads/20040010327.pdf Medium trust Peer-reviewed, read in large part.
- Chiari, M., Camilli, M., Bersani, M. M., van Beusekom, R., & Tamburri, D. A. (2025). Reality check on formal methods in industry: A study of Verum Dezyne. Journal of Software: Evolution and Process. https://onlinelibrary.wiley.com/doi/10.1002/smr.70069 Solid source Peer-reviewed, read in full.
- Faria, J. P., Trigo, E., Honorato, V., & Abreu, R. (2026). Automatic generation of formal specification and verification annotations using LLMs and test oracles. arXiv. https://arxiv.org/abs/2601.12845 Medium trust Preprint, read in large part.
- Ferrari, A., & ter Beek, M. H. (2022). Formal methods in railways: A systematic mapping study. arXiv. https://arxiv.org/html/2107.05413 Solid source Peer-reviewed, read in full.
- Fonseca, P., Zhang, K., Wang, X., & Krishnamurthy, A. (2017). An empirical study on the correctness of formally verified distributed systems. ACM EuroSys. https://www.cs.purdue.edu/homes/pfonseca/papers/eurosys2017-dsbugs.pdf Medium trust Peer-reviewed, read in large part.
- Garavel, H., ter Beek, M. H., & van de Pol, J. (2020). The 2020 expert survey on formal methods. Formal Methods for Industrial Critical Systems. https://iris.cnr.it/retrieve/b81f2423-58c8-43ca-aa93-0516d1a84fcf/prod_429026-doc_153137.pdf Solid source Peer-reviewed, read in large part.
- Gleirscher, M., & Marmsoler, D. (2020). Formal methods in dependable systems engineering: a survey of professionals from Europe and North America. Empirical Software Engineering. https://d-nb.info/1220500909/34 Solid source Peer-reviewed, read in large part.
- Goldweber, E., Yu, W., Ghahani, S. A. V., & Kapritsos, M. (2024). IronSpec: Increasing the reliability of formal specifications. USENIX Symposium on Operating Systems Design and Implementation. https://www.usenix.org/conference/osdi24/presentation/goldweber Medium trust Peer-reviewed, abstract only.
- Hackett, A. F., & Kuppe, M. A. (2023). Turning an incident report into a design issue with TLA+. USENIX Association. https://www.usenix.org/conference/srecon23americas/presentation/hackett Medium trust Abstract only.
- Hackett, F., & Beschastnikh, I. (2025). TraceLinking implementations with their verified designs. Proceedings of the ACM on Programming Languages. https://www.cs.ubc.ca/~bestchai/papers/oopsla25-trace-link.pdf Medium trust Peer-reviewed, read in large part.
- Hawblitzel, C., Howell, J., Kapritsos, M., Lorch, J. R., Parno, B., Roberts, M. L., et al. (2015). IronFleet: Proving practical distributed systems correct. Symposium on Operating Systems Principles. https://pdos.csail.mit.edu/6.824/papers/ironfleet.pdf Solid source Read in large part.
- Huang, L., Ebersold, S., Kogtenkov, A., Meyer, B., & Liu, Y. (2024c). Lessons from formally verified deployed software systems. Preprint. https://se.inf.ethz.ch/~meyer/publications/proofs/deployed_short.pdf Medium trust Preprint, read in large part.
- King, S., Hammond, J., Chapman, R., & Pryor, A. (2000). Is proof more cost-effective than testing? IEEE Transactions on Software Engineering. https://userweb.cs.txstate.edu/~rp31/papers/KingHammondChapmanPryor.pdf Medium trust Peer-reviewed, read in large part.
- Klein, G., Elphinstone, K., Heiser, G., Andronick, J., Cock, D., Derrin, P., et al. (2009). seL4: Formal verification of an OS kernel. ACM Symposium on Operating Systems Principles. https://isabelle.in.tum.de/~kleing/papers/sosp09.html Medium trust Peer-reviewed, abstract only.
- Klein, G., Andronick, J., Elphinstone, K., Murray, T., Sewell, T., Kolanski, R., et al. (2014a). Comprehensive formal verification of an OS microkernel. ACM Transactions on Computer Systems. https://www.cs.cmu.edu/~15811/papers/seL4-journal.pdf Solid source Peer-reviewed, read in large part.
- Lahiri, S. K. (2024). Evaluating LLM-driven user-intent formalization for verification-aware languages. Formal Methods in Computer-Aided Design. https://www.microsoft.com/en-us/research/publication/evaluating-llm-driven-user-intent-formalization-for-verification-aware-languages/ Solid source Peer-reviewed, abstract only.
- Lamport, L. (2022). TLA+ tools. Leslie Lamport. https://lamport.org/tla/tools.html Solid source Documentation, read in full.
- Lean FRO (n.d.). Tactic proofs. The Lean Language Reference. https://lean-lang.org/doc/reference/latest/Tactic-Proofs/ Solid source Documentation, read in full.
- Leino, K. R. M., Ford, R. L., & Cok, D. R. (2022). Dafny reference manual. Dafny. https://dafny.org/dafny/DafnyRef/out/DafnyRef.pdf Solid source Documentation, read in large part.
- Loughridge, C., Sun, Q., Ahrenbach, S., Cassano, F., Sun, C., Sheng, Y., et al. (2024). DafnyBench: A benchmark for formal software verification. arXiv. https://arxiv.org/abs/2406.08467 Solid source Preprint, read in large part.
- Misu, M. R. H., Lopes, C. V., Ma, I., & Noble, J. (2024). Towards AI-assisted synthesis of verified Dafny methods. Proceedings of the ACM on Software Engineering. https://arxiv.org/abs/2402.00247 Solid source Peer-reviewed, read in large part.
- Newcombe, C., Rath, T., Zhang, F., Munteanu, B., Brooker, M., & Deardeuff, M. (2015). How Amazon Web Services Uses Formal Methods. Communications of the ACM. https://cdn.amazon.science/67/f9/92733d574c11ba1a11bd08bfb8ae/how-amazon-web-services-uses-formal-methods.pdf Weak source Peer-reviewed, read in large part.
- Padon, O., Losa, G., Sagiv, M., & Shoham, S. (2017). Paxos made EPR: Decidable reasoning about distributed protocols. Proceedings of the ACM on Programming Languages. https://www.wisdom.weizmann.ac.il/~padon/paxos-made-epr-oopsla17.pdf Solid source Peer-reviewed, read in large part.
- seL4 Foundation (n.d.). What the proofs assume. seL4. https://sel4.com/Verification/assumptions.html Solid source Documentation, read in full.
- Sewell, T., Myreen, M., & Klein, G. (2013). Translation validation for a verified OS kernel. Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation. https://sel4.org/Research/pdfs/translation-validation-verified-os-kernel.pdf Solid source Peer-reviewed, read in large part.
- Woodcock, J., Larsen, P. G., Bicarregui, J., & Fitzgerald, J. (2009). Formal methods: Practice and experience. ACM Computing Surveys. https://epubs.stfc.ac.uk/manifestation/4234/fmsurvey.pdf Medium trust Preprint, read in large part.
- Woos, D., Wilcox, J. R., Anton, S., Tatlock, Z., Ernst, M. D., & Anderson, T. (2016). Planning for change in a formal verification of the Raft consensus protocol. ACM SIGPLAN Conference on Certified Programs and Proofs. https://jamesrwilcox.com/raft-proof.pdf Solid source Peer-reviewed, read in large part.
- Zhou, J., Xu, M., Shraer, A., Namasivayam, B., Miller, A., Tschannen, E., et al. (2021). FoundationDB: A Distributed Unbundled Transactional Key Value Store. Proceedings of the 2021 International Conference on Management of Data (SIGMOD ’21). https://www.foundationdb.org/files/fdb-paper.pdf Medium trust Peer-reviewed, read in large part.