Missing code coverage tab in VS localtestrun.testrunconfig? - c#

I am relatively new to unit testing and was attempting to add some code coverage to my unit tests. Yet i can't find the code coverage tab in Visual Studio 2008 in the localtestrun.testrunconfig, is there any missing Add-in or tool?
Thanks,
DMS

As I understand "Code Coverage" is available only in "bigger" editions of Visual Studio 2008. In other words, this feature is NOT available in the "Visual Studio 2008 Professional Edition".
Which edition of Visual Studio 2008 are you using ?
MSDN Link

Go to the menu Test, select Edit test run configuration for your current test run and check enable code coverage. Then perform a run and then on the test run results you can choose to display code coverage.

Related

How to run an NUnit test in VisualStudio with OpenCover code coverage?

I am new to NUnit testing. I was able to write test cases for my functions, now what I want is to know the code coverage for my test cases. For that I use OpenCover. But I don't know how to install and get OpenCover to work with Visual Studio 2015, can anyone guide me to install OpenCover for Visual Studio and provide help to see the code coverage in Visual Studio?
The best solution I found for code coverage in Visual Studio is as follows:
Open Visual Studio 2017
Go to Tools->Extensions and Updates
Go to "Online", in the search (top right of the window) type
"AxoCover"
Click install, follow the instructions (i.e. close Visual Studio to
start the install)
Reopen Visual Studio
Build your project
Go to Tools->AxoCover
Under the "Tests" tab right click your top directory and go "Cover
tests"
Click on the "Report" tab
You need some VS extension to include the coverage results in VS.
One example:
https://visualstudiogallery.msdn.microsoft.com/6950a046-8919-4935-8542-c6f37956f688/view/
you need OpenCover installed/present in solution
you need NUnitConsole installed/present in solution
it does not support VS2017
NUnit3 supported only when you do a custom build from git (not in latest release)
I have nothing to do with this extension, it is just working for me. Use at your own risk :)
If you mean it and you can spent some $ go for http://www.ncrunch.net/

Is code coverage included with Visual Studio Team Services (Visual Studio Online) packages

Is code coverage supported with Visual Studio Team Services by default, and can the team check the coverage result on their local visual studio instances? (coloring the coverage).
Yes, when you add "Visual Studio Test" step in your build definition, you can check the "Code Coverage Enabled" option:
And then you can see the code coverage information in the build report:
You can also download the code coverage results file into your local machine but you need to use VS Enterprise edition to open it.

Visual Studio 2012 menu 'analyze code coverage' is missing

There is this great tool in Visual Studio 2012 to show the test coverage of the source code. On the official MSDN homepage it is shown under menu Test -> Analyze Code Coverage.
But in my Test menu this entry is missing and I could'nt figure out why. Can someone please explain? Am I missing an addon/plugin?
Update: Visual Studio 2012 Professional with Update 3.
According to the MSDN page you linked:
Requirements
Visual Studio Ultimate, Visual Studio Premium
So it will not be available on Professional.
Code coverage is available in premium and ultimate flavors of Visual Studio 2012.
A free alternative is the OpenCover: https://www.nuget.org/packages/OpenCover
This doesn't work on VS2012, but if you happen to be using a more recent version https://opencppcoverage.codeplex.com/ has a VS plugin.

Running Visual Studio 2010 UI tests not on Ultimate

I have built a test with UI automation using Visual Studio 2010 Ultimate. I would like to run the test on computers that have other editions of Visual Studio 2010 installed, not Ultimate. However when I try to use mstest\testcontainer:tests.dll (the dll file of the test with the debug library) there was error that it was missing one of the test files.
Is there a way to run a UI test on a computer without the Ultimate edition? Thanks.
Coded UI Tests only run with VS Ultimate and VS Premium.
Here is an overview showing which VS edition supports which testing features: http://www.microsoft.com/visualstudio/en-us/products.
Here is the screenshot of the link above, just in case the URL shouldn't work anymore one day:
If you're referring to the Coded UI tests, it's only available on the Ultimate or Premium versions of VS2010. If a user is using the Express or Professional, they just won't be able to do it.
If upgrading those users to Ultimate/Premium isn't an option, you might want to look at a different UI testing tool.

Code Coverage Tools & Visual Studio 2008 Pro

Just wondering what people are using for code coverage tools when using MS Visual Studio 2008 Pro. We are using the built-in MS test project and unit testing tool (the one that come pre-installed with MS VS 2008 pro)!
NCover is a very popular choice.
I would suggest that you go with NUnit for tests and NCover for coverage.
If you use the TestDriven.Net addin you will get a very good unit test runner and NCover thrown in as well. Get the personal developer version. This is realy the best ever addin for visual studio.

Categories