Generating code coverage for z/OS applications with an Eclipse IDE

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

  1. 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.

    In remote debug mode, programs written in COBOL, PL/I, C, and assembler language and compiled with certain compiler options are supported. For more information, see Supported compilers and options for code coverage in remote debug mode.

  2. 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. For information about generating JCL code, see Runtime step options. Generating JCL using property groups is not supported with IBM® Debug for z/OS.
  3. 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.