Per Wikipedia, "code coverage is a measure used to describe the degree to which the source code of a program is tested by a particular test suite. A program with high code coverage has been more thoroughly tested and has a lower chance of containing software bugs than a program with low code coverage."
While we will include code coverage tools in our continuous integration project, it can be useful to run code coverage often while developing unit tests. InstallationThere are two items that need to be installed: - OpenCover MSI: https://github.com/sawilde/opencover/releases
- OpenCover UI VisualStudio Extension: https://visualstudiogallery.msdn.microsoft.com/6950a046-8919-4935-8542-c6f37956f688
After installing the Open Cover MSI: - In VisualStudio, navigate to Tools->Extensions and Updates
- Select 'Online' from the left most menu, and then Search for 'OpenCover' in the right most menu.
- Install OpenCover UI.
- Restart.
Using OpenCover in Visual StudioThe documentation provided by the developer of OpenCover UI is excellent, and should be explored before proceeding further: https://visualstudiogallery.msdn.microsoft.com/6950a046-8919-4935-8542-c6f37956f688
There is one problem that users will likely experience: the first time a user right clicks on a test package in the OpenCover Test Explorer, an error will throw and the framework will request the location of the OpenCover executable.
Per the documention, the OpenCover UI extension expects the executable to be located in %localappdata%\Apps\OpenCover .
On my machine, this resolved to C:\Users\praath\AppData\Local\Apps\OpenCover . |
|