Code Coverage Tool Reference Manual

HP Code Coverage Tool Reference Manual for HP Integrity NonStop NS-Series Servers542684-004
1-1
1 Introduction to the HP Code
Coverage Tool
This manual describes the Code Coverage Tool for HP Integrity NonStop NS-series
servers. It addresses application developers who use C/C++, pTAL, or COBOL to
create application components for NonStop Servers, and who wish either to evaluate
the code coverage provided by test cases or to understand what parts of an application
are used, or most heavily used, under a representative workload.
Features of the Tool
The code generator used by COBOL, pTAL, and C/C++ compilers on NS-series
servers now has the capability to create instrumented object files. Such object files
contain extra code that records which functions and blocks are executed, and how
many times each is executed. The Code Coverage Tool uses this information to
produce a report indicating what code in a program file or DLL was actually executed
during one or more invocations. The code coverage report is a set of HTML files
that you can view with any standard HTML browser.
No source code changes are needed to instrument an application. The only required
changes are in the commands used to compile and link the application. If you choose
to instrument only a subset of your application, you specify code-coverage compiler
options for only that subset of your source files.
Compilation can occur on the Guardian, NonStop Open System Services (OSS), or
Windows platform. Execution must occur on either the Guardian or the OSS platform.
The Profile Merge Utility (profmrg) and the Code Cover Utility (codecov), used to
assemble and present the code coverage data, run on the Windows platform.
You can instrument all or part of any type of application, for instance:
OSS processes
Guardian processes
Active and passive process pairs
Mixed language processes
Processes with embedded NonStop SQL/MP or NonStop SQL/MX
Note. The Code Coverage Tool is intended for data generation and collection in a test
environment only. The use of instrumented code is not recommended for production
environments. Applications compiled with code coverage instrumentation will experience
greatly reduced performance.