Computer Science I / Testing Larger Behaviours
Practice question · True or false

A test suite can execute every line of a function and still miss the input that breaks it.

Hints
  1. Does running a line check what it produced?
  2. Think of return a / b with b never zero.
Show the answer

True

Why

True. Coverage records that a line ran, not that its result was asserted or that it ran with the value that fails. return a / b reports full coverage while never seeing b = 0. Coverage is a useful floor, uncovered code is certainly untested, and a worthless ceiling.

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