#CodeCoverage

Philip Withnallpwithnall
2025-12-17
Screenshot of a table of code coverage results, showing 100% line and function coverage (meh), and 90.3% branch coverage (worth celebrating).
Christoph Mikschecmiksche
2025-12-14

Meet Covpeek - a fast, language-agnostic coverage parser that extracts coverage data across projects. No more juggling formats - unify reports and focus on quality.

Try it today: github.com/Chapati-Systems/cov

Software Field Notessfnotes.page@sfnotes.page
2025-11-29

When writing tests, i do not optimize for code coverage

I have now been on both sides of the code coverage debate. I have advocated that test suites should achieve higher code coverage. I have also advocated against using code coverage for blocking PR merges.
And fair warning: what i say next is based on my lived experience as a developer, and may not apply to all software engineering contexts.

Some things i have learned to be true, over my time researching and practicing software engineering:

  • You can execute the same line of code a million time without ever catching a bug in that line.
  • Higher code coverage does not mean better tests.
  • Code coverage can be gamed.
  • Some code cannot be executed naturally in a test environment. A lot of UI and configuration code falls neatly in this category.

Given that, I have landed on a very basic philosophy around writing tests, and how code coverage factors in:

I do not optimize my test code for higher code coverage. And instead use coverage data to prioritize what i need to test and leave untested.

The coverage metric itself is not meaningful to me. I rather have only 30% code coverage if i am testing the most critical sections of the codebase. I prefer that over covering 70% of the codebase which may be peripheral to the program’s implementation.

Beyond the coverage metric itself, i am more interested in the set of lines got executed by the test. And i like to examine this data by each method or function. That tells me if the lines that I think should get executed are actually getting executed. I also use such insight to think about the program inputs i need to conjure to exercise the lines of code that are getting skipped from execution.

Indeed, that sort of analysis can be time consuming. But to me it is no different than the time I spend in investigate bugs in production code with breakpoints and step-through debuggers. I use the full set of covered (and uncovered) lines as data in gaining a deeper understanding of how my test code is working.

Personal take: Code coverage is not something that should be optimized for. It should be treated as an honest reflection of what got executed by the test(s), and what did not. That gives real insight into the inner mechanics of the test code.

#codeCoverage #programming #softwareMetrics #softwareEngineering #testing

2025-11-28

For a few weeks I am working on improvements for @phpunit #codecoverage features.

Just relased a blog post detailling the approach and all the ideas and results including deep links into all the relevant pull requests.

staabm.github.io/2025/11/26/sp

Matthew Martinmistersql
2025-09-07

What is the name of the metric for when you got 100% code coverage, but you got 2, 4, 10 tests covering each line of code. Coverage depth? It would be a nice statistic to have

2025-09-05

#PostgreSQL Differential Code Coverage—Now Automated Daily!

Just came across a fantastic initiative by [@nbyavuz](github.com/nbyavuz) that I think the Postgres community will appreciate.

They’ve built a script that generates **differential code coverage** between the latest release branch (currently `REL_18_STABLE`) and `HEAD`—a great way to track what’s being tested as the codebase evolves. Even better, it’s automated via GitHub Actions and published daily as an HTML report.

Script: github.com/nbyavuz/postgres-co
Live Report: nbyavuz.github.io/postgres-cod

Whether you're contributing to Postgres or just curious about test coverage trends, this is worth a look. Kudos to the author for making this public and maintainable!

If you have thoughts or suggestions, I’m sure they’d welcome feedback.

#CodeCoverage #OpenSource #DevTools #Testing #GitHubActions

2025-08-27

Today I worked on phpunit/php-code-coverage to improve @phpunit performance when generating #codecoverage reports.

the just pushed release improves my example use case by ~33%.

Consider sponsoring my open source work in case you love such fixes 🙂

2025-07-23

Understanding .NET code coverage is crucial for software quality. A badge can indicate your project's health, but it's essential to grasp its limitations. #CodeCoverage #dotnet

isaacl.dev/gox

Pakk' :blobcat:pakkito
2025-07-01

Seen this during my morning run.
made me think of generated unit tests... for generated code.
I came across this recently in a codebase, all in the noble pursuit of "code coverage."

Clare Sudberyclaresudbery
2025-06-13

How can you use code coverage and mutation testing to add tests to legacy code? At @mendercon last year, I demonstrated this powerful technique step by step on the Gilded Rose kata, which is hosted by @emilybache on her GitHub account: github.com/emilybache/GildedRo

You can watch the talk here: youtube.com/watch?v=0qna5cuzDI0

2025-05-29

After starting and stopping a half-dozen times over the last few months, I finally sat down last night and spent ~3hr writing my thoughts on #CodeCoverage.

TL;DR: It's not without merit, but it is not the metric that many people make it out to be.

stevegrunwell.com/blog/code-co

2025-04-08

- "My library has 100% code coverage!"
- "How so?"
- "Because I test thoroughly"

* opens editor *

* CTRL+F *

* @phpstan-ignore-line *

* Found 587 occurrences *

Sanyam Khuranacuriouslearner
2025-02-28

🔥 New TIL: Fixing Coverage for Django’s manage.py test --parallel

Running Django tests in parallel but coverage reports are inaccurate? Parallel test execution can mess up coverage data, but here’s how to fix it properly!

Read more 👉 til.sanyamkhurana.com/#/topics

Emanuele Panzthepanz@phpc.social
2025-01-31

Looking for #phpunit code coverage dark-themes, are you using it?

Did not find any native support from PHPunit's tools, just some drop-in custom.css files.

Found so far just 2 of them:
1. github.com/chriswpage/phpunit- (updated 2024)

2. github.com/Porthorian/phpunit- (updated 2022)

From my preliminary research: the coverage tool is using bootstrap v4, while a dark-mode was only introduced in v5.3.

I should not dig into that migration path, or should I? 😅

#php #darkmode #phpunit #codecoverage

"Will you write component tests with me?" 💍
Forget "Will you marry me?" as this is the real question of commitment. A perfect mix of unit and E2E tests, proving microservices true behaviour. Because nothing says "forever" like solid test coverage. 🛠️❤️

martinfowler.com/articles/micr
#CodingLove #TestingIsCaring #Microservices #ComponentTesting #UnitTests #E2ETests #DevHumor #TechRomance #CodeCoverage #QA #DevLife #coding #developer

A couple which sits together writing tests
BaselOneBaselOne
2025-01-09

🎥 Das dritte Video der BaselOne 2024-Serie ist online! 🎉

Wir wünschen euch allen ein gutes 2025 und hoffen, ihr seid gut gestartet! 🌟

In „Code Coverage Myth Busters“ zeigen Marharyta & Evgeny (Sonar), wie Code Coverage Qualität & Produktivität steigern kann – wenn es richtig eingesetzt wird.

🚀 Ein Muss für Java-Entwickler!

📺 Jetzt reinschauen: youtu.be/e7xWqkhLH8s

📅 Save the Date: BaselOne 2025 – 15. & 16. Oktober in der Markthalle Basel!

2025-01-03

Ok so, I'd like to get one of those "coverage %" shield badges in some git projects of mine. Unfortunately, they're hosted on my own forge at git.avg.name, and most everywhere I looked (github.com/inttter/md-badges?t for starters) are all very GitHub-only, some GitLab, no Forgejo/Gitea 😞 or are like Schedule A 🕴️ Demo™

#CodeCoverage #Forgejo #Gitea #GitHub

2024-12-18

Blogged: .NET Code Coverage in Azure DevOps and SonarCloud

How to generate code coverage data that gets displayed in Azure Pipelines and SonarQube

david.gardiner.net.au/2024/12/

#AzureDevOps #AzurePipelines #SonarQube #CodeCoverage #dotnet

Screenshow of code coverage UI in Azure Pipelines
2024-12-13

Since the existing plugins came with too many dependencies for my taste, or specialized on some aspect that didn't cover what I need, I'm working on a #Vim plugin to display code coverage in the sign column.

It's reading lcov-formatted files (which is why I don't have any dependencies) and displays for each line whether it's covered or not.

Still needs a bit of work to be convenient, but I like the result already.

#programming #testing #CodeCoverage

Some Python code in Vim. In the sign column on the left edge of the screen, some lines have a strip of 75 % transparent green next to their line number. One line has a block of 25 % transparent red next to it. These colored markers are rendered as Unicode "block elements" shaded cells.

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst