Code Coverage Perspective

You can use the Code Coverage perspective to analyze the code coverage results from builds and test runs.

Note

In order to use perspectives with the Team Foundation cube, you must use Microsoft SQL Server 2005 Enterprise Edition or SQL Server 2005 Enterprise (64) Edition on the data tier. SQL Server 2005 Standard Edition that ships as part of Team Foundation Server, does not support the use of perspectives. When you use SQL Server 2005 Standard Edition, the cube elements from all perspectives reside in the Team System data cube.

You can use the code coverage perspective to answer the following types of questions:

  • Which assemblies and projects have the lowest code coverage?

  • Which test runs give you the most code coverage?

  • Which builds have the highest code coverage?

  • Which architectures or build types have the highest code coverage?

Measures

The following table describes the measures that are included in the Code Coverage perspective. This perspective contains two measure groups: Build Coverage, and Run Coverage. The Build Coverage measures should always be used to analyze numbers summarized by build. The measures in the build coverage measure group do not aggregate across multiple builds to return meaningful numbers. For example, if 100 lines are covered in build 1, and 100 lines are covered in build 2, the total coverage may be far less than 200. The same is true for using run coverage that only returns meaningful numbers when filtered or summarized by a test run.

Measure Measure Group Description

Count

Code Coverage from Build

The number of builds that have code coverage statistics associated with them.

Lines Covered

Code Coverage from Build

The number of lines covered in the selected build. If multiple runs are performed against a build, the build coverage reflects the combined coverage of the runs, taking into consideration that there may be overlap in the lines covered across the runs.

Lines Not Covered

Code Coverage from Build

The number of lines not covered in the selected build. If multiple runs are performed against a build, the build coverage reflects the combined coverage of the runs, taking into consideration that there may be overlap in the lines covered across the runs.

Lines Partially Covered

Code Coverage from Build

The number of lines partially covered in the selected build. If multiple runs are performed against a build, the build coverage reflects the combined coverage of the runs, taking into consideration that there may be overlap in the lines covered across the runs.

Blocks Covered

Code Coverage from Build

The number of blocks covered in the selected build. If multiple runs are performed against a build, the build coverage reflects the combined coverage of the runs, taking into consideration that there may be overlap in the blocks covered across the runs.

Blocks Not Covered

Code Coverage from Build

The number of blocks not covered in the selected build. If multiple runs are performed against a build, the build coverage reflects the combined coverage of the runs, taking into consideration that there may be overlap in the blocks covered across the runs.

Count

Code Coverage from Run

The number of test runs that have code coverage statistics associated with them.

Lines Covered

Code Coverage from Run

The number of lines covered by all tests in a run, taking into consideration that there may be overlap in the coverage across the tests.

Lines Not Covered

Code Coverage from Run

The number of lines not covered by all tests in a run, taking into consideration that there may be overlap in the coverage across the tests.

Lines Partially Covered

Code Coverage from Run

The number of lines partially covered by all tests in a run, taking into consideration that there may be overlap in the coverage across the tests.

Blocks Covered

Code Coverage from Run

The number of blocks covered by all tests in a run, taking into consideration that there may be overlap in the coverage across the tests.

Blocks Not Covered

Code Coverage from Run

The number of blocks not covered by all tests in a run, taking into consideration that there may be overlap in the coverage across the tests.

Dimensions

The following table describes the attributes that are included in the Code Coverage from the Build perspective. You can aggregate the measures along each of these attributes.

Attribute Dimension Description

Date

Date

The date on which the Run or Build coverage statistics were collected. This dimension should be used together with builds or runs to show the date of a specific build or run. Aggregating coverage measures, if there are no builds or runs, will not consider overlapping code coverage.

Build

Build

Number or name used to uniquely identify the build.

Build Type

Build

Name of the build type. Set in the New Team Build Type Creation Wizard. For more information, see How to: Create a New Build Type.

Selected from the Team Builds node in Team Explorer. For more information, see How to: Run a Build on a Build Type.

Build Start Time

Build

Date and time the build began.

Team Project

Team Project

The project against which the coverage statistics were published.

Platform

Platform

The platform for which the build was made. The possible values include the following:

  • X86

  • X64

  • Itanium

  • Win32

  • Any CPU

  • .NET

  • Mixed Platforms

  • Any valid platform created by the process template.

Build Flavor

Flavor

The configuration of the build. The possible values include the following:

  • Debug

  • Release

  • Any valid configuration created by the process template.

Set in the New Team Build Type Creation Wizard. For more information, see How to: Create a New Build Type.

Run

Run

The test run ID that was used in generating Run Coverage statistics.

Remote Run

Run

A True/False flag that indicates whether the test run that generated the coverage statistics was a remote test run.

Assembly

Assembly

The assembly name against which the coverage statistics were generated.

See Also

Concepts

Code Coverage Schema

Other Resources

Understanding the Structure of the Data Warehouse Cube
Perspectives