Generating code coverage in a remote debug session

With Concurrent Debug and Code Coverage, you can run code coverage collection in parallel with the active debug session. When this feature is enabled, code coverage data is collected during the debug run, and code coverage annotations are displayed and updated in the debug editor. You can turn code coverage collection on or off at any time during your debug session. The final code coverage result only includes coverage information for the source regions where code coverage collection is turned on.

About this task

Notes:
  • 64-bit applications are not supported.
  • ZUnit is not supported.
  • Concurrent Debug and Code Coverage requires z/OS Debugger 15.0.1 or later, with PTF UI74257 applied.
  • After code coverage collection is started, you cannot switch the debug view. You can collect code coverage in only one view in one debug session. If the debugged program includes both compile units with compiler option TEST(SOURCE) and compiler units with compiler option TEST(NOSOURCE), code coverage is not collected for compile units with TEST(NOSOURCE) in the Listing view. In the Source view, code coverage is collected for both compile units with TEST(SOURCE) and compiler units with TEST(NOSOURCE). You can switch to the Source view before starting the code coverage session. The Source view is available only when you debug programs compiled with Enterprise COBOL for z/OS Version 6 Release 3 and later with z/OS Debugger 16.0.0 or later. For more information, see Working with different debug viewsSwitching between different debug views.
Concurrent Debug and Code Coverage supports the following languages:
  • Enterprise COBOL for z/OS, Version 4, Version 5, and Version 6
  • Enterprise PL/I for z/OS Version 4 and Version 5
  • C/C++ feature of z/OS Version 1 and Version 2
  • IBM High Level Assembler (HLASM), Version 1 Release 4, Version 1 Release 5, and Version 1 Release 6

Procedure

By default, Concurrent Debug and Code Coverage is disabled. You can enable it at the beginning or in the middle of a debug session.

  1. Select the debug target, and click the Start Code Coverage icon Start Code Coverage in the Debug view toolbar, main toolbar, or the context menu in the Debug view.
    The Set Code Coverage Parameters window is displayed. This window occurs only when you start code coverage collection for the first time for each debug session.
    Set Code Coverage Parameters window
  2. In the Set Code Coverage Parameters window, specify the Test ID and Tags parameters, or accept the default value for Test ID. The default value for Test ID is the program name appended by a datetime stamp. Then click OK to close the window.
    The first time you start Concurrent Debug and Code Coverage for a debug session, all executable lines of the current debug source are marked as uncovered in the editor. You can drive your debug session by using regular debug actions. The code coverage annotations are updated after each debug action.
    Set Code Coverage Parameters window
  3. To stop code coverage collection for this debug target, run to a certain location or suspend the session, and click the Stop Code Coverage icon Stop Code Coverage in the Debug view toolbar, main toolbar, or the context menu in the Debug view.
    The code coverage annotations are still displayed, but are not updated with the debug actions until you start code coverage collection again.
  4. Run the debug session to completion or terminate the debug session.
    A line-level code coverage result is added in the Code Coverage Results view and a report is opened in the editor area.
    • If the debug session is terminated, the code coverage result includes coverage statistics only up to the termination location.
    • If the debug session runs to completion, the code coverage result includes statistics from all source regions where code coverage collection is turned on.
    For a result generated with Concurrent Debug and Code Coverage, message “CRRDG9201W Generated in a debug session” is displayed in the Additional Information column of the Code Coverage Results view.