> For the complete documentation index, see [llms.txt](https://ultimatewebsolutions.gitbook.io/qa-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ultimatewebsolutions.gitbook.io/qa-knowledge-base/test-coverage.md).

# Test Coverage

**Test coverage** means **how much of the application or its requirements are covered by testing**.

> **Test coverage = What percentage of the things we need to test have actually been tested?**

#### Example

Imagine an application has **100 requirements**.

You have written tests for **80 requirements**.

**Test coverage =  80%**

So you can say:

> "Our requirements test coverage is 80%."

#### Common types of test coverage

1. **Requirement coverage**
   * How many requirements have tests?
   * Example: 90 out of 100 requirements → **90%**
2. **Code coverage**
   * How much of the source code is executed by automated tests?
   * Example: tests execute 85% of the code → **85% code coverage**
3. **Functional coverage**
   * How many business functions/features are tested?
   * Example: Login, registration, payment and search are tested, but reporting isn't.
4. **Test scenario coverage**
   * How many important scenarios are covered?
   * Example:
     * Valid login ✅
     * Invalid password ✅
     * Locked account ✅
     * Empty password ✅

#### Important interview point

**100% test coverage does NOT mean 100% bug-free.**

For example, you can have 100% code coverage but still have bugs because the tests themselves may not check the right expected behavior.

{% hint style="info" %}
**Test coverage** measures how much of the application, requirements, functionality, or code is covered by our tests. It helps us identify areas that haven't been tested, but high coverage doesn't necessarily mean high quality because the effectiveness of the tests is also important.
{% endhint %}
