Formal Verification Is No Silver Bullet
We all know that there is no silver bullet. Formal verification is not one either.
It catches bugs, a lot of them, but it won’t magically make your system bulletproof. It is one more layer in your testing suite to ensure your system behaves correctly.
While the code you write defines HOW the system is implemented, the formal specs define HOW the system should behave. By exploring all the possible states, or by checking them symbolically over logical formulas, you get a solid understanding of how the system should behave.
So I feel that reading formal specs not only increases your confidence in the system’s behavior, it also improves your understanding of the system.
There are a few issues with using formal verification:
- The toolchain is relatively small compared to other testing frameworks.
- Keeping the code conformant to the model was a big burden before the AI era. AI agents have made it easy to produce a model along with the code, but the conformance isn’t always a 100% match.
- The extra computation adds up to your test suite’s execution time. This can slow down your feedback loop while you change things.
What I’ve been trying to do recently is make the ecosystem slightly better:
- Manyan is a super small binary that checks TLA+ at blazingly fast speed.
- Temporal Typing lets you define system behaviors via Python annotations. You don’t need to learn the awkward TLA+ syntax, and you can keep the TLA+ semantics in one place with your implementation logic.
- Tanny is a static model checker for Temporal Typing.