This repository has been archived by the owner on Nov 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 248
Code Coverage
Manuel Riezebosch edited this page Jul 10, 2018
·
7 revisions
"Testing shows the presence, not the absence of bugs"
- 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 was looking to address when it started were:
- 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 cyclomatic complexity
OpenCover uses the PDB files to determine which lines of code are associated with each line of source code and then instruments each sequence point to record the hit.
This is built into the sequence coverage points. Auto-implemented properties can be ignored.
OpenCover uses mono.Cecil to analyse the branches or IL to determine where to instrument the code.