baklinko
Opinion · Enterprise

GitHub's built-in code coverage view is welcome. The number says little about test quality

GitHub now shows test coverage for a repository, with a history chart and a target. That is convenient. Coverage is easy to raise without making software better, and GitHub was right not to make the target a gate.

A code window where most lines have a green marker and three have an orange one. Beside it, a gauge is about three quarters full and a small chart shows a line rising toward a dotted target.
Green lines were run by tests, orange ones were not. The chart shows the trend. Illustration: Baklinko

GitHub has added a code coverage view to GitHub Code Quality, in public preview, it said on 4 December. Code coverage is the percentage of a program's lines that are run when its automated tests run. The view shows current coverage for a repository, a history chart and a comparison with a target. It is a convenient addition for teams on GitHub's paid cloud plans. Its value depends on how the number is used, because coverage is one of the easiest measures in software to misread.

What does GitHub's code coverage view show?

The view shows where coverage stands, how it has moved and how far it is from a goal.

Part of the viewWhat it shows, from GitHub's changelog
Current coverageThe share of lines on the main branch that tests run, from the latest reports
Coverage historyA line chart for the last 30 days, with 14-day and 90-day options
Coverage targetA goal set by admins and maintainers, for display only
Where it is availableGitHub Enterprise Cloud and GitHub Team
Where it is notGitHub Enterprise Server

To use it, a team turns on GitHub Code Quality and uploads coverage reports in the Cobertura XML format from the main branch. If several reports are uploaded, GitHub combines them and counts each line once.

Why does it help to have this inside GitHub?

It helps because the figure sits where the work happens. Many teams already measure coverage with separate tools and then have to link the result back to their code. A view inside the repository removes that step and gives everyone on the project the same number.

The history chart is the most useful part. A single percentage says little. A line that falls over 30 days shows that new code is arriving without tests, which is the pattern a team lead wants to catch early.

Infographic: GitHub code coverage. GitHub shows how much code your tests run. What the view shows: current coverage of the main branch; a history chart of the trend; progress against a target. What the number cannot show: whether tests check results; which gaps carry real risk; whether the code is correct. 30 days, default history window. 2 plans it is available on. 0 merges the target blocks. Using it well: watch the trend, not one figure; read the tests behind the number; avoid turning the target into a contest.
What GitHub's code coverage view shows, and what a coverage number cannot tell you. Graphic: Baklinko

What are the limits of a coverage number?

A coverage number shows that lines were run. It does not show that the tests check anything. A test can execute every line of a function and still pass when the function gives the wrong answer. - High coverage with weak tests gives false comfort. - Chasing a target invites tests written to move the number. - Low coverage in simple code may matter less than a gap in the risky part.

GitHub's choice to make the target display-only fits those limits. A goal that blocks changes pushes people to satisfy the measure. A goal that is only shown starts a conversation.

The best case against this view

The strongest objection is that this is too little for teams that take testing seriously. It accepts a single report format. It is absent from GitHub Enterprise Server, which some companies run on their own machines. It cannot stop a change that lowers coverage, which is the control some teams most want. For them, a separate tool will remain necessary and this view becomes a second, weaker source of the same figure.

Those gaps are real, and it is a preview. For the large number of projects that measure nothing today, a simple built-in chart is a better start than no measure at all.

The verdict

The coverage view is a sensible, modest feature. Teams should watch the trend, read the tests behind the number, and avoid turning the target into a contest. GitHub should add more report formats before it leaves preview.

This is opinion and analysis, not investment or professional advice. Facts are attributed to the sources named in the piece. See our editorial policy and disclaimer, or request a correction.

Get the day's tech news by email

One short email a day with the stories that matter. Free.

Unsubscribe anytime. See the privacy policy.