Testing interview question
What is mutation testing, and what does it tell you that code coverage doesn't?
Comparison Asked in Backend Engineer · QA Engineer / SDET · Frontend Engineer · Full Stack Engineer interviews
Summary
Mutation testing makes small changes to the code (flip a condition, change a constant) and runs the tests; if the tests still pass, the "mutant survived", meaning the tests don't check that behaviour. Coverage only says code ran during tests; mutation score says the tests would notice if it were wrong.
Keep reading with a membership
The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.
More Testing questions
- What makes a good unit test?
- How do you write reliable integration tests that use a database?
- What is the test pyramid, and is it still relevant?
- Your end-to-end test suite is flaky and takes an hour. How do you fix it?
- How would you design a test strategy for a new web application?
- What's the difference between mocks, stubs, fakes and spies?
- Write a Playwright test that logs in and checks the dashboard, and explain how you keep it stable.
- What causes flaky tests and how do you fix them?