Create test coverage
In the Requirements module, you create test coverage by linking tests to a requirement. A requirement can be covered by more than one test.
Test coverage overview
In the Requirements module, you create test coverage for a requirement by selecting tests to link to the requirement. Test coverage assists you in assessing the impact of a change in the requirement or test.
Instead of covering each requirement only at the level of the test, you can cover a requirement by test configurations.
Test coverage is created automatically when you generate a test from a requirement. Therefore, even if you have not yet added test coverage, it may already exist. For details, see Create requirements.
By default, test coverage is available only for the Functional, Testing, and Undefined requirement types; you cannot add test coverage to the Business, Folder, and Group requirement types. To add test coverage to them, you must enable test coverage for these requirement types. For details, see
Note: Alternatively, in the Test Plan module, you create requirement coverage by linking requirements to a test. For details, see Create requirement coverage.
Create test coverage
Create test coverage by linking tests to requirements.
To link tests to requirements:
-
In the Requirements module, select the Requirement Details view.
-
Select a requirement and click the Test Coverage tab. Click the Select button to display the test plan tree in the right pane.
-
Select target tests and click Add to Coverage .
To select test configurations of a test, select the test, at the bottom of the test plan tree, expand the Test Configurations pane, and select target test configurations.
To select multiple tests grouped in the same folder, select the folder and click Add To Coverage.
To associate multiple tests with a requirement when the tests are not grouped in the same folder, filter the test cases (for example by Test Name). Add the matching tests by selecting the root folder of the filter, and clicking Add To Coverage.
Business Process Testing: When adding a business process test that contains criteria and test configurations, the Add Advanced Coverage dialog box opens, enabling you to select criteria and test configurations for the test coverage.
To view or edit test coverage:
-
To view the test coverage of all the children of the requirement, select the Full Coverage option.
-
To view the run status of a test covered by the requirement, from the coverage grid, select the test. Show the lower pane of the grid and click the Coverage Chart tab.
-
To view the status of the configurations of a test covered by the requirement, from the coverage grid, select the test. Show the lower pane of the grid and click the Test Configuration Status tab.
In this tab, you can also add or remove test configurations for the test coverage.
To add or remove test configurations for the test coverage:
-
Select the test from the test coverage grid.
-
In the Coverage Mode column of the gird, select Selected Configurations.
If the column is not shown, click Select Columns to show the column.
-
To remove a configuration, select the configuration and click Remove Configuration.
To add a configuration, click Add Configuration, and select target configurations.
-
Analyze test coverage
You can analyze the test coverage status of your requirements and child requirements.
Define coverage analysis settings
Coverage analysis can be performed based on the Direct Cover Status field values or on the runs of the covering tests that were run in the selected cycles.
To define the coverage analysis settings:
-
In the Requirements module, select View > Coverage Analysis.
-
In the top right corner of the page, next to Coverage analysis, click Settings.
-
In the Analysis Settings dialog box, select one of the following options:
Option Description Coverage analysis Calculates the test coverage status of the requirements based on the Direct Cover Status field values.
Direct Cover Status: The current status of a requirement, determined according to the status of the tests associated with the requirement. A requirement status can be one of the following. By default, the status is Not Covered.
-
Blocked. One or more tests covered by the requirement have an execution status of Blocked.
-
Not Covered. The requirement has not been linked to a test.
-
Failed. One or more tests covered by the requirement have an execution status of Failed, and none has an execution status of Blocked.
-
Not Completed. One or more tests covered by the requirement have an execution status of Not Completed, and none has an execution status of Blocked or Failed. Alternatively, tests covered by the requirement have execution statuses of Passed and No Run, Passed and N/A.
-
Passed. All the tests covered by the requirement have an execution status of Passed.
-
No Run. All the tests covered by the requirement have an execution status of No Run.
-
N/A. The current status of the requirement is not applicable.
-
-----. The requirement does not have a direct cover status as it belongs to a requirement type that does not support coverage.
Execution analysis Calculates the test coverage status of the requirements based on the runs of the covering tests that were run in the selected cycles.
In the Execution Analysis box, click the arrow button to select the cycles for which you want to analyze coverage.
Tests that were not assigned to run in any of the selected cycles are assigned the status No Run. Requirements not covered by any tests are not counted in the analysis.
When the Execution Analysis option is selected, the Direct Cover Status field is unavailable in the Coverage Analysis view.
-
View test coverage analysis
In the Requirements module, select View > Coverage Analysis.
Depending on the coverage analysis settings, the Coverage Analysis view graphically displays one of the following:
-
If the analysis is performed based on the Direct Cover Status field values, the view displays the direct cover status of the requirement and its children. Requirements which do not match the current filter, or requirements with direct cover status "N/A" are not counted in the analysis.
-
If the analysis is performed based on the runs of the covering tests that were run in the selected cycles, ALM does not use the Direct Cover Status field values in its calculations. Instead, it uses calculated direct cover status values based on the tests that have instances belonging to test set folders that are assigned to cycles included in the filter. In this case, requirements that do not have test coverage for any of the cycles in the filter are not counted in the analysis.
View coverage status of a specific requirement
In the Coverage Analysis view, click the bar in the Coverage Analysis column of the requirement. In the graph of the Coverage Analysis dialog box, you can click a section to display a list of child requirements with the selected status.
Copy to Clipboard. Copies a snapshot of the Coverage Analysis dialog box to the Clipboard.
Add Tests Coverage. Opens the Test Coverage dialog box, displays the full test coverage for the requirement, grouped according to test status, and enabling you to add test coverage to the requirement. You can use the Status Filter to view the list of tests with the selected status that cover the requirement and its children
Note: If a parent requirement has several children all of which cover the same test, that test is included only once in the parent requirement's Tests Coverage Chart.
See also: