LESSON 04 / 4·2 min readFoundation

Is 100% coverage enough?

01 Understand02 Recall03 Prepare

Understand the concept

Coverage measures which lines, branches or functions executed while tests ran. It can reveal untested areas, but execution does not prove that the assertions checked correct behavior. A suite can reach every line and still miss invalid inputs, race conditions or a wrong expected value.

Important ideas

  • No. Executed lines can still have weak assertions or missing edge cases.

  • Check important success, failure, permission and concurrency cases.

  • Use real database integration tests for queries, constraints and transactions.

  • Focus assertions on business invariants, such as stock never becoming negative or one user never reading another tenant's data.

PAUSE & RECALL

Can you explain it without the notes?

Is 100% coverage enough?

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

Coverage measures which lines, branches or functions executed while tests ran. It can reveal untested areas, but execution does not prove that the assertions checked correct behavior. A suite can reach every line and still miss invalid inputs, race conditions or a wrong expected value.

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

  • Use coverage as a signal to inspect gaps, not a target that substitutes for meaningful test design.
Practice this concept
YOUR NEXT STEP

You’ve reached the end of this guide.

Prepare for Testing interviews

Adapted from 09_TESTING_GIT_DOCKER_CLOUD.md · “Is 100% coverage enough?”. Examples are study fragments; framework behavior can depend on your version.