Trail of Bits has expanded Mewt, their open-source mutation-testing engine, to support DAML — the language used for Canton Network smart contract applications. Mutation testing goes beyond code coverage by deliberately introducing small bugs (mutants) into code and checking whether the test suite catches them. DAML's built-in coverage only reports whether choices were exercised, not whether tests verify outcomes, making it easy to have 100% coverage while missing critical authorization bugs. Mewt adds two DAML-specific mutations targeting authorization primitives: Controller Party Swap (replacing one party in a controller clause) and Controller Party Removal (dropping a party from a multi-party controller list). A worked example shows how a payment contract with full coverage can still allow a seller to release funds without buyer confirmation — a surviving mutant that reveals a missing negative test. The tool uses tree-sitter-haskell grammar to parse DAML, requires only a simple mewt.toml config, and runs against existing test suites. Limitations include equivalent mutants and time cost scaling with suite size, making nightly/weekly cadence more practical than per-commit.

11m read timeFrom blog.trailofbits.com
Post cover image
Table of contents
Why DAML’s coverage reports lieHow mutation testing worksMutation testing forces the unhappy pathWhat Mewt adds for DAMLWhat a surviving mutant looks likeLimitations and what comes nextDive in
305 Impressions