Mutation Testing
Question
What is mutation testing?
Hint
Mutation testing measures test quality, not code quality.
Explanation
Mutation testing evaluates test quality by making small changes (mutations) to the source code and checking if the test suite catches them. Examples of mutations: change + to -, change > to >=, remove a condition, change true to false. If a mutation is not caught (tests still pass), it is a "survived mutant" — indicating a test gap. Tools: Stryker (JS/TS), PIT (Java), mutmut (Python). Mutation testing is slow (runs tests many times) but provides a true measure of test effectiveness. High mutation score means tests catch real bugs. Use mutation testing to identify weak assertions and untested code paths. Run periodically, not on every commit.
Related Resources
Related Lessons
- Coverage
Learn coverage.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.