Running code coverage for z/OS applications

Running code coverage provides insight into how well your test cases are exercising your compiled language applications. The code coverage report shows the percentage of lines in your code that is run by a test case and gives line-by-line coverage details.

About this task

You can run code coverage for any compiled language application that you can debug.

Procedure

  1. Compile your program with debugging information.
    Note: If portions of the application do not have debug information, they are included in the report with this detail specified, but not included in any calculations (for example thresholds). Module level coverage always includes modules without debug information as part of its calculations.
  2. Modify the application's launch JCL to include the AQE_STARTUP_KEY or EQA_STARTUP_KEY environment variable. The value of this variable must be in the form CC,programName. For example, see the AQE_STARTUP_KEY line in this JCL code:
    // PARM.RUN=('/TEST(,,,TCPIP&&<IP_address_for_RDz_client>%<port_for_RDz_debug_UI_daemon>:*)')
    //******* ADDITIONAL RUNTIME JCL HERE ******
    //CEEOPTS   DD *
     ENVAR("AQE_DBG_V4LIST=//'USER.COBOL.LISTING'",
     "AQE_STARTUP_KEY=CC,PRTPRIM",
     "AQE_DBG_TRACE=/home/user/probe.trc")
    /*
    //CEEDUMP   DD SYSOUT=*
    Note: This example uses the AQE_STARTUP_KEY environment variable. Environment variables whose names begin with AQE are used with the Rational® Developer for System z® Integrated Debugger. If you are using the Debug Tool, use EQA environment variables. For information about generating JCL code, see the related link Runtime step options.
  3. Submit the JCL. You can submit the JCL from the z/OS® Projects perspective. For more information, see "Submitting a JCL."

What to do next

You start code coverage data collection in the Debug perspective, but the code coverage report automatically opens in the perspective that is current after the data collection is complete. Now you can view the code coverage results.

Feedback