GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - systemgroupnet/SG.CodeCoverage: 🧪 A code coverage library, used for Test Impact Analysis (or Continuous Testing) in our internal testing framework.

BranchesTags
Open more actions menu

Latest commit

 

History

177 Commits
177 Commits

Folders and files

NameName
Last commit message
Last commit date
SG.CodeCoverage.Recorder
SG.CodeCoverage.Recorder
 
 
SG.CodeCoverage.TestConsole
SG.CodeCoverage.TestConsole
 
 
SG.CodeCoverage.Tests.NetFx
SG.CodeCoverage.Tests.NetFx
 
 
SG.CodeCoverage.Tests
SG.CodeCoverage.Tests
 
 
SG.CodeCoverage
SG.CodeCoverage
 
 
SampleProjectForTest
SampleProjectForTest
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SG.CodeCoverage.sln
SG.CodeCoverage.sln
 
 
summary.jpg
summary.jpg
 
 

Repository files navigation

SG.CodeCoverage

A code coverage library, used for Test Impact Analysis (or Continuous Testing) in our internal testing framework, as a replacement for vstest's inefficient data collectors.

How does it work?

SG Coverage works by weaving IL codes into project's assemblies using its Instrumenter type in the SG.CodeCoverage project. It injects a AddHit(int typeId, int methodId) method call that counts number of times the method visited, and creates a json map file that maps id of assemblies, types and their methods to their file paths, during this process.

The AddHit(int, int) method resides in the SG.CodeCoverage.Recorder project, which is an auto generated assembly for each instrumentation phase (inspired by AltCover, Coverlet and MiniCover) and holds the total number of types instrumented and an in-memory visit counter.

Steps to produce coverage results

  1. Instrument assemblies using Instrumenter class. This process outputs a json map file.
  2. When any method in the project is called, instrumented assemblies make sure that the RecordingControllerServer is running and collecting data, and then sends the hit records to the server.
  3. After running each test, you can call RecorderControllerClient.SaveHitsAndReset(string outputPath). This will send a request to server to save the visited types and methods as a binary file like hits.test1.bin, then resets the counter.
  4. After collecting test hits, you can find the visited files by merging the json map file and the binary hit file. This can be easily done using DataCollector.GetVisitedFiles method which does this task.

Summary

This is not exactly a sequence diagram, but helps you get the idea, and as they say: "a picture worth a thousand words":

summary

About

🧪 A code coverage library, used for Test Impact Analysis (or Continuous Testing) in our internal testing framework.

Topics

assembliescode-coveragecodecoveragecontinuous-testingcoveragecoverage-libcoverage-librarydotnetdotnet-coreinstrument-assembliestest-impact-analysistestimpactanalysis

Resources

Readme
MIT license
Activity
Custom properties

Stars

9 stars

Watchers

7 watching

Forks

1 fork
Report repository

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.