In this section:

Overview

The Coverage Explorer allows you to navigate the source tree to see file- and method-level coverage information. Click on a coverage widget in the Report Center dashboard view to access the coverage explorer (see Widgets). The Coverage Explorer is divided into five sections:

  1. Search panel - see Using the Search Panel
  2. Coverage tree panel - see Navigating the Coverage Tree Panel
  3. Source panel - see Viewing Source Coverage
  4. Details panel - see Viewing Details
  5. Tests table - see Viewing Test Information

Using the Search Panel

The Coverage Explorer opens using the settings of the coverage widget you clicked as search parameters, but you can easily change the search to learn about the state of coverage in your application. Click Change Search to open the Search Options.


You can configure the following search settings:

Filter and Target Build

Choose a filter from the Filter menu. A filter represents a set of run configurations that enable custom views of the data stored in DTP. Run configuration represents of series of test execution and/or code analysis runs. Runs with the same engine (Jtest, C++test, dotTEST, SOAtest), DTP project, test configuration, and session tag are grouped into the same run configuration. See Configuring Filters to learn more about filters in Report Center.

Choose a build from the Target Build menu to set as the target build. This menu lists build IDs associated with the filter.

Coverage Image

Coverage images are identifiers for the coverage data associated with a test run. Coverage images are automatically created when test data is reported to DTP with the report.coverage.images setting configured. Choose a coverage image from the menu. See Associating Coverage Images with Filters for additional information.

Coverage Threshold

You can set a range in the coverage threshold search option to constrain which files or methods appear in the search results based on the reported coverage.  Enable either File or Method to specify the scope of the threshold and move the sliders to define the range.

The coverage tree panel may show nodes that are outside the defined threshold. In the following example, the coverage threshold setting is configured to show methods with 50% coverage or less:

The overall coverage for the file containing the methods is 53.33%. This is because the combined coverage of all methods in the file raises the coverage above 50%. The file contains other methods that are filtered out per the coverage threshold setting with higher levels of coverage. If the scope is changed from Method to File, the file with 53.33% coverage in the same package is filtered out.

Showing nodes that are outside the range of coverage specified in the coverage threshold setting is expected behavior when the elements are necessary to render the tree per the defined scope.

Filter Resource Groups and Resource Groups

A resource group is a collection of resources (files and/or folders) defined by a set of one or more Ant-style file patterns. Resource groups enable you to view coverage for specific subsets of the code.

If resource groups have been configured for the project, you can add/remove resource groups to/from the search scope. See Adding Resource Groups to Projects for additional information.

Filter Resource Groups are resource groups that have been associated with the Filter. See Associating Resource Groups with Filters for more info.

The Resource Groups section allows you to add/remove resource groups to/from the search scope.

Include and Exclude File Pattern

In addition to other filtering mechanisms available in the Search Options panel, you can specify Ant-style file patterns in the Include File Pattern and/or Exclude File Pattern fields to further refine your search. See Using File Patterns in DTP for more information about configuring file patterns.


How Resource Groups and File Patterns Work

For searches made with both filter resource groups and resource groups, a resource must be included in at least one of the selected filter resource groups and one of the selected resource groups to be returned.

For searches made with filter resource groups and resource groups that also use ad hoc include/exclude file patterns, a resource must be included in at least one of the selected filter resource groups and one of the resource groups, plus it must satisfy the include/exclude file patterns specified to be returned.

Navigating the Coverage Tree Panel

The coverage trees panel displays a hierarchical view of the files within the search parameters. Each node in the hierarchy shows how much of each file or directory is covered in brackets.

You can perform the following actions:

  • Click on a disclosure triangle to navigate the tree. When an item is loaded that does not have any siblings, its children are automatically loaded and displayed. This behavior will cascade until the tree reaches a branch with multiple items at the same level (a decision point) or until the branch cannot be expanded any further. The coverage tree panel will not automatically expand nodes again if it has been previously expanded and collapsed unless the search criteria has changed, or the page has been reloaded.

  • Click on a file or directory view the information about the file or directory in the details panel. See Viewing Details for more information.

  • Click on a file to view the contents in the source panel. See Viewing Source Coverage for more information.

Viewing Runtime Coverage Data

If you are collecting Application Coverage, there may be times when only the runtime coverage data is sent to DTP (without corresponding static coverage data).  In these instances, there will be a node in the Coverage Tree Panel called "Runtime" with child nodes for all runtime coverage data that was collected.

Viewing Source Coverage

Click on a file or function in the search results panel to view it in the source panel. You must have permissions to view source code in Report Center explorer views (see Permissions for more information).

Line-by-line coverage information is color coded:

  • Green lines are lines that are covered with a test.

  • Red lines are not covered.

Viewing Details

The details panel shows information about the selected directory, file, function, or method selected in the search results panel.

Viewing Test Information

The test information table shows all the tests that covers one or more lines of the selected source code. Click on a file that contains covered functions to view test information.

You can perform the following actions:

  • Click on a column header to sort the table.

  • Click on a test in the Test Name panel to view the test in the test explorer. See Test Explorer for more information.

  • Click the View all tests link to open all tests shows in the table in the test explorer. See Test Explorer for more information.


  • No labels