Code Coverage

Use the code coverage feature to see what modules, states, statements and variables have been executed or used. This is useful in a number of ways, not least of which are:

  • Code that has not run cannot have caused an error.
  • Code that should have run but hasn't, may indicate the location of an error.

The following tasks are associated with code coverage. To interpret the display, see the following topic, The Code Coverage Display.

Refresh the code coverage display

The code coverage counter is always running, but the display does not update dynamically. To update the display, use the Refresh Code Coverage Information button in the toolbar. This will provide you with an up-to-date view of what statements and variables have been used.

Step between blocks of covered code

In a module with minimal code coverage, there may be long gaps between the uncovered highlights. The Next Highlight and Previous Highlight buttons allow you to quickly jump from one block of uncovered code to the next.

Use a code coverage merge file

You can save the current record of what code has been covered to a file, and then merge that information back to the current display. This can be useful in at least two situations:

  • If you are working as part of a team, each team member can test a different part of a large application and save their code coverage history to a file. These files can then be collected and merged into one display to provide a complete picture of what code and variables have been used in an application
  • You may wish to reset the counters to zero before running a test, but not want to lose your current code coverage information. You can save the current code coverage information to a file before performing the reset, then after you have finished your test, merge the code coverage information back into the current display.

Reset the code coverage counts

To reset all the counters to zero for a fresh start on the code coverage, use the Reset button in the toolbar. Use this to obtain a clear view of code coverage from a fresh starting point.

While viewing a dump file, you cannot change the code coverage view. For example, if the dump file was created with code coverage turned on, you cannot turn that view off while viewing the dump file.