# What test coverage doesn't tell you, and what FACET counts instead

> With coding agents, tests get written faster than ever, and coverage climbs almost by itself. Whether those tests check what your product promises is another matter. This guide shows how FACET makes that visible.

Source: https://facet-framework.com/en/guides/what-green-tests-do-not-tell-you/  
Last updated: 2026-11-26T23:28:23+01:00

Writing tests is one of the jobs people most happily hand to a coding agent. You ask for tests for a module, and a few minutes later coverage is noticeably higher than before. That's real help. Coverage just doesn't tell you whether those tests check what your product actually promises.

A small example: an online shop has one test for refunds. It takes an order delivered five days ago and expects the refund to go through. `canRefund` has two lines of logic, the test runs both, and the coverage tool reports 100%. Still, nobody checks that a return on day 31 is refused. If someone set the window to 14 days, the test would stay green.

## Why coverage doesn't tell you everything

Coverage measures which lines a test runs, not which cases it checks. For a time window, the interesting cases are the edges: day 30 and day 31. The day-5 test runs through the same lines and says nothing about either.

AI-written tests add a twist. An agent writing tests for existing code derives them from that very code, so it records what the code does, including where the code is wrong. [Konstantinou, Degiovanni and Papadakis](https://arxiv.org/abs/2410.21136) observed the same with AI test generators. A study at [ISSTA 2026](https://arxiv.org/abs/2607.22880) concludes that for such tests, coverage and mutation scores no longer reliably show whether they find a bug that is already there.

Google's [DORA 2025 report](https://cloud.google.com/blog/products/ai-machine-learning/announcing-the-2025-dora-report) draws a practical lesson from this: more AI only stops making delivery less stable when good automated tests back it up.

## What FACET counts instead

FACET keeps a short description of each feature of your product in the repository, which it calls a record. It lists the cases the product promises, as scenarios, and the tests that prove them. Refunds have two scenarios, but only one has a test:

```yaml
contract:
  scenarios:
    - id: refund-within-window
      statement: |
        Given an order delivered 29 days ago
        When the customer requests a refund
        Then the refund is accepted
    - id: refund-after-window
      statement: |
        Given an order delivered 31 days ago
        When the customer requests a refund
        Then the shop refuses it
verification:
  unit_tests:
    - id: tests/refund.test.ts
      proves: [refund-within-window]
```

`facet test` runs your tests and assigns the results to features:

```sh
npx facet-framework test
```

```text
runner vitest: exit 0
passed orders/refunds/request-refund
Features: 1 passed, 0 failed, 0 unmeasured (1 total)
```

That's correct: the test the record names passes. `facet lint` shows you the gap:

```sh
npx facet-framework lint
```

```text
warning: docs/facets/features/orders/refunds/request-refund.yaml: contract scenario(s) with no verification proof: refund-after-window
```

Now you can see what coverage doesn't tell you: refusing a return after 31 days has no test. And when you ask an agent to write tests, it gets the scenarios as a starting point instead of guessing the cases from the code. By the way, a feature with no test at all shows up in `facet test` as `unmeasured`, never as passed. With `--fail-unmeasured`, that fails the build if you want it to.

To run your tests through FACET, follow [Find business rules no test checks](https://facet-framework.com/en/guides/find-rules-without-a-test/). To show your team where things stand in the browser, see [Show which features are tested, in five minutes with FACET Atlas](https://facet-framework.com/en/guides/find-which-features-are-tested/).

## What FACET doesn't check

FACET checks that a test claims a scenario, not what the test actually asserts. If you add `refund-after-window` under `proves` without changing the test, the warning goes away and the gap stays. So read the test before you list it.

Green in FACET means every written-down scenario has a passing test. A case nobody wrote down is missing here too. Whether the scenarios are complete is something you settle when reviewing the record.

And `facet test` needs a test runner that writes a JUnit report with file names, such as Vitest, Jest or PHPUnit. Without file names, FACET can't assign results to a feature.
