Test Coverage: What It Measures and Why 100% Is the Wrong Target

Test coverage measures how much of your product your tests exercise, counted as requirements, features, risks or lines of code. A low figure means some parts still have no tests, while a high one can’t confirm that the tested code gives correct results. For that reason, 100% makes a poor target, especially since the last few percent cost the most.

Finding code that nothing checks is a key part of regression testing services, because every release can add paths that the existing suite never runs. A Google Cloud outage shows the risk. In May 2025, the company released a new quota check whose faulty code never ran during the rollout. Two weeks later, a policy change with blank fields made that code run for the first time. Cloud and Workspace products worldwide then returned errors for about three hours, according to Google’s incident report.

A gap like that stays invisible until the wrong input arrives. That’s why our engineers start each new project by finding the user flows and code paths no test reaches yet. Below, you’ll learn how to interpret your coverage numbers and choose a target that matches your product’s risks.

What Is Test Coverage vs Code Coverage?

Teams usually report test coverage as a single percentage, such as 85%. That number only makes sense once you know what is being counted. The ISTQB glossary, maintained by the International Software Testing Qualifications Board, defines coverage as the share of chosen items that a test suite exercises. Each team decides what those items are, so two reports showing 85% can describe very different amounts of testing.

Most types of test coverage count what a product owner can read and check: requirements, features, user flows or known risks. Code coverage is the narrowest kind, produced by a specialized tool that runs alongside your automated tests and records the lines of code executed during testing.

Test Coverage vs Code Coverage: What Each Number Counts
Requirement, feature and risk coverage
Code coverage

What it measures

Requirement, feature and risk coverage

Share of requirements, features, flows or risks with at least one test

Code coverage

Share of the code that runs during automated tests

Who tracks it

Requirement, feature and risk coverage

QA leads, product owners and engineering managers

Code coverage

Developers and the build pipeline

How it’s measured

Requirement, feature and risk coverage

A test management tool that links each test to the item it checks

Code coverage

A coverage tool that records which code executes during the test suite

Typical tools

Requirement, feature and risk coverage

Test management tools with requirement tracing

Code coverage

Language-specific coverage tools added to the build

What it misses

Requirement, feature and risk coverage

Whether each test checks the right result

Code coverage

Missing features, and whether tests verify outcomes

What sets the target

Requirement, feature and risk coverage

The business risk of each requirement or flow

Code coverage

How critical the code is, plus team policy

Types of Test Coverage, From Requirements to Code

Test coverage comes in several types, depending on what a team decides to count. Most teams track only one of those numbers and treat it as a complete picture of their testing. However, a single measure covers a limited area and can miss problems the other types would catch. Combining two or three types gives a far more reliable view.

Requirements, Feature, Risk and Code Coverage Compared
Type
What it counts
Example
What it misses
Type

Requirements coverage

What it counts

Written requirements with at least one linked test

Example

A test case for every user story in a release

What it misses

Requirements nobody wrote down

Type

Feature coverage

What it counts

Product features with tests

Example

A test suite for each of search, checkout and account settings

What it misses

Bugs that appear only when features work together

Type

Risk coverage

What it counts

Known risks with a test that addresses them

Example

A test for each way a payment can fail

What it misses

Risks nobody identified

Type

Code coverage

What it counts

Lines of code and decision outcomes that ran during tests

Example

A pricing module where every line ran at least once

What it misses

Wrong results that no test checks

Note that code coverage has two common forms, and most tools report both automatically:

  • Statement coverage (often called line coverage): The tool counts the lines of code that ran during testing.
  • Branch coverage: This form checks whether each decision in the code ran both ways, for example the yes and the no result of an if statement.

Both forms belong to white box testing, because measuring them requires access to the source code.

How to Measure Test Coverage

Every type of test coverage uses the same calculation. Divide the items that have at least one test by all the items in scope, then multiply by 100:

Test coverage (%) = items with at least one test ÷ total items in scope × 100

For example, say a release includes 40 requirements, and tests are linked to 34 of them. Requirements coverage for that release is 34 ÷ 40 × 100, or 85%. The 85% is a summary, while the six requirements with no linked test show the team exactly what to cover next.

For code coverage, a tool does the counting, and the result depends on whether it measures lines or branches. The documentation of coverage.py, a Python tool, shows the difference with a four-line function that contains one if statement. A single test runs every line, so line coverage reports 100%. Yet the if statement never produces a no result during that test, so branch coverage marks the function as partly tested.

Line, branch and requirements coverage are all test coverage metrics, and each answers a different question about the same suite. None of these figures shows whether the suite itself is reliable. For that, teams read coverage alongside other test automation metrics, such as the share of tests that fail at random.

Why 100% Test Coverage Is the Wrong Target

A 100% target can look like a quality goal, because a perfect score suggests that everything has been tested. In practice, the number measures less than it seems to, and reaching it costs more than most products can justify.

A coverage tool records only what code ran and says nothing about whether a test verified the output. For example, a test that runs the checkout’s price calculation without checking the total still raises the score, even if the amount is wrong.

Chasing the number can even lead a team to delete good tests. At Meta, 277 of 571 new tests that caught bugs added no line coverage at all, according to the company’s engineers. A rule that rewarded coverage alone would have thrown all 277 away.

The score also can’t reveal what was never built. If a planned feature was skipped, there is nothing for the tool to measure, so even 100% code coverage misses the gap. The ISTQB Foundation syllabus lists this limit, which is why testers also compare the test suite with the written requirements.

Finally, the last few percent are the most expensive to reach. SQLite, a widely used open-source database engine, has 100% branch coverage, and holding that level takes 590 times as much test code as product code. Such depth makes sense for a component that other software is built on.

Do your tests check the flows that matter?
Contact Us

How Much Test Coverage a Product Needs

No industry standard sets a required coverage level. Code quality tools often ship with built-in coverage targets, but each one reflects a single vendor’s choice. For example, SonarQube requires 80% coverage on new code by default and skips changes under 20 lines. That setting suits some teams but can be too strict for an internal script or too loose for a payment service.

A more reliable guide is what a failure would cost in each part of the product. Four factors decide most of that cost:

  • Whether the code moves money or calculates prices
  • Whether a regulator or auditor reviews that part of the product
  • How many people use it every day
  • How hard a bad release would be to undo

The more of these factors apply, the more thorough the testing should be. See how this looks in practice:

High Stakes: Fintech Products

In fintech, one untested path can move real money or break a compliance rule. Therefore, coverage should be deepest where funds and customer data pass through. We applied that rule when testing Union54. Our engineers automated tests for 90% of the product’s API endpoints and kept covering new database triggers as development continued.

Medium Stakes: Online Stores

Revenue in an online store depends on a few flows, such as search, cart, checkout and payment. Those flows need close to full coverage, while a rarely used settings page can get lighter checks. Our engineers followed the same priority on DrAnsay, an online prescription platform, focusing 40+ automated tests on the key user journeys.

Low Stakes: Internal Tools

Internal tools usually need the least coverage. A small team relies on them, fixes ship the same day and bugs rarely reach customers, so testing the main daily tasks is often enough. The exception is internal software that handles payroll, customer records or production data. Those systems need the same depth of testing as an external product.

Common Test Coverage Mistakes

A test suite can grow for months without protecting the product any better. Usually, one of the following mistakes is the reason:

  • Counting tests as progress: Many tests for settings screens protect the business less than a few for the payment flow. Linking each test to a specific risk shows what areas still have no protection.
  • Leaving out non-functional areas: Most coverage reports only count functional tests, the ones that check what features do. Speed under load, security and accessibility rarely get their own figure, so users often find problems in those areas first. That’s why functional and non-functional testing each need a separate coverage plan.
  • Keeping outdated tests: Tests written for an older version of the product can keep passing while checking behavior that no longer exists. On Unfold, our team prevents that problem by updating more than 2,800 test cases every week with each release candidate.

A coverage figure alone won’t reveal these mistakes. Comparing it with other software test metrics, such as the number of bugs reaching production, makes the problems easier to spot.

How QAwerk Decides What to Cover

Coverage targets decide how much testing a QA engagement includes. We agree on them with each client before work starts, whether the job is one release or a long-term dedicated QA team. Every feature placed in scope adds test cases to write, run and update, and the cost follows from that work. The client also gets a clear list of what is tested and what is left out.

A coverage plan also has to fit how often the product ships. For example, Granola, an AI notepad, releases updates every week. To keep up, our team built more than 1,100 test cases and automated 76% of the core regression suite. Together with Granola’s engineers, we also created an AI step that reads each pull request and picks the tests most relevant to the change. As a result, each weekly update is checked where the code changed.

Wondering what your current tests miss? Get a coverage plan built around your risks.

FAQ

What is a good test coverage percentage?

A good test coverage percentage is different for each part of a product, so one company-wide number rarely makes sense. Payment, login and data-handling code usually calls for close to complete coverage, while admin screens or one-off scripts need far less. Coverage tools ship with default thresholds chosen by each vendor, so treat those numbers as a starting point.

Is 100% test coverage possible?

Reaching 100% test coverage is possible, but the effort rises sharply as the score approaches the maximum. The final few percent usually come from error handling and rare edge cases that are hard to trigger during a test run. Even a perfect code coverage score shows only that every line executed. It can’t tell you if each result was correct or if part of the intended functionality was never built.

What is the difference between test coverage and code coverage?

Test coverage shows whether the product’s expected behavior has tests, measured in units such as requirements, use cases or identified risks. Code coverage is the narrowest type of test coverage: the share of source code executed during automated runs, as measured by a separate tool. A product can score high on one measure and low on the other, which is why many teams track both.

How do you measure test coverage?

Start by picking the unit to count, such as requirements, features or known risks. Then connect every test to the unit it checks. The coverage percentage is the number of covered units divided by the total in scope, times 100. Code coverage follows the same arithmetic, except that a tool counts the executed lines or branches automatically.

Does high test coverage mean fewer bugs?

High test coverage lowers the chance that a whole area goes untested, but it doesn’t guarantee fewer bugs. Defects still reach users when tests run code without confirming the output, when a requirement was misunderstood, or when the problem lies in speed, security or accessibility. Bug counts drop most when the riskiest areas get tests that check real outcomes.

See how a fintech card-issuing API stabilized its regression suite, automated 90% of endpoints, and kept critical bugs out of production while scaling globally.

Please enter your business email isn′t a business email