The Monitor

Identify untested code across every level of your codebase

3 minute read

Published

Share

Identify untested code across every level of your codebase
Eric Metaj

Eric Metaj

As organizations scale their services and adopt AI-assisted coding, code changes are landing faster and in greater volume than ever before. While this powerful new practice is accelerating the pace of development, it is also increasing the likelihood that untested code may slip into repositories without detection. What makes this problem even worse is that most teams have no reliable way to know which code is covered by tests. The challenge of detecting untested code only grows as branches diverge, services expand, and new files are added at high velocity.

Datadog Code Coverage solves this problem by giving teams multi-level visibility into test coverage for the code they ship. It enables teams to explore coverage from the highest-level repository view all the way down to individual lines of code, making it easier to identify untested additions as the codebase evolves.

In this blog post, we’ll show how Code Coverage helps teams:

View test coverage across all repositories

As codebase ownership spreads across teams and repositories expand across providers like GitHub and GitLab, test coverage completeness becomes harder to measure. Datadog Code Coverage provides a clear, unified view of test coverage across all repositories, helping teams quickly spot areas that are consistently untested or undertested. Besides appearing in the Datadog UI, test coverage data from Code Coverage also appears in pull request comments. This enables engineers to see exactly what’s untested in the tools they’re already using, without changing their usual workflows.

Teams can sort coverage metrics by service, package, or code owner to maintain clarity across complex architectures, including large monorepos. This makes it easier to quickly identify where additional tests are needed.

Table showing multiple repositories with percentages revealing overall test coverage and patch coverage.
Table showing multiple repositories with percentages revealing overall test coverage and patch coverage.

Identify coverage gaps at the file and service level

Even when teams know overall coverage, they often lack insight into where coverage is slipping. With Datadog Code Coverage, developers and platform engineers can explore coverage at the file and service level, revealing untested or weakly tested components before they introduce reliability issues. This visibility becomes even more important as AI generates new code paths at high speed—paths that may look correct syntactically but lack supporting tests.

Updated function showing coverage status for modified lines.
Updated function showing coverage status for modified lines.

Gain line-level visibility into untested code

Coverage reports are most useful when they show exactly what needs to be fixed. Datadog provides line-level annotations that pinpoint untested sections of code directly, making it easy for teams to add or refine tests.

Coverage, however, shifts with every commit and branch. Datadog Code Coverage integrates with source code repos like GitHub, GitLab, and Azure DevOps to show the exact lines that changed and whether tests covered them. Over time, this helps teams spot untested code additions and address gaps early.

Catch coverage gaps early before they become risks

By providing visibility across repositories, services, files, lines, branches, and commits, Datadog Code Coverage enables teams to identify untested code early and clearly see where additional tests are needed as the codebase evolves. This multi-level visibility helps teams stay ahead of testing gaps—even as development speeds up—and ensures they maintain confidence in the quality of the code they deliver.

To learn more about Datadog Code Coverage, read our documentation. And if you’re not yet a Datadog customer, sign up for a 14-day to get started.

Related Articles

Patterns for safe and efficient cache purging in CI/CD pipelines

Patterns for safe and efficient cache purging in CI/CD pipelines

Understanding GitOps: key principles and components for Kubernetes environments

Understanding GitOps: key principles and components for Kubernetes environments

Flaky tests: their hidden costs and how to address flaky behavior

Flaky tests: their hidden costs and how to address flaky behavior

Enhance code reliability with Datadog Quality Gates

Enhance code reliability with Datadog Quality Gates

Start monitoring your metrics in minutes