November 2024
Intermediate to advanced
300 pages
7h 12m
English
Code coverage metrics measure the percentage of code that your unit tests execute (exercise) when run. Ostensibly, code that is covered is working, and code that is not covered represents the risk of breakage.
From a high level, tests that exhaust all relevant pieces of code provide 100 percent coverage. Code with no tests whatsoever has 0 percent coverage. Most code lies somewhere in between.
Many tools exist that will calculate coverage metrics for Java code, including JaCoCo, OpenClover, SonarQube, and Cobertura. IntelliJ IDEA ships with a coverage tool built into the IDE.
Numerous coverage metrics exist to measure various code aspects. Function coverage, for example, measures the percentage ...
Read now
Unlock full access