projects/lethal
active lethal order 2.5

LethAL Mutation Testing for AL

Mutation testing for Business Central: breaks your AL code on purpose, one mutant at a time, and finds the tests that pass without proving anything. One compile for the whole run.

Stack
TypeScript · Bun
Status
Active
Released
2026
License
MIT

Overview

LethAL tests your tests. It breaks your AL code in small deliberate ways (flip a boundary, remove a SetRange, drop a CalcFields, turn Modify(true) into Modify(false)) and runs your suite against every broken copy. A mutant your tests catch is killed. One they miss survived, and every survivor marks a line where a real bug would ship straight past your suite.

Mutation testing never existed in AL because the naive loop is compile, publish, test, repeat, for every single mutant. A few hundred mutants at BC deploy speeds is a long weekend. LethAL compiles once: every mutant ships inside the same build, and switching to the next one is a table write, not a recompile. The bundled credit limit demo scores 32 mutants in 16 seconds, publish and baseline included.

It is also built to be driven by agents. Reports and progress streams are JSON with published schemas, doctor --json names exactly which pre-flight check failed, exit codes say whether a result is usable, and if LethAL cannot prove the server was in a sane state, it quarantines the run instead of reporting it. Every survivor is a small, provable task: write the missing test, rerun, watch the verdict flip. Pre-alpha, sandbox and dev containers only.

Highlights

All mutants ship in one build; activating one is a table write
Demo app: 32 mutants scored in 16 seconds on a BC container
Two operator tiers, from boundary flips to remove-SetRange and remove-CalcFields
Per-mutant verdicts with execution proof and the covering tests
explain ranks survivors by the evidence each carries
doctor pre-flight checks; quarantines runs it cannot vouch for

Related writing

01