Search⌘ K
AI Features

Code Coverage

Explore the concept of code coverage in unit testing Java applications. Understand how tools like Emma and Cobertura measure code and branch coverage, and learn why coverage numbers should guide educational insights rather than managerial pressure.

Managers love numbers. The concept of code coverage, a term for how much code is unit-tested, is one that tickles the typical manager’s number fixation but ultimately leaves a bad taste when used for anything but educational purposes.

Code coverage

More specifically, code coverage is a measure of the percentage of code that our unit tests execute. We can find tools that do the dirty work ...