Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Code Coverage

sawilde edited this page Oct 2, 2014 · 7 revisions
"Testing shows the presence, not the absence of bugs" - [[Dijkstra|http://en.wikiquote.org/wiki/Edsger_W._Dijkstra]]

Code Coverage

There are many different coverage metrics and different coverage tool offerings have a tendency to cover overlapping metrics. A good analysis of different metrics can be found here for anyone interested in the subject.

The metrics that OpenCover is looking to address in the near future are

  1. Statement Coverage i.e. what lines have been covered.
  2. Method Coverage i.e. what methods have been covered.
  3. Branch Coverage i.e. which branches were taken. This is related to cyclometric complexity

Statement Coverage (Implemented)

OpenCover uses the PDB files determine which lines of code are associated with each line of source code and then instruments each sequence point to record the hit.

Method Coverage (Implemented)

This is built into the sequence coverage points. Auto-implemented properties can be ignored.

Branch Coverage (Implemented)

OpenCover used mono.Cecil to analyse the branches or IL to determine where to instrument the code.