Setting the code coverage thresholds

You can set code coverage thresholds to decide whether a result is passed, warning, or failed.

About this task

In the Code Coverage Results view, you can check the status of a result.
  • If the coverage percentage is smaller than the failure threshold, the Failed icon (Red alert) is displayed in the Status column.
  • If the coverage percentage level is smaller than the warning threshold, but greater than or equal to the failure threshold, the Warning icon (Red alert) is displayed in the Status column.
  • If the coverage percentage is greater than or equal to the warning threshold, the Passed icon (Check mark) is displayed.
If the coverage percentage is greater than or equal to the warning threshold, the Passed icon (Check mark) is displayed.
In web-based reports, you can check the status of each module, file, or flow point in a result.

By default, a code coverage result uses a failure threshold of 80% and a warning threshold of 90%. You can specify different values on the File Analysis Defaults preference page.

Procedure

To specify the thresholds, complete the following steps:

  1. Click the drop-down menu icon on the toolbar and select Preferences from the menu.
    click on the view menu and select Preferences
    The Preferences window opens.
  2. On the File Analysis Defaults page, enter values in the Failure Threshold(%) and Warning Threshold(%) fields.
    On the File Analysis Defaults page, enter values in the Failure Threshold(%) and Warning Threshold(%) fields.
    Note: The value for Warning Threshold (%) must be larger than or equal to that for Failure Threshold(%). If the value for Warning Threshold (%) is the same as that for Failure Threshold(%). The warning status is not available.
  3. Click Apply and Close.

Results

The newly-specified values are applied in the Code Coverage Results view and web-based reports.

When you export results in PDF format, you can set a specific code coverage acceptance level in the PDF Properties window.