Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Trail of Bits 10 min read Release mediumAdept

Mutation testing comes to DAML

Mewt, Trail of Bits' open-source mutation-testing engine, now supports DAML, the smart-contract language for Canton Network, adding controller party swap and controller party removal mutations that target authorization bugs. DAML's built-in coverage only reports whether choices were exercised, so a happy-path test can show 100% coverage while a mutant that drops the buyer from a payment's controller list still passes. Mewt parses DAML via the tree-sitter-haskell grammar with error recovery. On OpenZeppelin's canton-stablecoin it found seven survivors among the highest-priority mutants: four genuine missing tests and three equivalent or unreachable ones. Because each campaign runs the suite once per mutant, nightly or weekly cadence is recommended.

Assumes: unit testingsmart contract basicsDAML templates and choices

Related posts

  • LLMs Are the Key to Mutation Testing and Better Compliance

    Meta Engineering easyNovice

    Meta's Automated Compliance Hardening (ACH) tool uses LLMs to make mutation testing practical at scale. Engineers describe a fault class in plain text, ACH generates realistic mutants that existing tests miss, and it then generates unit tests guaranteed to kill them. An LLM-based equivalence detector filters out unkillable mutants, reaching 0.95 precision and 0.96 recall with simple preprocessing. In a late-2024 privacy-testing trial across Facebook, Instagram, WhatsApp and wearables, engineers accepted 73% of generated tests. Meta also proposes the Catching JiTTest Challenge for generating bug-revealing tests at pull-request time, which runs into the test oracle problem.

  • State divergence enables unauthorized access

    Trail of Bits mediumAdept

    Provenance Blockchain's marker module let any account grant itself ACCESS_ADMIN, mint and withdraw rights on non-fixed-supply markers. The authorization check compared the caller's bank balance to a stale supply field on the marker struct that stays zero, so a caller holding nothing passed via 0 == 0. Two transactions were enough to mint arbitrary tokens or drain escrow, putting 82 mainnet markers and about $500,000 in escrowed nhash at risk. The fix reads live supply from the bank module and adds an explicit zero-supply guard, illustrating that an authorization predicate must never be satisfiable from an attacker's default state.

  • ClickGap: Autonomous QA for ClickHouse

    ClickHouse mediumAdept

    ClickGap is an autonomous QA agent that reviews every pull request merged into ClickHouse, writes and runs tests against real builds, bisects regressions, and files issues and test-only PRs without human sign-off. In five months it filed about 500 issues and 200 coverage PRs, more than half of the issues already closed as completed. Candidate findings must survive an adversarial reviewer and ten gates, eight enforced as plain code, including executed reproducers, valid citations, existing-test searches, mutation kill-tests for coverage claims, and matching against past false positives. Reviews cost a couple of dollars each, smaller models handle recoverable subtasks, and every cost cut must pass a recall benchmark that replays previously confirmed bugs.

  • On the Effectiveness of Mutational Grammar Fuzzing

    Google Project Zero hardMaster

    Coverage-guided mutational grammar fuzzing has two weaknesses. Coverage does not capture dataflow between calls, so a sample that chains document() into generate-id() to hit a libxslt bug looks no more interesting than two unrelated samples. Greedy corpus saving also yields many near-identical samples. A simple fix in Jackalope restarts a worker with an empty corpus every 2T seconds, letting it build an independent corpus for T seconds before syncing with a persistent server and fuzzing the combined corpus. In week-long libxslt experiments, T=3600 found more unique crashes, and found them faster, than uninterrupted default sessions, which varied between 2 and 5 crashes depending on starting conditions. The best T is likely target-dependent.

  • Revolutionizing software testing: Introducing LLM-powered bug catchers

    Meta Engineering easyNovice

    Meta's Automated Compliance Hardening (ACH) combines LLM-based mutant generation with LLM-based test generation. Engineers describe the faults they care about in plain text, such as privacy regressions. ACH generates realistic mutants matching that concern, filters out equivalent mutants, and generates unit tests that are verified to kill those mutants. Unlike coverage-driven test generation, it targets specific fault classes. It has been deployed on Facebook Feed, Instagram, Messenger and WhatsApp, though the post gives no quantitative results and points to the accompanying paper for details.

The quest for software engineering knowledge.

Look:
Layout: