Skip to content

Coverlet Coverage does not match coverage reported from Report Generator reports #84

Closed
@joshclark

Description

@joshclark

When coverlet runs on my project it reports 72.7%. When I take the output (I used the opencover reporter) and run that through ReportGenerator, it shows the coverage as 66.7%. If I change the output to Cobertura I get 62.2%

Opening the coverage.xml file I see this summary:

  <Summary numSequencePoints="2015" 
           visitedSequencePoints="1254" 
           numBranchPoints="142" 
           visitedBranchPoints="142" 
           sequenceCoverage="0.727" 
           branchCoverage="0.727" 
           maxCyclomaticComplexity="0" 
           minCyclomaticComplexity="0" 
           visitedClasses="120" 
           numClasses="203" 
           visitedMethods="310" 
           numMethods="447" />

It looks like the sequenceCoverage attribute matches what coverlet reports. It looks like visitedSequencePoints / numSequencePoints matches what ReportGenerator is reporting for Cobertura.

I would expect the two tools to report the same value. I have not yet researched where those numbers are coming from.

Update:
It looks like the problem might be here (https://github.com/tonerdo/coverlet/blob/master/src/coverlet.core/CoverageSummary.cs) where the code takes the average of averages rather than calculating the actual average from the raw data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions