Custom Search

Thursday, October 2, 2008

How are the Clover coverage percentages calculated?

The "total" coverage percentage of a class (or file, package, project) is provided as a quick guide to how well the class is covered - and to allow ranking of classes. The Total Percentage Coverage (TPC) is calculated using the formula:

 TPC = (CT + CF + SC + MC)/(2*C + S + M)
 
 where
 
 CT - conditionals that evaluated to "true" at least once
 CF - conditionals that evaluated to "false" at least once
 SC - statements covered
 MC - methods entered
 
 C - total number of conditionals
 S - total number of statements
 M - total number of methods

No comments: