Reputation: 1094
I have inherited a rather large solution and I am using Visual Studio 2013. There are hundreds of built test methods that have already been made. I also know that the coverage is not 100%. Is there a way to get a list of all the methods that can be tested but have not had a test method written for them yet? Perhaps there is some utility out there that could do this?
Upvotes: 0
Views: 326
Reputation: 1808
You need a Code Coverage tool for this. NCover would be one example but there are many others which you can research by Googling something like "C# code coverage tools". OpenCover is another example.
Code Coverage tools usually generate reports which provide breakdowns by line, by method, by class, by namespace etc. These reports will quickly show you which methods are not covered and which assemblies have the lowest proportion of covered methods. Often the reports will include a set of html pages which you can use to browse the results, or some other graphical way to absorb the information.
Generally, you would configure your build server to run your tests "with coverage" and then publish the coverage report as an artefact of the build. However, it is possible to run your tests on your local machine "with coverage" too and many code coverage tools will have Visual Studio extensions that will allow you to run tests with coverage just as easily as running without.
As always, you can also run the tools from the command line if there is no Visual Studio extension or plugin for your build server.
Upvotes: 1