Test coverage gap finder
Identify untested code paths by diffing production traces against your test suite. Ship with confidence.
Ingredients
- Production trace logs (JSON Lines, one span per line)
- Test suite coverage report (LCOV or Cobertura XML)
- Meridian agent running on staging
Steps
- Collect production traces. Run
meridian trace --env prod --duration 1hand pipe to a file. - Generate test coverage. Run your test suite with coverage enabled. Export as LCOV.
- Run the gap analyzer. Feed both files into the Meridian CLI:
meridian gap --traces prod.jsonl --coverage coverage.lcov
- Review the report. The tool emits a ranked list of uncovered functions hit in production, sorted by call frequency.
- Write the missing tests. Prioritize high-frequency gaps first.
Output
A Markdown report listing each uncovered function, its file path, line range, and production hit count. Example:
## Coverage Gaps | Function | File | Lines | Prod Hits | |----------|------|-------|-----------| | validateSession | auth/session.ts | 42-58 | 12,401 | | parseWebhook | webhooks/ingest.ts | 101-119 | 8,203 |
Notes
- Requires Meridian agent v2.4+ with tracing enabled.
- Works with any language — traces and coverage are format-agnostic.
- Run weekly to catch regressions as code evolves.
Need help wiring this into CI? Read the CI integration guide →