Enforce 100% code coverage with Very Good Coverage

At Very Good Ventures, we are passionate about writing tests for our codebases

Scarlett Wardrop
Scarlett Wardrop
January 4, 2021
3min
News
Enforce 100% code coverage with Very Good Coverage

At Very Good Ventures, we are passionate about writing tests for our codebases — in fact, we strive for 100% test coverage on all of our projects. To ensure that we can maintain this threshold with any new lines of code that we write, we created Very Good Coverage, a GitHub Action that supports multiple operating systems to enforce a code coverage threshold. 

By adding the below lines to the GitHub Actions workflow, you can enforce a minimum coverage threshold of your choosing (we recommend sticking with the default setting of 100%, but feel free to change to a number that best works for you and your project). You can also exclude files, such as generated code, from the calculation.

uses: VGVentures/very-good-coverage@v1.1.1
with:
path: "./coverage/lcov.info"
min_coverage: 95
exclude: "**/*_observer.dart **/change.dart"

We highly recommend adding Very Good Coverage to new and existing projects to ensure all code contributions are being tested. 

  • For new projects: We recommend keeping the default min coverage of 100% for maximum confidence that every single line is covered. 
  • For existing projects: Generate an lcov coverage report, then use the current coverage from that as the minimum coverage for Very Good Coverage. This will ensure that the code never drops below the existing percentage. Each sprint, try to make it a goal to gradually increase the percentage until you reach 100%!

How We Built It: Four Nights of “Live” Coding

If you want to see exactly how we built Very Good Coverage, we recorded the entire process from planning to publish. In early October, we set out to create a series of #VeryGoodOSS videos for the Chicago Flutter Meetup Group that would showcase our love for the open source community and premiere during DigitalOcean’s Hacktoberfest.

While things did not go as planned at times (we initially started using TypeScript but then pivoted to JavaScript because of a lack of type definitions for the underlying npm package and to keep things beginner-friendly), we kept most of the footage unedited. The result was four coding sessions that while not technically live, still showcase the real-time process of building upon an open source codebase.

We compiled all of the videos in this Very Good Open Source Playlist! A recap of what we accomplished each day:

Day One: Planned the scope of the project and the tasks we needed to complete.

Day Two: Recapped some of our off-screen activity where we pivoted to using JavaScript instead of TypeScript; then we dove into the code and began building.

Day Three: Continued building functionality.

Day Four: Cleaned up the code and published the package. 

While lcov-cop originally lived under the Chicago Flutter organization, we shifted it to Very Good Open Source because we use it a lot on internal VGV projects and knew it would be easier to maintain there.

Check out the Very Good Coverage GitHub Action in the GitHub Action Marketplace and all of our open source libraries at Very Good Open Source.

Felix Angelov and Jorge Coca contributed to this article.

Name of the heading

Category
Best Practices
Testing
Share

Insights from Our Experts

View All Insights
Generative UI for Flutter: Build Adaptive, Branded, and Intelligent User Experiences

Generative UI for Flutter: Build Adaptive, Branded, and Intelligent User Experiences

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

VGV Team
VGV Team
October 24, 2025
Generative UI for Flutter: Build Adaptive, Branded, and Intelligent User Experiences
Google I/O 2023: Spotlight on AI, Flutter moves forward, and I/O FLIP takes the stage

Google I/O 2023: Spotlight on AI, Flutter moves forward, and I/O FLIP takes the stage

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

May 12, 2023
Google I/O 2023: Spotlight on AI, Flutter moves forward, and I/O FLIP takes the stage
Why we use flutter_bloc for state management

Why we use flutter_bloc for state management

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Jorge Coca
Jorge Coca
June 23, 2021
Why we use flutter_bloc for state management