Learn vocabulary for mutation testing: mutants, mutation score, and test suite quality.
0 / 10 completed
1 / 10
What is a 'mutant' in mutation testing?
A mutant is a copy of the source code with a small, deliberate change (mutation). If no test fails when running against the mutant, the mutation 'survived' — indicating a gap in the test suite.
2 / 10
What does it mean when a mutant is 'killed'?
A mutant is 'killed' when at least one test fails in response to the mutation — the test suite detected the incorrect behaviour. Killed mutants = tests are effective.
3 / 10
What is 'mutation score'?
Mutation score = (killed mutants / total mutants) × 100. A score of 80% means the test suite detected 80% of all introduced mutations. Higher is better.
4 / 10
What is an 'equivalent mutant' in mutation testing?
An equivalent mutant produces identical observable behaviour to the original code (e.g., changing i++ to i+=1 in most contexts). These cannot be killed and must be identified and excluded from scoring.
5 / 10
Which tool is commonly used for mutation testing in Java?
PITest (PIT) is the most widely used mutation testing tool for Java. It integrates with Maven/Gradle and generates HTML reports showing which mutants were killed or survived.
6 / 10
Code Review Comment: 'This commit introduces a mutation that bypasses the null check. The mutant's impact is minimal, but I'd like to see an assertion added to explicitly handle this edge case.' What does the reviewer likely mean by 'bypass'?
The reviewer is using 'bypass' to describe how the mutant code successfully exploited a flaw in the original code's design – namely, the lack of an explicit null check. This signifies that the mutant was able to execute despite a condition that should have prevented it, indicating a weakness in the initial implementation. Option A is incorrect as it describes correct behavior; options C and D are too strong interpretations.
7 / 10
Slack Message: 'Hey @john_doe, I'm seeing a high mutation score on the new payment service. It looks like some mutants are 'killing' nearly every test case. We need to investigate why our tests aren't catching these changes.' What does 'killing' refer to in this context?
In mutation testing terminology, 'killing' a mutant means that the mutant code successfully altered the original code in such a way that it caused one or more of the existing test cases to fail. This demonstrates the effectiveness of the mutant – it highlighted a flaw that wasn't previously detected by the tests. Options A and D are incorrect; option C misinterprets the context.
8 / 10
PR Description: 'This PR implements a new caching layer to improve performance. The mutation score remains elevated (75%) after applying these changes. We're continuing to explore more aggressive mutants to further refine the test suite.' What does a 'high' mutation score in this context suggest about the code?
A high mutation score, particularly one above 50%, indicates that the mutant code is effectively 'killing' existing tests by introducing subtle changes that reveal previously undetected flaws in the original codebase. This suggests that the original code had vulnerabilities or areas where the test suite was incomplete, and the mutants are highlighting these weaknesses.
9 / 10
Standup Update: 'I've been running mutation testing on the new user authentication module. We're seeing a lot of 'equivalent mutants' – mutations that result in identical test outcomes after repair. This suggests we need to broaden our mutant strategy.' What does 'equivalent mutant' mean in this scenario?
An 'equivalent mutant' is a mutation that, after being 'killed' (i.e., repaired), produces the same outcome as the original code. This means that the mutant was able to alter the code in such a way that it didn't actually change the functionality – essentially, it was a redundant or meaningless change. The high number of equivalent mutants signals that the tests aren't adequately challenging the code.
10 / 10
API Response (Mutation Testing Tool): `{"mutation_score": 0.85, "mutant_count": 23, "equivalent_mutant_count": 7}`. What does the 'mutant_count' value represent in this API response?
The 'mutant_count' represents the *number* of distinct mutation tests generated by the mutation testing tool. These are the individual changes introduced into the original code to assess its robustness. It's not measuring failures or averages; it's simply counting the number of different mutant examples explored.
What will I learn from the "Mutation Testing — Vocabulary and Language" exercise?
Learn vocabulary for mutation testing: mutants, mutation score, and test suite quality.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall required.
How many questions are in this exercise?
This set contains 10 multiple-choice questions, each with a detailed explanation shown after you answer.
Do I need to create an account to track my progress?
No account is required. Your progress bar and score reset each time you reload the page, but you can retry the exercise as many times as you like.
Who is this TDD/BDD Language exercise for?
This exercise is built for IT professionals and non-native English speakers who need to read, write, and discuss tdd/bdd language topics confidently at work.
What happens if I answer a question incorrectly?
You will see the correct answer highlighted along with a detailed explanation of why it is correct -- so every wrong answer becomes a learning moment, not just a lost point.
Can I retry this exercise?
Yes -- click "Try again" on the results screen at any time to reset your score and go through all the questions again.
How long does this exercise take to complete?
Most learners finish all 10 questions in under 10 minutes, since each question is answered by clicking a single option.
Where can I find more TDD/BDD Language exercises?
See the full TDD/BDD Language exercises hub for more vocabulary drills on this topic.
Is this exercise mobile-friendly?
Yes -- the exercise works on any device with a modern browser, including phones and tablets, with no app download required.