A coverage report is the file produced by a testing tool that records which lines or branches executed during automated tests. SonarQube does not create this data itself. It imports the report and computes its own metric from the file it receives.
What a coverage report captures
A coverage report is an output artifact from an automated test run, usually generated by a testing tool and then consumed by another system such as a quality gate, build pipeline, or code analysis platform. It records which lines, branches, or other executable paths were exercised, but it is evidence of test execution, not proof that the code is correct.
How coverage data is produced and consumed
Coverage is typically gathered by instrumenting the test run so the tool can observe which statements or branches execute. The resulting file is then imported by the downstream platform, which computes its own coverage metric from that input. That separation matters, because one tool may generate the report while another tool stores, interprets, or visualises the result.
In practice, this means the report format and the metric are related but not identical. A tool can accept the same report file and still apply different aggregation rules, exclusions, or thresholds. Treat the report as a source dataset, not as the final quality judgement.
Why coverage is useful, and what it does not tell you
Coverage helps teams see which parts of the codebase were exercised by tests and which parts were not. That makes it useful for identifying blind spots, tracking changes over time, and validating that automated tests reach important paths after a change.
However, coverage does not tell you whether the tests were meaningful, whether assertions were strong, or whether the executed paths were secure. High coverage can coexist with weak test design, and low coverage can still hide in critical logic if the most sensitive branches are never reached. For that reason, coverage is best treated as a visibility signal, not as a stand-alone measure of software quality.
Coverage reports in build and quality workflows
Coverage reports usually sit inside continuous integration and quality assurance workflows, where they act as an input to gating, trend tracking, or developer feedback. They are most valuable when teams use them consistently across builds, branches, and releases, so changes in coverage reflect real change rather than inconsistent tooling.
The report format also becomes an integration concern. If the test runner and the consuming platform do not agree on paths, source mapping, or exclusions, the imported metric may misrepresent the real test surface. That is why coverage data often needs the same configuration discipline as any other build artifact.
For a broader view of how coverage data fits into secure engineering and control thinking, see the NIST SP 800-53 Rev 5 Security and Privacy Controls, which includes controls relevant to testing, auditability, and system integrity.
Common failure modes and interpretation mistakes
The most common mistake is equating coverage with assurance. A team can cover a line without testing the right condition, and a branch can be executed without validating the security or business outcome. Another frequent issue is relying on coverage percentages without understanding which files, generated code, test helpers, or excluded directories were omitted from the calculation.
Coverage also becomes misleading when organisations compare numbers across tools or repositories without normalising the reporting rules. A report produced by one tool may count branches differently from another, so the same codebase can appear to have different coverage depending on how the file is interpreted.
For testing systems that consume API-heavy services, it can also be helpful to review the OWASP API Security Top 10, because execution data alone does not reveal whether API authorisation or sensitive-flow checks are actually exercised.
Risk and Threat Considerations
Coverage reports are not a direct security control, but they can mask risk when teams mistake test reach for test effectiveness. If security-critical branches, error paths, or authorisation checks are not exercised, a regression can survive with high apparent coverage and still create exploitable behaviour.
Failure mechanism: The report shows that code ran, but not that the test asserted the right security property, so untested or weakly tested logic can remain in release builds.
Impact: Defects in access control, input handling, error handling, or control-flow logic may reach production without being caught by the test suite.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5, OWASP ASVS and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | AU-6 — Audit Review, Analysis, and Reporting | Coverage reports are audit-like evidence from test execution used in quality analysis. |
| SI-2 — Flaw Remediation | Coverage helps surface untested code paths that can hide flaws needing remediation. | |
| Recommendation — Review coverage outputs to detect missing test paths and unusual gaps in executed code. Use coverage gaps to prioritise remediation of code paths that lack adequate test exercise. | ||
| OWASP ASVS | V16 — Security Logging and Error Handling | Coverage helps validate test reach for error paths and security-relevant handling. |
| Recommendation — Verify that tests exercise logging, exception, and error-handling paths that matter to security. | ||
| CIS Controls v8 | CIS-16 — Application Software Security | Coverage is part of secure software testing and assurance for application releases. |
| Recommendation — Track coverage as one signal inside application security testing and release assurance. | ||
Practitioner Guidance
What to watch for: Treat the coverage report as one input to quality decisions, not as a pass-fail security metric. The most useful practice is to look for gaps in important branches and to confirm that the report imported by your analysis platform reflects the same source tree and exclusion rules used by the test runner.
Governance implication: Ownership should sit with the engineering team that produces the tests and the platform team that consumes the report, because both sides can distort the metric if paths, filters, or pipeline stages are inconsistent.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org