home.social

#code-coverage — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #code-coverage, aggregated by home.social.

fetched live
  1. 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

    #covpeek #codecoverage #devops #coverage #testing #ci #rust #golang

  2. 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

  3. 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 #codecoverage

  4. 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 #codecoverage

  5. #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

  6. 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.

  7. 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."
    #CodeThoughts #GeneratedTests #CodeCoverage #DeveloperLife #CodingInsights #SoftwareEngineering #ProgrammingHumor #iosdev

  8. 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

    #CSudberyRecordings #CodeCoverage #MutationTesting #GildedRose #Refactoring #UnitTests

  9. 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

    #CSudberyRecordings #CodeCoverage #MutationTesting #GildedRose #Refactoring #UnitTests

  10. 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

  11. 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

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

    * opens editor *

    * CTRL+F *

    * @phpstan-ignore-line *

    * Found 587 occurrences *

    #Programming #PHP #PHPStan #Larastan #Laravel #Symfony #CodeCoverage #Coding #Code #SoftwareDevelopment #Software #WebDevelopment #WebDev

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

    * opens editor *

    * CTRL+F *

    * @phpstan-ignore-line *

    * Found 587 occurrences *

    #Programming #PHP #PHPStan #Larastan #Laravel #Symfony #CodeCoverage #Coding #Code #SoftwareDevelopment #Software #WebDevelopment #WebDev

  14. 🔥 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

    #Django #Python #Testing #CodeCoverage #TIL

  15. "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

  16. "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

  17. 🎥 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!

    #BaselOne24 #Java #CodeCoverage #Software

  18. 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™

  19. 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

  20. 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

  21. 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

  22. 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

  23. C++ code coverage reports often omit function templates that are not instantiated, which can give a misleading picture of coverage. I've been trying to improve my tooling in this regard, and so added a feature to Doxide to export line data directly from source code that can be mixed in with gcov coverage data. Here's the story so far.

    indii.org/blog/cplusplus-code-

  24. C++ code coverage reports often omit function templates that are not instantiated, which can give a misleading picture of coverage. I've been trying to improve my tooling in this regard, and so added a feature to Doxide to export line data directly from source code that can be mixed in with gcov coverage data. Here's the story so far.

    indii.org/blog/cplusplus-code-

    #softwaretesting #testcoverage #codecoverage #cplusplus #cpp

  25. 🚀 Effizienz-Booster oder Produktivitätsfalle? Die Wahrheit über Code Coverage 🔍

    📢 Freut Euch auf diesen spannenden #BaselOne24 Vortrag "Code Coverage MythBusters" am 17. Oktober 2024! In diesem räumen Marharyta Nedzelska und Evgeny Mandrikov mit den grössten Mythen rund um #CodeCoverage auf und zeigen dir, wie du dieses Tool richtig einsetzt, um die Produktivität deines Teams zu steigern!

    🚨 Tickets 🐸 unter lnkd.in/ggjmzerN.

    #SoftwareQuality #DeveloperProductivity #BaselOne

  26. Code coverage metrics HURT application quality, especially when gating deployments, because they are a misleading target, prioritizing superficial goals over meaningful use-case validation. A focus on achieving coverage percentages detracts from real quality assurance, as developers write tests that do what the targets insist that they do, satisfy coverage metrics rather than ensuring comprehensive use-case functionality.

  27. Code coverage metrics HURT application quality, especially when gating deployments, because they are a misleading target, prioritizing superficial goals over meaningful use-case validation. A focus on achieving coverage percentages detracts from real quality assurance, as developers write tests that do what the targets insist that they do, satisfy coverage metrics rather than ensuring comprehensive use-case functionality.

    #UnitTesting #TDD #CodeCoverage #BDD #Cucumber #SpecFlow

  28. I think that the green bars of #CodeCoverage that go up are in a way a #gamification system: it provides with a very simple game (which is, well, get to 100%) and just as every gamification system, it fails (the programmer soon starts to only look at code coverage, without considering if the tests they're writing are actually useful or good).

    On the other hand, having all of this in mind, I admit that I find it a good incentive to test, so... can cognizant gamification be good?

  29. I think that the green bars of #CodeCoverage that go up are in a way a #gamification system: it provides with a very simple game (which is, well, get to 100%) and just as every gamification system, it fails (the programmer soon starts to only look at code coverage, without considering if the tests they're writing are actually useful or good).

    On the other hand, having all of this in mind, I admit that I find it a good incentive to test, so... can cognizant gamification be good?

  30. Anyone looking for a #Python 🐍 project to contribute to?

    We have a nice issue in @coveragepy (a great tool for measuring Python code coverage): github.com/nedbat/coveragepy/i

    If you'd like to help, I can assist you setting things up, understanding the code and the issue.

    Even if you don't think you can help, I can guide you and explain whatever you want to understand about the code/issue, no strings attached.

    Boosting for visibility also helps!

    #Coverage #CodeCoverage

  31. Anyone looking for a #Python 🐍 project to contribute to?

    We have a nice issue in @coveragepy (a great tool for measuring Python code coverage): github.com/nedbat/coveragepy/i

    If you'd like to help, I can assist you setting things up, understanding the code and the issue.

    Even if you don't think you can help, I can guide you and explain whatever you want to understand about the code/issue, no strings attached.

    Boosting for visibility also helps!

    #Coverage #CodeCoverage

  32. I’ve been working on the #GitLab #CICD pipeline for @coocook the whole weekend and reduced the typical runtime for a feature branch from 13min to less than 3½min!🎉

    Here’s what I’ve done:

    1. Measure #CodeCoverage only for "master"

    2. "services" section for #PostgreSQL from #Docker instead of "apt-get install"

    3. skip login throttling during tests (except where this feature is tested itself)

    4. run author tests only for the latest #Perl version

    5. all branches share cached Perl dependencies

  33. An interesting argument for 100% code coverage by @ashleyfrieze, arguing by having such an absolute rule then people won’t skip writing tests and thereby get better at it. Though if I was calling the shots, my preference would be to have a high, though not 100%, requirement for #codecoverage and have CI checks so that any PR that lowers the coverage can’t be merged in codingcraftsman.wordpress.com/

  34. **Improvements in .NET code coverage tooling**

    devblogs.microsoft.com/dotnet/

    If you don't have C++ code, then apparently setting these properties will make things even faster:

    ```html
    <EnableStaticNativeInstrumentation>False</EnableStaticNativeInstrumentation>
    <EnableDynamicNativeInstrumentation>False</EnableDynamicNativeInstrumentation>
    ```

    #dotNET #CodeCoverage

  35. Übungsaufgabe (Versandkostenrechner) zum Verständnischeck für #Whitebox-Tests (#CodeCoverage): Frisch aus der Klassenarbeit ins Netz mit einigen Erläuterungen - vielleicht hilft es ja jemandem beim Üben. oer-informatik.de/whitebox-tes #informatikEdu