What is code coverage?

Code coverage is a measure used in software testing that describes the degree to which the source code of a program has been tested. The analysis finds the following areas

 Finding areas of a program not exercised by a set of test cases

 Where developers need to create more test cases to increase the coverage

Code coverage doesn't directly help you write better code, but it does help you write better tests, which in turn help you write better code. Code coverage will uncover execution paths that are not being exercised by your tests.

Code coverage Instrumentation

Code coverage is a feature available in Visual Studio Team Edition for developers, testers and in Team suite also. Visual Studio uses block based statement (also known as C1 coverage) and condition coverage methodology. A block is commonly defined as a sequence of instructions that have a single entry point and a single exit point. We can consider an exit point to be a branch instruction, a function call, a return instruction or a throw instruction.

To get the coverage of source code, the test assemblies need to be instrumented by having MSTest.exe in place with MSBuild commands or through VSTS instrumentation options. Once the instrumentation is done the coverage file will be available for getting reports out of it.

VSTS is capable of opening the coverage file but if you want to open in some other reporting tool, you should convert the coverage file to the intended format of that reporting tool.

Ref: http://msdn.microsoft.com/en-us/library/ms182534(VS.80).aspx


XTCover – An Intro

It stands for eXTreme COVERage, a web based .NET code coverage reporting tool. It provides the coverage summary in an enhanced way by using web technologies such as ASP.NET 3.5, Silverlight 3 to reveal very decent look and feel and user friendly navigation options. The main intention of this tool is that developers can be focused on the code areas where they should give more attention to increase the coverage of the source code.

The tool can be integrated with continuous integration process or leverage as a stand-alone coverage reporting tool. Besides that the tool is capable of automating MSTest coverage instrumentation process.




Features of the tool

1. Capable of MSTest instrumentation and creation of coverage source
based on required parameters (VSTS license is required)

2. Developers can choose their specific coverage source for reporting

3. Easy navigation to show coverage statistics, aggregates and graphs
for module, namespace, class, method and line level

4. Tag cloud reports from module or package to class level

5. Source code display for respective classes and methods and highlighting
covered / non-covered / partially covered lines of code

6. User will be focused to specific line level by selecting method names

7. Tool can be integrated with Continuous Integration process or can be
used as a stand-alone product

XTCover Dashboard Look and Feel






Related Articles

http://social.msdn.microsoft.com/forums/en-US/tfsbuild/thread/9d7ce662-3539-4dc7-a007-cf57ad2ef859/

http://arcware.net/executing-vsts-unit-tests-and-code-coverage-from-the-command-line/


Last edited Feb 4, 2010 at 1:23 AM by sndshreeman, version 1

Comments

No comments yet.