More The Pragmatic Engineer episodes

Formal methods with Hillel Wayne thumbnail

Formal methods with Hillel Wayne

Published 29 Jul 2026

Duration: 01:23:42

"Formal verification methods, like TLA+ in AWS's DynamoDB, ensure AI-generated code correctness, with property-based testing offering a practical middle ground; the discussion affirms software engineering as a legitimate discipline, balancing traditional principles with rapid iteration and open-source culture, while exploring AI's future impact on development and job markets."

Episode Description

Brought to You By:* Antithesis - verify your system's correctness without human review or traditional integration tests - and avoid bugs or outages.*...

Overview

The podcast discusses the application of formal methods in software engineering, particularly in verifying the correctness of AI-generated code and distributed systems. Tools like TLA+ and Alloy are highlighted for their ability to model system behavior, uncover race conditions, and detect complex bugs - such as TOCTOU (time-of-check to time-of-use) errors - through exhaustive state exploration. Real-world examples include Amazon's use of TLA+ to find critical bugs in DynamoDB and S3, demonstrating how formal verification can catch issues that are impractical for humans to identify manually due to the vast number of possible state transitions.

The discussion also explores the distinction between software and traditional engineering disciplines, with findings suggesting software engineering aligns more closely with established engineering practices than commonly assumed. Lightweight formal methods, property-based testing, and deterministic simulation testing are presented as practical middle grounds between full formal verification and conventional testing. The podcast further examines how AI impacts software development, noting its potential to assist in specification and verification - but emphasizing that human expertise remains essential, especially in defining system properties and interpreting results. Additionally, topics like version control, open-source culture, and the democratization of software development through AI and low-code tools are discussed as unique characteristics shaping the field's evolution.

What If

  • What if you applied lightweight formal methods to your core AI-generated code today?

    • Move: Select one critical module (e.g., auth or state transition logic) in your solo project and write 3 - 5 precise properties using simple assertions or comments. Use property-based testing (e.g., FastCheck, Hypothesis, or even handwritten random input tests) to validate it weekly.
    • Why Now?: AI is accelerating code output, increasing hidden bugs in logic - especially in race conditions and edge cases - but remains poor at generating correct specifications. Catching flaws now builds long-term resilience.
    • Expected Upside: Reduce high-cost bugs in production by up to 50% over six months while creating reusable test suites that future-proof upgrades and AI refactors.
  • What if you modeled your system's key state transitions like a distributed engineer - even if you're solo?

    • Move: Use a lightweight model checker (e.g., Alloy or Quint) to map out a core data flow (e.g., user permissions, order lifecycle) with invariants. Run it monthly or after major changes to detect invalid states (e.g., double spending, access leaks).
    • Why Now?: Tools like TLA+ and Alloy have inspired simpler, faster successors (Quint, P) that are now accessible to solo devs - and concurrency bugs in scaling apps are rising with AI-assisted complexity.
    • Expected Upside: Surface deep logic flaws before implementation; cut debugging time by 60%+ when issues arise, and gain confidence in system integrity during rapid iteration.
  • What if you treated version control not just as backup - but as engineering leverage?

    • Move: Enforce atomic, specification-linked commits in your workflow (e.g., each commit message references a property, invariant, or model outcome). Automate changelog diffs based on commit structure for stakeholders or future audits.
    • Why Now?: Physical engineers envy this capability - yet most software developers underuse it. With increased AI involvement and teamless development, traceability is becoming a competitive edge.
    • Expected Upside: Accelerate future refactors and onboarding (even for yourself post-sabbatical), while creating implicit documentation that aligns code with intent - turning version history into a design asset.

Takeaway

  • Apply lightweight formal methods like Deterministic Simulation Testing (DST) to verify critical components of your system by injecting faults and observing behavior across multiple simulated runs.
  • Use property-based testing in your development workflow to generate random inputs and validate core properties of functions, improving robustness beyond traditional example-based tests.
  • Study and apply findings from Engineering a Safer World by Nancy Leveson to proactively identify failure modes in your software systems, especially for safety- or correctness-critical applications.
  • Invest time in learning formal logic and discrete math (e.g., boolean logic, set theory) to improve reasoning about complex systems, particularly around concurrency and edge cases.
  • Experiment with TLA+ or Alloy to model and verify small, high-risk parts of your system - such as authorization flows or state transitions - before implementation to catch design-level bugs early.

Recent Episodes of The Pragmatic Engineer

17 Sept 2026 AI Skills with Matt Pocock

"Former voice coach turned developer shares insights on AI integration in software engineering, emphasizing fundamentals, adaptability, and structured workflows for productivity."

9 Sept 2026 Building Codex with Tibo Sottiaux

"Explores Codex's AI-powered coding assistant development, Rust's role, open-source benefits, AI's impact on software workflows, and the future of AI-assisted problem-solving."

More The Pragmatic Engineer episodes