Computer Science I / Testing Larger Behaviours
Practice question · Sort into groups

Sort each claim by whether a coverage report can actually support it.

Groups: Coverage can tell you this · Coverage cannot tell you this

Hints
  1. Coverage is a record of which code was EXECUTED, and nothing more.
  2. Ask whether each claim could be established by watching the code run with the assertions removed.
Show the answer

Coverage can tell you this: Which lines never ran during the test suite, What fraction of branches were taken at least once, That there is code in the program nobody has verified

Coverage cannot tell you this: That the results produced by the tested lines were checked, That every edge case of the tested code was exercised, That the program is correct

Why

A coverage tool observes execution, so it can report untouched lines and branch percentages, and untouched code is genuinely unverified. It cannot see whether any result was compared against an expectation, so it cannot speak to edge cases or correctness. This is why coverage is a floor, not a guarantee.

Read the lesson: Testing Larger Behaviours →

Practise Testing Larger Behaviours

The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Testing Larger Behaviours