NCover Documentation

Coverage Metrics

NCover generates coverage data when an execution is completed successfully. Using the Visual Studio plug-in, this coverage data can be viewed in a variety of ways, detailed in the Viewing Coverage Data section.

NCover helps you make sense of your coverage data by providing statistics at the source code level like Sequence, Branch and Method, and the high-level view of Change Risk Anti-Patterns, and Complexity.

More About CRAP

Metrics like the Change Risk Anti-Patterns (CRAP) score are a better measure of risk than coverage alone. Since it's extremely difficult to get to full coverage, CRAP score weighs the amount of uncovered code against the complexity of that code. Code that is more complex typically needs more complete coverage, because the more complex it is, the more likely it is to have errors. CRAP score finds methods that are least covered for a given level of complexity.

The following metrics will help you get the most out of the data NCover provides, especially when used in conjunction with their customizable thresholds (see Thresholds for details):

Branch Coverage -- The percentage of individual branch points covered in the testing of the selected execution.

Sequence Point Coverage -- The percentage of sequence points (break points) covered in the testing of the selected execution. The most granular level of coverage, Sequence Point gives a very detailed view of which code has been executed and which code has not.

Max CRAP Score -- The highest Change Risk Analysis and Predictions (CRAP) number in the selected execution. Max CRAP score helps you identify at a glance the most complicated, and risky, parts of the code.

CRAPpy Methods -- Which methods have the highest Change Risk Analysis and Predictions (CRAP) numbers in the selected execution. Max CRAP score helps you identify at a glance the most complicated, and risky, parts of the code.

Max Complexity -- A method's complexity is measured by the number of linearly independent paths from the start of the method to an exit point. In general, the more complex a method is, the harder it is to test or maintain, and the more likely it is to contain bugs or implementation errors.

(Meets) Satisfactory Complexity -- Find out if the complexity of your methods, as defined above, exceeds a user-defined threshold.

Method Count -- The number of methods in the selected execution.

Namespace Count -- The number of globally unique types in the selected execution.

Type Count -- The number of data classifications in the selected execution.

Document Count -- The number of Visual Studio source documents in the selected execution.

Lines of Code -- The number of source code lines in the selected execution.

<<<<<<< HEAD Condition Coverage

A brand-new core metric has been brought to the .NET code coverage arena.

NCover's Condition Coverage is the first metric of its kind to provide empirical data covering the connections between code branches.

As interpreted by NCover, a code branch is a set of instructions in the IL which must be executed in sequence. Every method is broken into a set of distinct branches. Conditions for arriving at those branches are now reported as covered or uncovered via the Condition Coverage metric.

A typical branch segment will have one or two exit edges in the execution graph, but branches for switch statements could have a potentially unlimited number of exit edges.

Each of those edges is tracked and reported as covered or uncovered using this new metric.

This metric enhances the meaning provided by Branch Coverage Visualization and provides better feedback for coverage in loops and switch statements.

docs-temp

If you still need technical assistance, we can help:

Submit A Support Ticket