Coder Social home page Coder Social logo

Comments (7)

ddur avatar ddur commented on August 20, 2024

AFAIK and remember, when branch coverage is improved, original branch coverage calculated for method is left unchanged for legacy reasons. I believe correct values comes from ReportGenerator.
Take look at your <BranchPoints> in report

from reportgenerator.

danielpalme avatar danielpalme commented on August 20, 2024

This wiki page explains some metrics of ReportGenerator: https://github.com/danielpalme/ReportGenerator/wiki/Calculation-details

Here you'll find the relevant code:
https://github.com/danielpalme/ReportGenerator/blob/master/ReportGenerator/Parser/Analysis/CodeFile.cs
https://github.com/danielpalme/ReportGenerator/blob/master/ReportGenerator/Parser/OpenCoverParser.cs

I don't know the details of how OpenCover calculates its metrics, so I can't explain any differences.
But: Line coverage is not the same as Sequence coverage. One sequence point can span several lines of code. So there might be a (little) difference.

from reportgenerator.

draftsteve avatar draftsteve commented on August 20, 2024

@danielpalme Thank you. I'll go over these.

@ddur I'm having trouble parsing what you're saying. What do I look for with the BranchPoints in the OpenCover output?

from reportgenerator.

ddur avatar ddur commented on August 20, 2024

@draftsteve
I mean, % of branch coverage should be number of visited <branch point>'s divided by number of all <branch point>'s, multiplied by 100

edit:
Coverage percentage totals are probably averaged and rounded for each level up from method (class, namespace, assembly, total). You should not care much for exact number, unless is 100% :)

from reportgenerator.

danielpalme avatar danielpalme commented on August 20, 2024

@ddur:
Coverage percentage totals are not averaged. For each level (assembly, class, file), the exact numbers are calculated.

from reportgenerator.

ddur avatar ddur commented on August 20, 2024

@danielpalme Sorry, I said "probably" cause I'm not sure.
So you accumulate visited/unvisited numbers of <SequencePoint>'s & <BranchPoint>'s for each level up and then compute?

What I meant under averaged is: sum number of methods, sum percentages and divide both sums.

from reportgenerator.

danielpalme avatar danielpalme commented on August 20, 2024

So you accumulate visited/unvisited numbers of 's & 's for each level up and then compute?

Yes.

from reportgenerator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.