Is 100% coverage enough?
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.
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.
Turn this concept into a clear answer.
- Use coverage as a signal to inspect gaps, not a target that substitutes for meaningful test design.
Adapted from 09_TESTING_GIT_DOCKER_CLOUD.md · “Is 100% coverage enough?”. Examples are study fragments; framework behavior can depend on your version.