One approach to program testing is to verify the operation range and coverage of the program execution. The Coverage Tool provides the following information for programs coded in the Fortran or C language:
When the Coverage is started, the last used sample data file name and the executable file name is restored.
There are two ways to start the Coverage Tool:
Start by double-clicking the Coverage Tool icon on your Windows desktop if you chose to have an icon at installation time; otherwise start it from the Start|Programs menu.
Type
COVfollowed by the <Enter> key.
In the coverage window, terminate the coverage tool by selecting the Exit Coverage command from the File menu.
The coverage menus are outlined below.
The table below lists the File menu commands.
|
Command |
Function |
|---|---|
|
Select Files |
Open dialog for selecting executable (.exe) file and specifying coverage data output (.cov) file |
|
|
Print the coverage information being displayed. |
|
Print Preview |
Display image as it would be printed |
|
Print Setup |
Specify printer configuration. |
|
File Search Path |
Specify the path for searching for the file. |
|
Exit Coverage |
Terminate the coverage tool. |
When the "OK" button in the "Select Files" dialogbox is clicked, the "Executable File and Sample Data File" window appears.
The Print, and Print Preview commands are active only if coverage information is being displayed.
The table below lists the Coverage menu commands.
|
Command |
Function |
|---|---|
|
Execute |
Run the program to collect coverage information. |
|
Executing Options |
Submit command line argument(s) and runtime options to the program and execute the program to collect coverage information |
|
Execution Coverage Rate |
Display the coverage information for all program units |
|
Source File Directory |
Specify the source file directory |
The table below lists the View menu commands.
|
Command |
Function |
|---|---|
|
File Information |
Displays a dialog showing information about the executable file and the coverage data file. |
|
Status Bar |
Specifies whether to display the status bar. |
|
Toolbar |
Specifies whether to display the toolbar. |
The table below lists the Window menu commands.
|
Command |
Function |
|---|---|
|
Cascade |
Displays all open windows so that they overlap, revealing the Title Bar for each window. |
|
Tile Horizontally |
Displays the listed coverage information from left to right. |
|
Tile Vertically |
Displays the listed coverage information from top to bottom. |
|
Arrange Icons |
Arranges all the icons along the bottom of the window. |
|
Close All |
Close all open windows |
Note: the Window menu is displayed only if coverage information is being displayed.
The table below lists the Help menu commands.
|
Command |
Function |
|---|---|
|
Help |
Displays the Coverage Tool help topics |
|
About Coverage |
Displays version information for the coverage tool. |
To compile a source program for the collection of coverage information, you must specify -cover as an option at compilation. If the source program is compiled without the -cover option specified, coverage information is not collected.
The coverage functions are listed below.
To collect coverage information, run the program once.
Do the following to collect the information:
Collected coverage information can be stored. You can update and display the stored information by assigning another argument to the executable program (merging the information). If the program being tested requires input data, you can put sample data into a file and then use that data for testing the program.
Coverage information is stored in the file specified by the "Select Coverage Data File" command in the File menu.
Follow these steps to merge coverage information with the existing coverage data file:
The new coverage information is now stored in the specified data file.
The following items are displayed in the coverage information:
Follow these steps to display the information:

The coverage tool shows the executed and non executed parts of each block. A block is a set of statements that do not change the control of execution. The following instances may separate a block:
The following marks are placed at the beginning of the block: