Topic · coverage threshold

Coverage threshold

Gist

A coverage threshold is a policy number the build is allowed to fail. Proof applies it per requirement, with proof audit --check coverage_threshold, against an imported Go or LCOV profile. A global 82% on the suite is not that gate. Vitest still owns the runner. Jama still authors.

proof audit --check coverage_threshold

Keep Jest or Vitest if you already fail the job on lines. Keep coverage.py if you already score Python. Keep Jama if you author shalls. Proof will not count a repo-wide percent as the changed requirement clearing the bar.

01 · The global percent

An 82% suite is not the changed shall.

You can raise the repo number and still leave the requirement you just edited below the policy.

Vitest, Jest, Bun, and coverage.py all fail a job when lines, functions, or branches drop under a configured floor. That is a file or project average. Proof's coverage_threshold check is narrower: after you import a coverage profile, each in-scope requirement is judged against the same policy number. Assumptions are not implementation-bearing. They do not fail the gate only because they have no linked code.

The motivating miss is mechanical. SYS-REQ-001 changed. The suite still prints 82%. The policy is 80%. The changed requirement sits at 62%. Review is performed. The coverage badge is green. The audit that only looks at the repo average reports clean. The requirement that moved never got a test.

The command is deterministic. It does not run the tests. It does not append -coverprofile for you. It refuses a silent pass when an in-scope requirement is below the configured threshold on the imported evidence.

proof coverage link .proof/coverage/unit.coverprofile --format go-cover
proof audit --check coverage_threshold --verbose

The first command attaches the profile the test command already wrote. The second asks whether each in-scope requirement meets the policy. A green 82% after a shall that moved is how 62% stayed hidden.

02 · The exhibit

Same suite. A badge, or this record.

The log can still say 82%. The changed requirement is 62% against an 80% policy. Click the tabs.

Runner / badge

  • Said lines 82% / threshold 80%
  • Job green, badge updated
  • SYS-REQ-001 62%, never named
Suite closed

This requirement

No imported profile on the shall. No baseline scope. No warn when 62% sits under 80%.

No record

Runner / badge

Still 82% on the tree. Keep the runner. It is the average, not the changed shall.

Keep the badge

Proof

  • Ask is each in-scope requirement at or above 80%
  • Out warn until SYS-REQ-001 has evidence or a baseline
A green 82% is not 001

Same suite. A badge, or this record. Click the tabs.

Surface What they do What Proof does What we lose
Vitest / Jest / Bun Fail the job when a global lines or functions floor is missed. Import the profile they already wrote. Judge each in-scope requirement. Not a test runner. Keep the floor they already enforce.
coverage.py / lcov Write a report. A PyPI wrapper can fail a number. Accepts go-cover and LCOV as evidence. Does not generate the report. Does not append -coverprofile. The test command must write the file.
MC/DC Condition independence on a decision. Own URL MC/DC coverage for Go. This gate is imported line or branch evidence, not independence pairs. A met threshold is not MC/DC. Do not read LCOV as independence.
Test vs requirements coverage The split between lines that ran and shalls that have a witness. that question. The numeric policy on imported evidence. Same family, different H1. Not a second lecture on the split.
Jama / DOORS Author and store the programme. Jama still authors. Proof holds the threshold as a row the audit can re-read. IBM DOORS stays a mention on Proof vs Jama. Not an ALM. Jama still authors.

The teaching graph is still a changed shall under a green badge. Import the profile. Let the audit name which requirement is below the policy. Use baseline scope when the backlog is already in debt and only the edit set should fail.

proof config set project.checks.coverage_threshold.auto_link true
proof config set project.checks.coverage_threshold.report_path .proof/coverage/unit.coverprofile
proof config set project.checks.coverage_threshold.format go-cover
proof config set project.checks.coverage_threshold.threshold 80
proof coverage link .proof/coverage/unit.coverprofile --format go-cover
proof audit --check coverage_threshold --scope baseline --verbose
proof help coverage_threshold

If auto-link is on, tests_pass refreshes the configured report before this check runs. The test command still has to write that file. A Foundry project can point format at LCOV. That is Solidity line and branch evidence. It is not code-level MC/DC.

03 · The honest loss

Proof names the requirement. It does not raise the percent.

A met threshold is not a proof of the Go. Jama still authors.

Proof does not implement Vitest, Jest, Bun, or coverage.py. It does not run the suite. It does not invent tests for the 62% shall. It does not treat a green baseline as proof the whole repository is clean. Environment assumptions are excluded on purpose. We have not scored this against Vitest fixtures on a frozen pack. The loss is named, not scored.

coverage gate as a Google query is the same cluster. Same command. Not a twin. Sonar quality gate stays on Proof vs SonarQube.

The split between lines and shalls stays on test coverage vs requirements coverage. Condition independence stays on MC/DC coverage for Go. Jama still authors.

04 · Nearby questions

What people type next.

What is a coverage threshold? Same question. Same URL.

What is a coverage gate? Same cluster. Same command. Not a twin.

Is this Jest coverageThreshold? No. Keep Jest for the runner. Proof imports the profile and names the requirement.

Is this Vitest coverage.thresholds? No. Vitest still owns that config. This check does not replace it.

Is this MC/DC? No. Independence pairs live on MC/DC coverage for Go. Do not read LCOV as those pairs.

What's the difference between test coverage and requirements coverage? The split, not the number. that question.

Is Proof a VectorCAST alternative? No. LDRA owns that cluster. Proof vs LDRA.