I am using Visual Studio 2015 Community edition, and I know that it has the option to create unit tests to test the code, but I don't see the option to test the code coverage, so I would like to know if Visual Studio has this option or if I have to use a third-party plugin.
If I have to use a third-party solution, would that be a good option?
Code coverage will highlight lines of code that are not covered by tests. It will list the uncovered lines under the problems window. And it conveniently shows the coverage ratio in the status bar.
Unit testing code coverageThe amount of source code a suite of unit tests exercises is called its code coverage. It isn't realistic -- or necessary -- to expect 100% code coverage through unit tests. The unit tests a development team creates depends on business needs and the application or applications' complexity.
You have Fine Code Coverage working with VS 2022, you can access to it here https://github.com/FortuneN/FineCodeCoverage/releases and click on the 2022 file.
Only Visual Studio 2015 Enterprise has code coverage built-in. See the feature matrix for details.
You can use the OpenCover.UI extension for code coverage check inside Visual Studio. It supports MSTest, nUnit, and xUnit.
The new version can be downloaded from here (release notes).
If you are using Visual Studio 2017 and come across this question, you might consider AxoCover. It's a free VS extension that integrates OpenCover, but supports VS2017 (it also appears to be under active development. +1).
VS Extension page
https://github.com/axodox/AxoTools
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With