Executable Specs & Diffs
Tests hidden in distant folders drift from implementation. Mo co-locates executable contracts directly inside functions, actors, and services:
examplesverify concrete input/output cases right next to the signature.promiseblocks state universal invariants (implies) over inputs andresult(orbefore/afterstate andnowon actors/services).mo testgenerates typed inputs, shrinks failing counterexamples, and rejects vacuous promises whose antecedent is never true.testblocks run end-to-end workflows, HTTP routes (ApiTest.send), and capability fakes with zero sockets.- Automatic crash-recovery sequences run automatically on every
actorandservice, simulating crashes and restarts to verify persisted state recovers identically.
Mutation Auditing (mo test --mutants)
Section titled “Mutation Auditing (mo test --mutants)”Audit test coverage thoroughness by mutating comparisons, booleans, arithmetic, and constants (E1439 reveals surviving branches).
Structural & Behavioral Diffs (mo diff)
Section titled “Structural & Behavioral Diffs (mo diff)”Compare candidate code against Git HEAD (or an older revision) across four dimensions:
- Capability authority expansions or narrowings
- Exposed and wire API deltas
- Persistent saved-state schema changes
- Behavioral contract checks running the old program’s compiled
promises andexamplesdirectly against the new implementation