Skip to main content

Coverage View

  • 2 minutes to read

The Coverage View allows you to find out how much of your code is covered with the unit tests and find the untested cases.

When tests are completed, you can see the information about code coverage. The solution's members and their respective coverage values (percent of the member covered) appear in the tree view.

Coverage View

The following tabs display information about the selected member:

  • Code
    Shows the selected member's code.

  • Details
    Shows the information about the selected code.

  • History
    Displays the commits for the file that contains the selected member.

The toolbar at the top of this view lets you configure contents of the report and search the members tree.

Toolbar Element

Description

Layout Buttons

Specifies the page layout.

Group Buttons

Specifies whether to group members by project, namespace, or type.

Filter Buttons

Specifies whether to show elements having the following coverage intervals:

  • 0 - 25%
  • 25 - 50%
  • 50 - 75%
  • 75 - 100%

Filter Box

Enables you to filter members by name.

#Code Coverage Highlighting

CodeRush Server can highlight code lines to visualize coverage. You can see the highlighted code lines for the selected member in the Coverage View's Code tab.

Highlighted

Green lines in code indicate that the code is covered with tests. Code lines highlighted in red indicate the code is not covered with tests.

#Code Coverage Calculation

CodeRush Server uses the statement code coverage metric to measure code coverage. The Coverage View shows the percentage of statements covered by unit tests for each solution's member.

For example, 4 of 7 statements are covered in the screenshot above. The code coverage is 4 covered statements / 7 statements total = 57.14% coverage.