Sonar

Fix Cobertura code coverage on multi-modules projects

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.9
  • Component/s: Cobertura
  • Labels:
    None
  • Number of attachments :
    0

Description

Cobertura (and Emma) calculates the lines coverage density with the following formula :

LPC = (SC + MC)/(S + M)

where
LPC - lines coverage percentage

SC - statements covered
MC - methods entered + accessors entered

S - total number of statements
M - total number of methods + accessors

When aggregating the code coverage at project level, the following formula must be used :

LPC = ( SC1 + MC1 + SC2 + MC2 .... + SCn + MCn)/(S1 + M1 + S2 + M2 .... + Sn + Mn)

where

SCx - statements covered on sub-project x
MCx - methods entered + accessors entered on sub-project x

Sx - total number of statements on sub-project x
Mx - total number of methods + accessors on sub-project x

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: