Set Baseline Polyspace as You Code Results in Visual Studio
For more efficient bug fixing, you can create a local baseline or download a previous Polyspace Bug Finder analysis from Polyspace® Access™ to use as a baseline. You can compare your Polyspace as You Code single-file analysis results against your local baseline or Polyspace Access baseline and focus your review on new results or unreviewed results only.
Baselines contain only results from the Polyspace version used to perform the analysis. For example, a baseline from an earlier version of Polyspace might not contain the same results as an analysis from a later version. Polyspace as You Code displays a warning if you are using a baseline from a different version of Polyspace. You cannot use the results of a Polyspace Code Prover™ analysis as a baseline in Polyspace as You Code.
Note
To keep using the most up-to-date baseline information, make sure that you periodically download results from Polyspace Access. See Download Baseline.
Configure Local Baseline
To create a local baseline, right-click a file in the Solution Explorer view or right-click in the editor and select Polyspace > Create a local baseline. You can also create a local baseline by right-clicking a file in the Quality Monitoring view and selecting Create a local baseline.
When you create a local baseline for a file, Polyspace analyzes the file and uses the analysis results as a baseline. The results of each subsequent analysis of the file are compared against the baseline.
For more information on interacting with baselines in Visual Studio®, see Open Polyspace as You Code Perspective.
Configure Polyspace Access Baseline
To use Polyspace Bug Finder™ Server™ results as baseline for a Polyspace as You Code analysis, follow these steps. If you choose to point to a downloaded baseline, each subsequent run uses the baseline.
Identify Project to Use as Baseline
Identify a project in Polyspace Access that you want to use as baseline. The project must contain results of a Polyspace Bug Finder Server analysis on files that you will analyze in Polyspace as You Code.
Copy the path to the project for use in the Visual Studio extension settings. To copy this path:
Open the Polyspace Access web interface.
On the Project Explorer pane, right-click the project and select Copy Project Path to Clipboard.
Point to Project from Polyspace as You Code
Point to the Polyspace Access project from the Polyspace as You Code extension settings in Visual Studio.
From the Baseline view, click
.
Configure these settings:
Select an option from the Show Baseline information list:
Show local findings and baseline info
— After you download a baseline, findings that are already justified in the baseline run are suppressed in the Error List view.Show new findings only
— After you download a baseline, findings that are already present in the baseline run are suppressed in the Error List view. Use this option to focus only on new findings in your file.
Polyspace Access URL — The URL of the server that hosts Polyspace Access, for example,
https://my-access-url:9443/
.Polyspace Access Login — The username that you use to log in to Polyspace Access.
Project path — The path to the project in Polyspace Access that you want to use as baseline. You previously copied this path from the Polyspace Access web interface.
Download Baseline
Download the Polyspace Access results to use as baseline.
The first time you configure the extension settings, click
in the Baseline view of the Polyspace as You Code perspective.
Click the same icon to download an updated baseline. The icon is available only if you configure the extension to use a Polyspace Access baseline.
The extension prompts you to enter your Polyspace Access password. You have the option to save the password so that you no not need to enter it in subsequent downloads.
An indicator in the Baseline view shows the progress of the download. If there are issues with the download, check the Output pane and select Show output from Polyspace as You Code for details.
Compare Results Against Baseline
When you compare Polyspace as You Code results against a local or Polyspace
Access baseline, by default only results that are new compared to the local
baseline are shown. If you toggle the baseline filter to show all results,
[baseline]
appears next to results that appear in the baseline in
the Problems panel.
In addition, when you use a Polyspace Access baseline:
Results that have a status of
No Action Planned
,Justified
, orNot a Defect
are hidden.Results that have a status of
Unreviewed
,To investigate
,To fix
, orOther
on Polyspace Access carry over all review information to the Result Details view.For example, if a defect has been reviewed and assigned a status of
To investigate
and a severity ofMedium
, the same review information appears in the Comment from baseline section in the Result Details view.If a Polyspace as You Code result also appears in the Polyspace Access baseline, you can open the project that you use as baseline in the Polyspace Access interface. Click
in the Baseline view. See Open Polyspace as You Code Perspective.
You can also open the project on Polyspace Access by running Polyspace: Open Project in Access Web from the Command Palette.
If you use both a local baseline and a Polyspace Access baseline, Polyspace compares the current results to the Polyspace Access baseline first, but uses the local baseline to filter for new results.
In order to keep baselines persistent between sessions of Visual Studio, Polyspace stores both local and Polyspace
Access baselines in your current working directory. If no path is specified in
the Polyspace as You Code settings, the extension uses the subfolder
polyspace_as_you_code
in your system's temp
folder.