Skip to content

Enhanced Branch Coverage #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hunterjm opened this issue Apr 30, 2018 · 2 comments
Closed

Enhanced Branch Coverage #67

hunterjm opened this issue Apr 30, 2018 · 2 comments

Comments

@hunterjm
Copy link
Contributor

Expected Result

When running code coverage on a project, all branches in a method will be determined, and their targets will be instrumented.

Actual Result

Currently, only sequence points that are targets of branches are instrumented.

Proposed Solution

Implement a branch point/target search using logic similar to OpenCover.Framework.Symbols.CecilSymbolManager. This would allow us to:

  • Track Branches separately from Sequence Points.
  • Instrument all Branch Targets.
  • Provide more detailed branch information to the supported reporters.

Discussion

I've already taken an initial stab at this functionality in my fork and everything seems to be working. I am in the process of cleaning up the code and adding tests, but wanted to open this issue before opening a PR.

Major high-level changes to the structure are as follows:

  • Removed IsBranchTarget from Line and LineInfo as branches are now tracked separately from sequence points.
  • Changed InstrumenterResult
    • Added Branch which extends Line and adds additional properties such as Path
    • Changed Document to have both Lines and Branches
  • Changed CoverageResult
    • Updated Methods to be a Dictionary with a new class Method as the Value
    • Method contains Lines and Branches
  • Changed all supporting code (Instrumenter, CoverageSummary, Reporters) to handle the new model structure.
@tonerdo
Copy link
Collaborator

tonerdo commented Apr 30, 2018

@hunterjm Thanks for opening this issue and taking a stab at fixing it. I look forward to your PR. Cheers

This was referenced May 1, 2018
@tonerdo tonerdo closed this as completed May 5, 2018
@tonerdo
Copy link
Collaborator

tonerdo commented May 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants