How would you introduce mutation testing without making CI prohibitively slow?
Answer
Start with high-risk domain code and changed files, exclude generated or trivial code, and establish a baseline before adding a ratcheting threshold. Run a focused mutation set on pull requests and a broader scheduled job, cache or reuse coverage where supported, and review surviving mutants for missing assertions rather than chasing a score mechanically.
Strong answer includes
- uses risk and change scope to control cost
- separates pull-request feedback from scheduled depth
- reviews surviving mutants instead of gaming the metric
Practical example
A team runs Stryker only against files touched in a pull request's diff with a 15-minute cap, then triggers a full-repo mutation run nightly on a schedule, catching a surviving mutant in the pricing module's rounding logic that the fast PR-scoped run would have missed because that file hadn't changed recently.