0
0
Software Engineeringknowledge~5 mins

Code coverage metrics in Software Engineering - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AFunction coverage
BBranch coverage
CLine coverage
DCondition coverage
What does branch coverage focus on?
ATesting all functions
BTesting all decision paths
CExecuting all lines
DChecking all variables
If a test runs code but does not check if the output is correct, what does this imply about code coverage?
ACoverage is high but tests may be ineffective
BCoverage is low
CTests are perfect
DCode is bug-free
Which of these is NOT a common code coverage metric?
AMemory coverage
BBranch coverage
CFunction coverage
DLine coverage
How does code coverage help developers?
ABy writing code for developers
BBy fixing bugs automatically
CBy running the software faster
DBy showing untested code areas
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.