0
0
JUnittesting~5 mins

Mutation testing concept (PIT) in JUnit - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is mutation testing?
Mutation testing is a way to check how good your tests are by making small changes (mutations) to your code and seeing if the tests catch those changes.
Click to reveal answer
beginner
What does PIT stand for in mutation testing?
PIT stands for "PIT" or "Pitest", a popular mutation testing tool for Java that works well with JUnit tests.
Click to reveal answer
intermediate
How does PIT help improve test quality?
PIT changes parts of your code and runs tests to see if tests fail. If tests don't fail, it means tests might miss bugs, so you can improve them.
Click to reveal answer
beginner
What is a 'mutant' in mutation testing?
A mutant is a version of your code with a small change introduced by the mutation testing tool to check if tests detect it.
Click to reveal answer
intermediate
What does it mean if a mutant survives in PIT testing?
If a mutant survives, it means the tests did not catch the change, showing a possible weakness in your test coverage.
Click to reveal answer
What is the main goal of mutation testing?
ATo check if tests can find small code changes
BTo speed up test execution
CTo write new features automatically
DTo remove bugs from production code
In PIT, what is a 'mutant'?
AA test case
BA bug report
CA changed version of the code
DA test runner
If a mutant survives, what does it mean?
ATests caught the change
BTests ran faster
CCode is error-free
DTests missed the change
Which tool is commonly used for mutation testing in Java with JUnit?
APIT
BJUnit5
CSelenium
DMockito
What should you do if mutation testing shows many surviving mutants?
AIgnore them
BWrite better tests to catch those mutants
CDelete the code
DRun tests less often
Explain how mutation testing with PIT helps improve your test suite.
Think about how changing code and checking tests can show test quality.
You got /4 concepts.
    Describe what a 'mutant' is and what it means when it survives mutation testing.
    Focus on the mutant concept and test detection.
    You got /4 concepts.