We sometimes talk about code coverage when discussing the quality of our unit tests. This week we’ll look at what code coverage is, how we can measure it, and its usefulness.
Code coverage measures the amount of production code that a test suite goes through while running. It’s often expressed as a percentage that shows the ratio of code that’s tested, against the amount that existing tests can’t or won’t. We can use a few different metrics when describing coverage, but we’ll focus on two for the remainder of this article: line coverage, and branch coverage.
Share this post
How to Measure the Effectiveness of Unit…
Share this post
We sometimes talk about code coverage when discussing the quality of our unit tests. This week we’ll look at what code coverage is, how we can measure it, and its usefulness. Code coverage measures the amount of production code that a test suite goes through while running. It’s often expressed as a percentage that shows the ratio of code that’s tested, against the amount that existing tests can’t or won’t. We can use a few different metrics when describing coverage, but we’ll focus on two for the remainder of this article: line coverage, and branch coverage.