-
Notifications
You must be signed in to change notification settings - Fork 0
Code Coverage
"Testing shows the presence, not the absence of bugs" - [[Dijkstra|http://en.wikiquote.org/wiki/Edsger_W._Dijkstra]]
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
- Statement Coverage i.e. what lines have been covered.
- Method Coverage i.e. what methods have been covered.
- Branch Coverage i.e. which branches were taken. This is related to cyclometric complexity
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.
This will require just instrumenting the first instruction to record a hit. This will be useful for recording visits to those "auto" imlemented methods that have no source code i.e. constructors and "auto" properties. This coverage can be gathered without any need to access PDB files and has the least performance impact.
Will involve analysing the branches or IL to determine where to instrument the code, this would not require access to the PDBs. Alternatively OpenCover currently records the order of that the sequence points were visited so the branch analysis could be determined statically after an anlysis run.