Main Content

Import Review Information from Previous Polyspace Analysis

This topic describes how to import review information from previous results that are not already uploaded to Polyspace® Access. For information on importing from results uploaded to Polyspace Access, see Import Review Information from Existing Polyspace Access Projects (Polyspace Access).

After you have reviewed analysis results, you can reuse information from the review for subsequent analyses. If you specify a result status or severity or add notes in your results file, they carry over to the results of the next analysis on the same project. If you add the same information as comments to your code (annotate), they carry over to any subsequent analysis of the code, whether in the same project or not. You can also hide results using code annotations. For more information on commenting, see Address Results in Polyspace User Interface Through Bug Fixes or Justifications.

This topic shows how to import review information from one result file to another. Importing the review information saves you from reviewing already justified results. For instance, after you import the information, on the Results List pane (user interface of desktop products), clicking the icon skips justified results. Using this icon, you can browse through unreviewed results. You can also filter the justified checks from display.

Automatic Import from Last Analysis

By default, review information is imported automatically from the most recent analysis on the project module. You can disable this default behavior in the Polyspace desktop user interface.

  1. Select Tools > Preferences, which opens the Polyspace Preferences dialog box.

  2. Select the Project and Results Folder tab.

  3. Under Import Comments, clear Automatically import comments from last verification.

  4. Click OK.

The capability to disable automatic import from last analysis is not available in the Polyspace Platform user interface.

If you run analysis at the command line (and do not upload results to the Polyspace Access web interface), you have to explicitly import from another set of results. See Command Line.

Import from Another Analysis Result

You can import review information directly from another Polyspace result to the current result.

If a result is found in both a Bug Finder and Code Prover analysis, you can add review information to the Bug Finder result and import to the Code Prover result. For instance, most coding rule checkers are common to Bug Finder and Code Prover. You can add review information to coding rule violations in Bug Finder and import to the same violations in Code Prover.

User Interface (Desktop Products Only)

To import review information from another set of results:

  1. Open the current analysis results.

  2. Select Tools > Import Comments.

  3. Navigate to the folder containing your previous results.

  4. Select the other results file (with extension .psbf or .pscp) and then click Open.

    The review information from the previous results are imported into the current results.

Polyspace Platform User Interface

To import review information from another set of results:

  1. Open the current analysis results.

  2. Select Import Comments from the toolstrip.

  3. Navigate to the folder containing your previous results.

  4. Select the other results file (with extension .psbf or .pscp) and then click Open.

    The review information from the previous results are imported into the current results.

Command Line

Use the option -import-comments during analysis to import comments from a previous verification.

To import review information from multiple results, use the polyspace-comments-import command.

Import Algorithm

You can directly import review information from another set of results into the current results. However, it is possible that part of your review information is not imported to a subsequent analysis because:

  • You have changed your source code so that the line with a previous result is not exactly identical to the line in the current run.

    The comment import tool accounts for additional code that simply shifts an existing line. For instance, the tool recognizes that line 10 in Run 1 and line 12 in Run 2 have the same statement. If a division by zero occurs on line 10 in Run 1 and you have not fixed the issue in Run 2, the result along with associated review information are imported to line 12 in Run 2.

    • Run 1:

      10 baseLine = min/numRecipients;
      11 
      12 
    • Run 2:

      10 /* Calculate a baseline per recipient
      11    based on minimum available resources */
      12 baseLine = min/numRecipients;

    However, if you change the line content itself, for instance, change numRecipient to numReceiver, the result and review information are not imported.

  • You changed your source code so that the Code Prover result color has changed.

  • You entered new review information for the same result.

  • You removed a source file that had review information associated with it. When you remove a file from a project and run an analysis, Polyspace does not import the review information associated with the file in subsequent runs. Even if you add the file back to the project, Polyspace treats the file as a new file and does not import review information from old runs.

If the content of a line does not change and shows the same result as the previous analysis, the review information is imported. In unlikely scenarios, you might get the same result on the same line despite changing previous lines that lead to the result. Your review information from a previous analysis is then imported to the new result. If you justified the previous result with a status such as Not a defect, it is likely that you want to continue this justification with the new result. For instance, if you accepted an overflow previously because you accounted for a wrap-around behavior after the overflow, you are likely to accept the overflow whatever the cause. In a few cases, you might want to review the result again and might not be aware that the result merits another review. To avoid this situation:

  • When justifying nonlocal results that are related to previous events, use careful judgement.

  • For critical components, conduct periodic assessments of justified results to see if the justifications still apply. Such assessments are useful specially for the Code Prover run-time checks.

View Imported Review Information That Does Not Apply

In the Polyspace user interface (desktop products only), the Import Checks and Comments Report highlights differences between two analysis results. When you import review information from a previous analysis, you can see this report. If you have closed the report after an import, to review the report again:

  1. Select Window > Show/Hide View > Import Comments Report.

    The Import Checks and Comments Report opens, highlighting differences in the two results.

    Import Checks and Comments Report window

  2. Review the differences between the two results.

Your review information can differ between two results because of the following reasons:

  • In Code Prover, if the check color changes, Polyspace imports the Comment field but not the Status field. In addition, Polyspace imports the Severity and Justified fields depending on the color change.

    Color ChangeSeverityJustified
    Orange or red to greenNot importedImported
    Gray to greenNot importedImported, if the Severity was set to High, Medium or Low.
    Red to orange or vice versaImportedImported
    Green to red/orange/grayNot importedNot imported
  • If a result no longer appears in the code, Polyspace highlights only the change in the Import Checks and Comments Report. It does not import review information from the previous result.

  • If you have already entered different review information for the same check, Polyspace highlights only the change in the Import Checks and Comments Report. It does not import review information from the previous result.

See Also

|

Related Topics