This topic explains how to view C/C++test results and customize their presentation. 

Accessing Results

Results from testing performed in the GUI can be reviewed:

Results from testing performed in the command line can be reviewed in C/C++test reports (see Generating Reports in the Command Line).  If publishing results to DTP is enabled, results sent to DTP can be imported into your IDE, where you can review them via C/C++test views. See Generating Reports in the Command Line and Importing Results into the UI for details.

Test Progress View

Results from testing performed in the GUI can be accessed via the Test Progress view. The view allows you to first monitor the progress and status of the process, then access the results and review the report. To manually open the view, go to Parasoft> Show View> Test Progress. When the test is run, the label of the view is changed to indicate which test configuration is run. In the following example, the Test Progress view shows the status of a built-in test configuration "Recommended Rules".

Click the Review tasks button to display the results in the Quality Tasks view.

Click the Generate Report button to open the Report & Publish dialog.

The Report & Publish dialog allows you to configure your report preferences. See Generating Reports for details.

Quality Tasks  View

Your assigned quality tasks generated during interactive testing or imported from command-line tests are shown in the Quality Tasks view. If this view is not available, choose Parasoft> Show View> Quality Tasks to open it. To see additional details, drill down into the Quality Tasks view tree. To toggle through the items reported in this view, use the arrow buttons in the view’s toolbar.

The results are presented as a task list that helps you determine how to proceed with testing and code improvement. Tasks are organized by author, category, then by severity (if assigned). Severity levels range from 1 to 5— Severity 1 tasks are estimated to have the greatest chance of eliminating or preventing a critical bug, while Severity 5 tasks are estimated to have the least chance of eliminating or preventing a critical bug.

Source Code Markers

For tests that were run on source files, results are also reported at the source code level.

If you open the editor for a tested source file, markers will be placed next to the source code responsible for problems found. For static code analysis violations, markers are placed next to the line of code responsible for the violation. For unit test errors, markers are placed on the first line of the stack trace that matches the tested class. For unit test failures or for errors where the tested class is not known, markers are placed on the first line of the stack trace that matches the unit test class. To learn what problem a particular marker indicates,  place your mouse over the marker and review the information in the popup window. Or, to go directly to the related Quality Tasks view  message, right-click the source code responsible for the problem, choose Show In> Quality Tasks (for Eclipse) or Parasoft> Show in Quality Tasks

Console View

To see testing details, open the Console view during test execution. Testing details are reported here when a test is in process, and remain there until they are cleared or until another test is run.

Test Case Explorer View

The Test Case Explorer indicates the status of all available test cases. Red is used to mark the complete path to a failure.

To view tasks related to a test listed in the Test Case Explorer, right-click that test’s Test Case Explorer node, then choose Show in Tasks. This will display tasks related to that test will then the Quality Tasks view.

Many tree nodes report the line number at which an error or possible problem occurred. To view the related code, double-click the node that shows the line number, or right-click that node and choose Go to from the shortcut menu. The related editor will then open and highlight the designated line of code.

See About the Test Case Explorer for details about Test Case Explorer.

Customizing the Results Display

There are several ways to customize the results display to preferences and needs for reviewing quality tasks.

Filtering Results

By default, the Quality Tasks view shows cumulative results for all tested resources. For example, if you imported results to your IDE, and then ran two tests from the GUI, the Quality Tasks view would show all imported tasks, plus all results from the subsequent two tests. You can filter results to only display results from the last test session or selected resources.

If you prefer to see only results from the last test session or from selected resources, you can filter results.

  1. Click the Filters.. button in the Quality Tasks view to open the Filters dialog.
  2. Specify your filter preferences.
    - Enable the Show only last session tasks to only display tasks from the most recent code analysis or test execution.
    - Enable the Limit visible tasks to: option to specify the maximum number of tasks shown in the Quality Tasks view.
    - Enable one of the options in the Scope section to narrow down the displayed tasks to a selected scope.

Changing the Display Format and Contents

You can change the Quality Tasks view’s format and contents by:

Selecting Layout Templates

There are several available layout templates:

  • Details: Shows category, subcategory, task type, package or namespace, and location organized by task type.
  • Test Cases: Shows tests organized by test names.
  • Tested Files: Shows the location of the issue detected; organized by file names.
  • Tested File and Category: Shows the category and location of the issue detected organized by file names.

To select the layout best suited to your current goal:

  1. Open the pull-down menu on the top rightof the Quality Tasks view.

  2. Choose one of the available formats from the Show shortcut menu that opens.

Customizing Layout Templates

To customize one of these preconfigured layouts:

  1. Open the pull-down menu on the top right of the Quality Tasks view.
  2. Choose Configure Contents.
  3. In the dialog that opens, specify how you want that layout configured. Note that Comment shows the comments that were entered upon source control commit.

Adding New Layout Templates

To add a new layout template:

  1. Open the pull-down menu on the top right of the Quality Tasks view.
  2. Choose Configure Contents.
  3. Click the New button on the bottom left of the dialog that opens.
  4. Select (and rename) the added template, then specify how you want that layout configured. Note that Comment shows the comments that were entered upon source control commit.

Changing Categories from the Quality Tasks View

To re-order, hide, and remove categories directly from the Quality Tasks view:

  1. Right-click the item in the Quality Tasks view.
  2. Choose from the available Layout menu options.

Working with Results in the Quality Tasks View

In the Quality Tasks view, C/C++test results are presented as a task list that helps you determine how to proceed in order to ensure the quality of your system.

Tasks are organized into the following categories:

  • Fix Static Analysis Violations: This category contains static analysis violations that should be corrected or suppressed. It also includes problems identified by Flow Analysis.
  • Fix Unit Test Problems: This category contains unit test problems—including functional test failures, unexpected exceptions, and timeouts—that need to be addressed.
  • Review Unit Test Outcomes: This category contains unverified outcomes for test cases that were created during automated test case generation. Unverified outcomes are reported when C/C++test executes automatically-generated or user-defined test cases with postconditions that have not yet been converted to assertions The outcome might be the expected behavior, or it might indicate a problem. Further review and verification is required.  If you determine that the outcome reflects the expected behavior, you verify it. If not, you specify the correct outcome.
  • Fix Runtime Error Detection Violations: This category contains runtime errors detected when executing unit test cases or running the application.

For details on how to explore and address errors reported for a specific type of analysis, see the following topics:

Matching a Task to a Related Test Configuration

For any task reported in the Quality Tasks view, you can open the test configuration which caused that task to be reported. This is particularly useful if:

  • You want to review or modify the setting that caused that task to be reported.
  • You imported results from server execution and you want to know which test configuration was run when this task when generated.

To view the test configuration that caused a specific task to be reported, right-click that task, then choose View Test Configuration. This will open the appropriate test configuration and go directly to the test configuration options that are related to the given task. For instance, if a static analysis task was selected, the Static tab will be opened and the corresponding rule will be highlighted.

Clearing Messages

You might want to clear messages from the Quality Tasks view to help you focus on the findings that you are most interested in. For example, if you are fixing reported errors, you might want to clear each error message as you fix the related error. That way, the Quality Tasks view only displays the error messages for the errors that still need to be fixed.

Messages that you clear will only be removed temporarily. If the same findings are achieved during subsequent tests, the messages will be reported again.

You can clear individual messages, categories of messages represented in the Quality Tasks view, or all reported messages.

Clearing Selected Messages

To clear selected messages shown in the Quality Tasks view:

  1. Select the message(s) or category of messages you want to delete. You can select multiple messages using Shift + left click or Ctrl + left click.
  2. Right-click the message(s) you want to delete, then choose Delete.

The selected messages will be removed from the Quality Tasks view.

Clearing All Messages

To clear all messages, click the Delete All icon at the top of the Quality Tasks view.

Using Quick Fix (R) to Automate Error Resolution

The Quick Fix (R) feature can be used to  automate actions commonly performed while reviewing and responding to unit test findings. Any finding that has a Quick Fix is marked with a yellow lightbulb icon. To automatically fix a problem marked with this icon, right-click the part of the message marked with the Quick Fix icon, then choose one of the available  Quick Fix commands (marked with yellow lightbulb icons) from the shortcut menu.

For details about using Quick Fix for unit test results, see Using Quick Fix (R) to Respond to Test Execution Findings.

  • No labels