Recall & Review
beginner
What does test coverage measure in software testing?
Test coverage measures how much of the code is executed by the tests. It shows which parts of the code have been tested and which parts have not.
Click to reveal answer
beginner
Why is high test coverage important?
High test coverage means more code is tested, reducing the chance of bugs hiding in untested parts. It helps ensure the software works as expected.
Click to reveal answer
intermediate
What is a limitation of relying only on test coverage?
Test coverage shows which code runs but not if the tests check the right results. So, high coverage doesn’t always mean good tests.
Click to reveal answer
beginner
How can JUnit help measure test coverage?
JUnit runs tests and can be combined with tools like JaCoCo to report which code lines were executed during tests, showing coverage percentage.
Click to reveal answer
intermediate
What does 100% test coverage mean?
It means every line of code was executed by tests at least once. But it doesn’t guarantee all bugs are found or all scenarios tested.
Click to reveal answer
What does test coverage primarily measure?
✗ Incorrect
Test coverage measures the amount of code executed during testing, not bugs found or speed.
Which tool can be used with JUnit to measure coverage?
✗ Incorrect
JaCoCo is a popular tool to measure code coverage with JUnit tests.
Does 100% test coverage guarantee bug-free software?
✗ Incorrect
100% coverage means all code ran, but tests might not check correct behavior or all cases.
Why might test coverage be low?
✗ Incorrect
Low coverage happens when some code lines are never executed by tests.
What is a good practice when using coverage metrics?
✗ Incorrect
Coverage should be combined with assertions and other testing methods for best results.
Explain why test coverage is used to measure test completeness.
Think about what coverage tells us about the tests and what it does not.
You got /4 concepts.
Describe how JUnit and coverage tools work together to improve testing.
Consider the roles of both JUnit and tools like JaCoCo.
You got /4 concepts.