liveBook · Manning

Formal verification

As explained in Vibe Engineering

The use of mathematical specifications and proofs to establish that software satisfies required properties for all permitted cases.

Formal verification proves that software satisfies a formal specification for every permitted execution, rather than sampling behavior through tests. It offers mathematical certainty, but requires specifications, proof annotations, and sustained maintenance. section 8.6.4 section 8.6

Use formal verification when the cost of undetected failure justifies its high engineering cost:

  • Specify distributed-system behavior and exhaustively check executions with TLA+. section 8.6.4
  • Attach preconditions, postconditions, and invariants to code and have Dafny prove the implementation meets them. section 8.6.4
  • Consider it for security-critical code, financial systems, smart contracts, parsers, state machines, protocols, or regulated domains. section 8.6 section 8.6.5

AI-assisted verification

An annotation tool can suggest specifications, loop invariants, and intermediate assertions from code; the verifier still checks the result. Human review must confirm that the generated specification captures the intended behavior, because plausible annotations can be incomplete or wrong. section 8.6.4

How Vibe Engineering covers it

How deep it goes
Explains exhaustive checking, program annotations, costs, and maintenance risks, but stops short of a procedural verification manual.
Examples
Uses distributed systems, parsers, sanitization properties, security code, financial systems, smart contracts, and AI-generated annotations.
What it assumes
Assumes code and requirements to formalize, while introducing specifications, preconditions, postconditions, invariants, and proof obligations.
What you can do after
Evaluate verification investment and apply TLA+ or Dafny when failure costs exceed the cost of specifications and proofs.
How it connects
Connects formal verification with formal specifications, proofs, invariants, TLA+, Dafny, testing, fuzzing, and property-based testing.

Also explained in

Compare how 3 books explain formal verification →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.