Recall & Review
beginner
What is code coverage in software testing?
Code coverage is a measure that shows how much of the source code is tested by automated tests. It helps identify untested parts of a program.
Click to reveal answer
beginner
Name the four common types of code coverage metrics.
The four common types are:<br>1. Line coverage<br>2. Branch coverage<br>3. Function coverage<br>4. Condition coverage
Click to reveal answer
intermediate
What does branch coverage measure?
Branch coverage measures whether each possible branch (true or false) in decision points like if-else statements has been executed during testing.
Click to reveal answer
intermediate
Why is 100% code coverage not always enough to guarantee bug-free software?
Because code coverage only shows which code was run, not whether the tests checked for correct behavior. Tests might run code without verifying results.
Click to reveal answer
beginner
How can code coverage help improve software quality?
By showing which parts of code are not tested, developers can add tests to cover those areas, reducing the chance of hidden bugs.
Click to reveal answer
Which code coverage type checks if every line of code has been executed?
✗ Incorrect
Line coverage measures whether each line of code has been run during testing.
What does branch coverage focus on?
✗ Incorrect
Branch coverage ensures all possible paths in decision points like if-else are tested.
If a test runs code but does not check if the output is correct, what does this imply about code coverage?
✗ Incorrect
Code coverage shows code was run, but without checking correctness, tests might miss bugs.
Which of these is NOT a common code coverage metric?
✗ Incorrect
Memory coverage is not a standard code coverage metric.
How does code coverage help developers?
✗ Incorrect
Code coverage highlights which parts of code lack tests, guiding developers to improve testing.
Explain what code coverage metrics are and why they are useful in software testing.
Think about how testing shows which parts of code are checked.
You got /4 concepts.
Describe the difference between line coverage and branch coverage.
Consider simple code with if statements.
You got /4 concepts.