The Coverage tab lets you find untested parts of your program's thread synchronization code.
If the Coverage tab isn't visible, use the Data Views menu to set which views are shown.
Read on, or click a part of the image below to jump straight to the help for that area.
Inspecting the coverage tells you which thread synchronization locations are or are not being tested.
Understanding the thread coverage helps you plan and improve your regression tests to include areas of code that perform thread synchronization but are not yet being visited.
The display shows two resizable panes, one with the coverage data, and the other shows source code when you click on a row in the table.
In order to gather coverage statistics, you'll need to switch on the thread coverage setting, otherwise you'll just see the reminders below:
Each file's row is coloured according to whether it has:
no lines visited
some lines visited
all lines visited
been filtered out for subsequent sessions (see below)
The % Visited column and the source code view uses the following colours:
for the percentage of lines visited, or visited lines of source code
for unvisited lines
The data in each column is summarised below
•File •Num Lines •Num Visited •Visit Count •% Visited •DLL |
the statistics are gathered for each source code file found number of lines in each file that allocate, reallocate or free memory and handles the number of those lines that have been visited total number of visits to those lines the percentage of relevant lines visited (Num Visited / Num Lines) the DLL responsible for the file |
The Visit Count may be equal to the Num Visited if you have opted to keep the default thread coverage setting of counting visits to each allocation only once. You can change this setting on the fly to start counting multiple visits right away.
At the top of the table is a Totals line showing combined results for all files.
The statistics here only cover lines that affect thread synchronization, unlike SoftwareVerify's sister tool Coverage Validator which determines complete code coverage.
Sorted columns are highlighted yellow in the table header. Click on the header to change the sorting column or its sort direction order.
The source code view is syntax-highlighted with green visited and pale red unvisited lines.
The columns at the left show line numbers (in black) and visit counts (blue) for each thread synchronization line. Visit counts are also available via a tooltip.
The following controls are displayed to the left of the coverage results
Unwanted results in the coverage can be excluded via the filters according to filename, directory or DLL.
Filters can be managed in the filters dialog or added via the menu options below.
•Filters... shows the Thread Coverage Filters dialog
The filters dialog is the same one as found on the thread coverage page of the global settings dialog where it is described in detail.
The data and source code panes can be arranged horizontally or vertically with the orientation button.
•Update Interval (s) automatically updates the display at your choice of interval between 0.1 and 60 seconds - or not at all!
Adjust this depending on the complexity of your application.
•Refresh updates the display - as does the button on the Tools menu and toolbar, and the button on the popup menu
With an update interval set to No Update, you'll need to use this Refresh button to update the display when you wish.
On the Coverage tab, there's only the one display option:
•Show Path shows the short file name or the longer file path in the File column of the data
The following popup menu is available over the data area to add filters, refresh the view or edit source code.
The first three menu options let you add filters at different levels of granularity.
Filters become effective at the start of the next session. Adding a filter during a session will show the row in grey so that you can see which files are filtered, but the coverage results will continue to be included for the rest of the session.
•Filter coverage data by filename adds a new filter to the Filters dialog, excluding the selected file from the results of a subsequent session
•Filter coverage data by directory excludes all files in the same directory as the selected file
•Filter coverage data by DLL excludes all files belonging to the same DLL as the selected file
•Refresh... updates the statistics displayed in the table
•Edit Source Code... opens the default or preferred editor to edit the source code