← homeProgramming (Програмування)

[Codecov] What is the difference between patch and project coverage?

What is codecov and what do Patch coverage and Project coverage mean? An explanation in simple terms.

Table of contentsClick link to navigate to the desired location
This content has been automatically translated from Ukrainian.
Codecov is a service for analyzing code coverage by tests, which integrates with CI/CD and shows which part of the code is actually executed during testing. The service has two main metrics: patch and project coverage. They are different, and it is important to understand this in order to correctly assess the results in pull requests.
Приклад показника покриття Codecov Patch
Приклад показника покриття Codecov Patch

What is Patch coverage?

Patch coverage is the coverage of tests only for those lines of code that have been changed in a specific PR. That is, if you added or modified several methods, Codecov will show how well these changes are covered. This helps to focus on the quality of new or updated parts of the code.

What is Project coverage?

Project coverage is the overall picture. It shows the percentage of test coverage for the entire project on the current branch. Even if the changes in the PR are well covered by tests, if there are few tests overall in the project, this metric will be low.
Therefore, ideally, it is worth monitoring both metrics: so that the new code has good patch coverage and does not worsen the overall project coverage.

🔥 More posts

All posts
What is CFB (Cipher Feedback)?
Programming (Програмування)Mar 21, '25 16:53

What is CFB (Cipher Feedback)?

CFB (Cipher Feedback) is an encryption mode where each block depends on the previous one, providi...

What is XOR and how does it work?
Programming (Програмування)Mar 21, '25 17:05

What is XOR and how does it work?

XOR (exclusive OR) is a logical operation used in encryption, bit manipulation, and difference ch...