If you're working on a software project, you know how important it is to ensure that your code is thoroughly tested. One way to measure the effectiveness of your testing is to calculate pipeline coverage. In this article, we'll explain what pipeline coverage is, when it's valuable to calculate it, and how to do it in GitLab.
Pipeline coverage is a metric that measures the percentage of your code that is tested by your continuous integration/continuous delivery (CI/CD) pipeline. It's calculated by dividing the number of lines of code that are covered by tests by the total number of lines of code in your project.
For example, if your project has 1,000 lines of code and your tests cover 800 of those lines, your pipeline coverage would be 80%.
Pipeline coverage is a useful metric because it gives you an idea of how well your tests are covering your code. If your pipeline coverage is low, it may indicate that you need to write more tests to ensure that your code is thoroughly tested.
Calculating pipeline coverage is valuable in a number of situations. For example:
Calculating pipeline coverage in GitLab is relatively straightforward. Here are the steps:
That's it! You now know how to calculate pipeline coverage in GitLab.
GitLab itself isn’t naturally geared towards letting you calculate complex metrics like Pipeline Coverage. As an alternative, teams typically use products like Arithmix to import data from GitLab and build out dashboards.
Arithmix is the next generation spreadsheet - a collaborative, web-based platform for working with numbers that’s powerful yet easy to use. With Arithmix you can import data from systems like GitLab, combine it with data from other systems, and create calculations like Pipeline Coverage.
In Arithmix, data is organized into Tables and referenced by name, not by cell location like a spreadsheet, simplifying calculation creation. Data and calculations can be shared with others and re-used like building blocks, vastly streamlining analysis, model building, and reporting in a highly scalable and easy to maintain platform. Data can be edited, categorized (by dimensions) and freely pivoted. Calculations are automatically copied across a dimension - eliminating copy and paste of formulas.
Arithmix is fully collaborative, giving your entire team access to your numbers and the ability to work together seamlessly.
Calculating metrics like Pipeline Coverage is simple in Arithmix. Once you've created your free account, you’ll be able to import your GitLab data, and use it to create natural language formulas for metrics like Pipeline Coverage.
Arithmix is designed to give you the power to build any calculations you want on top of your GitLab data, while also being easy to use and collaborate on. You can share your dashboards with users inside and outside of your organisation, making it easy to empower your whole team.