Skip to content

Test coverage visibility

Which code did your functional and manual tests actually run?

Unit-test coverage is reported by every build. What most teams cannot see is what their slower tests reach: the end-to-end suite, the API tests, the regression pass a QA team runs by hand. CoverOps measures the deployed services while those tests run.

By the CoverOps team · Last updated

How the measurement works

  1. An agent runs inside each service. It records which lines and methods execute, without changes to your tests.
  2. Each test names itself in a request header. The Playwright and Cypress plugins and the JUnit 5 extension set it; Postman, k6 or any HTTP client can send it.
  3. The name travels with the request across service hops, so coverage is attributed to the test on every service it reached.
  4. Shards and agents report into one run. A suite split across machines is read as one result.
Illustration with example code: green ran, red never ran, amber took one branch (branch data from the Java and Node.js agents).

What it measures, per language

Coverage is not the same on every runtime. This is what each agent reports today.

What each CoverOps agent measures and how it attaches
LanguageHow it attachesLine and method coverageBranch coveragePer test
Java (JVM)One -javaagent flagYesYesLines each test ran
Node.jsOne --require (or NODE_OPTIONS) entryYesYesLines each test ran
.NETA post-build weaving step and a startup hookYesNoLines each test ran
PHPauto_prepend_file, with the pcov or Xdebug extensionYesNoLines each test ran
PythonThe agent package and a one-line WSGI or ASGI middlewareYesNoLines each test ran
GoBuild with -cover -covermode=atomic and add the middleware (a code change)YesNoLines each test ran

Manual testing and regressions that take days

Coverage monitoring

Start a monitoring run before a regression and stop it when the regression ends. Every agent joins the run and keeps adding coverage, from automation and from people testing by hand, until you stop it. The result is one picture of what the whole regression reached.

Recorded sessions, with ReplayOps

If your testers use ReplayOps, each recorded browser session carries its id in the trace context of its requests. CoverOps joins every step of the session to the services and methods it executed.

Code that shipped and never ran

Coverage read the other way round: over a window and an environment you choose, the methods the agents measured and nothing executed. Methods no agent ever loaded are counted separately, as unknown, because they cannot be called dead on evidence.

CoverOps dead code screen: of 513 methods in the source, 311 ran, 147 were measured and never ran, and 55 were never measured.
Real CoverOps screen, demo project data.

What coverage does not tell you

  • That a test checked the right thing. A line can run under a test with no assertion on its result.
  • That untested code is broken, or that tested code is correct.
  • Anything about code no agent observed: a service without an agent is outside the picture.

Use it to find what your tests never reach, and to check that a change was exercised before it ships. The guide code coverage vs test coverage goes into the difference.

Find out what your regression suite reaches

Bring one service and one suite to a demo; we show what the measurement would look like on your stack.