Recall & Review
beginner
What is test parameterization in JUnit?
Test parameterization means running the same test method multiple times with different input values, without writing separate test methods for each case.
Click to reveal answer
beginner
How does parameterization help reduce test duplication?
It allows one test method to cover many input cases, so you don't write many similar tests with only input changes.
Click to reveal answer
beginner
Which JUnit annotation is used for parameterized tests?
The @ParameterizedTest annotation is used to mark a test method as parameterized in JUnit 5.
Click to reveal answer
intermediate
Give a simple example of parameterized test input source in JUnit.
You can use @ValueSource(strings = {"apple", "banana"}) to run the test with "apple" and "banana" as inputs.
Click to reveal answer
beginner
Why is reducing test duplication important?
It makes tests easier to maintain, reduces errors, and saves time when adding or changing test cases.
Click to reveal answer
What does parameterization in JUnit allow you to do?
✗ Incorrect
Parameterization lets you run one test method multiple times with different inputs.
Which annotation marks a parameterized test in JUnit 5?
✗ Incorrect
The @ParameterizedTest annotation is used for parameterized tests.
How does parameterization reduce test duplication?
✗ Incorrect
Using one test method with many inputs avoids writing many similar tests.
Which of these is a valid input source for parameterized tests in JUnit?
✗ Incorrect
@ValueSource is a built-in input source annotation.
What is a key benefit of reducing test duplication?
✗ Incorrect
Less duplication means easier maintenance and fewer errors.
Explain how parameterization in JUnit helps reduce test duplication.
Think about how one test can replace many similar tests.
You got /3 concepts.
Describe the benefits of reducing test duplication in software testing.
Why do testers want to avoid repeating similar tests?
You got /4 concepts.