Recall & Review
beginner
What is a coverage report in software testing?
A coverage report shows which parts of the code were tested by automated tests and which parts were not. It helps find untested code.
Click to reveal answer
beginner
Name two common types of code coverage measured in reports.
Line coverage (which lines ran) and branch coverage (which decision paths ran). Both help understand test completeness.
Click to reveal answer
intermediate
How does JUnit integrate with coverage tools to generate reports?
JUnit runs tests, and coverage tools like JaCoCo hook into the test run to track which code executes, then create reports after tests finish.
Click to reveal answer
intermediate
Why is 100% code coverage not always the goal?
Because some code is hard to test or not critical. Coverage shows tested code but not test quality or bugs. Aim for meaningful coverage.
Click to reveal answer
advanced
What does branch coverage tell you that line coverage might miss?
Branch coverage shows if all possible paths (like if-else branches) were tested, not just if lines ran. It finds missed decision cases.
Click to reveal answer
What does a coverage report primarily measure?
✗ Incorrect
Coverage reports show which lines or branches of code were executed by tests.
Which tool commonly works with JUnit to generate coverage reports?
✗ Incorrect
JaCoCo is a popular Java code coverage tool that integrates with JUnit.
What does branch coverage help identify?
✗ Incorrect
Branch coverage checks if all decision paths (like if-else) were tested.
Why might 100% coverage not guarantee bug-free code?
✗ Incorrect
Coverage shows what code ran but not if tests check correct behavior.
Which coverage type measures if every line of code was executed?
✗ Incorrect
Line coverage measures if each line of code was run during tests.
Explain what a coverage report is and why it is useful in testing.
Think about how you check if you tested all parts of your code.
You got /3 concepts.
Describe the difference between line coverage and branch coverage.
Consider if statements and their possible outcomes.
You got /3 concepts.