Challenge - 5 Problems
Mutation Testing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
What is the main goal of mutation testing?
Mutation testing is a technique used in software testing. What is its primary purpose?
Attempts:
2 left
💡 Hint
Think about how mutation testing challenges your tests.
✗ Incorrect
Mutation testing introduces small changes to code and checks if tests fail, ensuring tests are effective.
❓ Predict Output
intermediate1:00remaining
What is the mutation score for this test result?
Given a mutation testing run with 100 mutants generated, 80 mutants killed by tests, and 20 mutants survived, what is the mutation score percentage?
Attempts:
2 left
💡 Hint
Mutation score = (killed mutants / total mutants) * 100
✗ Incorrect
Mutation score is the percentage of mutants detected (killed) by tests out of total mutants.
❓ assertion
advanced1:30remaining
Which assertion correctly verifies a mutation testing report's killed mutants count?
You have a variable killedMutants = 45 from a mutation testing report. Which JUnit assertion correctly checks that killedMutants equals 45?
Attempts:
2 left
💡 Hint
Use the assertion that compares expected and actual values directly.
✗ Incorrect
assertEquals(expected, actual) is the standard way to check equality in JUnit.
🔧 Debug
advanced2:00remaining
Why does PIT report 0% mutation coverage despite tests passing?
You run PIT mutation testing on your Java project. All unit tests pass, but PIT reports 0% mutation coverage. What is the most likely cause?
Attempts:
2 left
💡 Hint
Think about what it means if mutants survive despite tests passing.
✗ Incorrect
If tests never run the mutated code, mutants survive and coverage is 0%.
❓ framework
expert2:30remaining
Which PIT configuration option excludes test classes from mutation analysis?
In PIT configuration for a Maven project, which option correctly excludes test classes from mutation testing?
Attempts:
2 left
💡 Hint
Look for the option that excludes classes by pattern.
✗ Incorrect
excludedClasses tells PIT which classes to skip; using **/*Test* excludes test classes.