The code coverage report shows the lines of code
executed by your test case as a percentage of the total number of
executable lines. It can also show the code coverage at the line level
in a program's listing or source.
About this task
You can run code coverage for any compiled language application that you can debug. Below is an example about collecting code coverage for a batch application. The methods
for collecting code coverage differ depending on the environments.
Procedure
- Compile your program with debugging information.
Note: If portions of the application do not have
debug information, the portions are not included in the report or
in any calculations. To find modules that do not have debug information,
export the result to a PDF report and press Settings,
select Module as the report type and set Hide
Empty Module to false. The report
will list all modules including those that have zero executable lines.
If you see missing modules in the report with zero executable lines,
the modules might not have debugging information.
- Modify the application's launch JCL to include the
EQA_STARTUP_KEY
or EQA_STARTUP_KEY
environment
variable. The value of this variable must be in the form CC,programName
.
For example, see the
EQA_STARTUP_KEY
line in this JCL
code:
// PARM.RUN=('/TEST(,,,DBMDT:*)')
//******* ADDITIONAL RUNTIME JCL HERE ******
//CEEOPTS DD *
ENVAR("EQA_STARTUP_KEY=CC,PRTPRIM")
/*
//CEEDUMP DD SYSOUT=*
Note: This example uses the EQA_STARTUP_KEY
environment variable. Environment variables whose names begin with EQA
are used with z/OS® Debugger.
- Submit the JCL by using one of the following methods:
- From the Remote Systems view, right-click the JCL and select
Submit. Alternatively, you can use the key binding M1+M3+M.
- When you are editing the JCL, right-click and select Submit.
Alternatively, you can use the key binding M1+M3+M.
What to do next
When you use a client, launch code coverage from any perspective. The code coverage
data collection will run in the background. When the collection is complete, the
code coverage report automatically opens in the perspective that you are using for you to view and
analyze the results.