Running code coverage provides insight into how well your
test cases are exercising your compiled language applications by reporting
results showing the percentage of lines in your code that have been
run by a test case as well as line by line coverage details.
About this task
You can run code coverage for any compiled language application
that you can debug.
Procedure
- Compile your program with debug information.
Note: If
portions of the application do not have debug information, only those
portions of the application with debug information will be included
in the code coverage report.
- Run code coverage for your compiled language program either
from the Toolbar, the Debug perspective or the Remote
Systems Explorer perspective:
- From the Toolbar or the Debug perspective:
- Using the Code Coverage pulldown on the toolbar
,
select Code Coverage Configurations.... Tip: Alternatively, from the Debug perspective, select .
- In the Program tab of the Compiled Code Coverage
Configurations dialog, choose the RSE connection and specify the
program that you want to run code coverage against.
- Optional: By default, code coverage results are
collected independently for each run. However, you may want to collect
code coverage data on the same program under different parameters
or using different scenarios. For example, using different parameters
may affect the execution of lines within an if or else block. In these
cases, you have the option of collecting code coverage results cumulatively
as this will improve code coverage performance. To choose this option:
- Select the Code Coverage tab.
- Select either Append to the previous result (which will
use the last launch's results as the baseline for the current launch)
or Append to a specific result (which will use the code coverage
results from the launch file you specify as the baseline for the current
launch).
- Specify the Code Coverage Level.
- Click Apply.

- Click the Coverage button.
- From the Remote Systems Explorer perspective:
- Select the compiled program.
- Right click and select .
What to do next
Code coverage data collection is launched in the Debug perspective
but the code coverage report automatically opens in the perspective
that is current once the data collection completes. Now you can view
your code coverage results.