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.
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 |
---|---|
Specifies the page layout. | |
Specifies whether to group members by project, namespace, or type. | |
Specifies whether to show elements having the following coverage intervals:
| |
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.
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.