Formal verification
Using proofs or models to show a program is correct, not just well tested, with tools such as Dafny or Lean.
Formal verification uses proofs or precise models to show that a program meets a specification, not just that it passed a set of examples. Tools in this family include Dafny, Lean, and LemmaScript, along with model checkers for concurrent designs. You write properties that must always hold, and a verifier or a proof assistant checks them.
This is worth the cost when a bug would be severe: a protocol, a compiler pass, a payment invariant, or a tricky concurrent algorithm. It is usually too heavy for everyday interface code. A practical path is to verify a small core, and to keep the rest of the system under tests and property-based testing.
The specification is the hard part. If you cannot state what 'correct' means, the tool cannot help you. Start with one or two invariants, get them to pass on a tiny module, and only then grow the surface. Expect to spend as much time on the proof as on the implementation, at least at first.
When a proof fails, it is often telling you the specification was wrong, not just that the code was wrong. That is a feature. Treat the failed proof as a design review, not only as a red build.