
In some situations, lower coverage is acceptable.
#Visual studio extensions code coverage code#
Development teams typically aim for about 80% Code Coverage.


Instrument DLLs in the Visual Studio Command Prompt using Vsinstr.exe -coverage.Compile the solution and copy the DLLs and PDBs from the Debug folder to the new folder.The following is the procedure to set up Code Coverage in Visual Studio using the Command line: Set Up Code Coverage using the Command line Run your test scenario and in the "Test Tools" toolbar, click the icon "Code Coverage Results".In the "Code Coverage Detail" dialog select the assemblies to instrument for Code Coverage.In the list of roles, select "Code Coverage" and immediately click the '"Configure" button.In the "Test Settings" dialog, choose the "Data and Diagnostics" item.Double-click the ".testsettings" file in the Solutions Items folder in the Solution Explorer window.The following is the procedure to set up Code Coverage in Visual Studio: Using the Code Coverage feature we can determine how much code is being tested and we can reduce the number of bugs.

To determine what portion of your project's code is actually being tested by coded tests such as unit tests, you can use the Code Coverage feature of Visual Studio. Removing dead/unreachable code will help to improve the Code Coverage percentage.
#Visual studio extensions code coverage how to#
In my previous article I demonstrated how to do code analysis to remove dead code from a project.
