Development teams often need to show that they have performed testing which has covered all logical paths through a program. Using the test coverage utility, they can produce a report to illustrate the extent of test coverage, and can promote this report along with the source code at the various stages of the development lifecycle.
While a program is running in test coverage mode, code execution is logged for each program and sub-program that has been compiled with the TESTCOVER directive set. The results are stored in a binary results file, which has the filename extension .tcz. The information stored in the results file depends on how you configure test coverage.
Running a program in test coverage mode uses significantly more resources than running the same program without test coverage enabled. As a result, we recommend that you use test coverage only in development systems; we recommend that you do not use test coverage in production systems.
As the results file is a binary file, it has to be formatted to produce a text or HTML report file. You can create a report file from the command line, using the reporting utility cobtcreport (UNIX) or TCReport (Windows). Reports can be formatted to produce a plain text (.txt) file or an HTML (.htm) file.
You can also tag statements in your source code and use test coverage to report on whether these statements have been executed. This is particularly useful if you want to see the coverage of new or changed lines in your source code.