z/OS Automated Unit Testing Framework (ZUnit) overview

The ZUnit feature of Developer for z/OS® provides a code-driven unit testing framework for Enterprise COBOL and PL/I. ZUnit provides an automated solution for recording, running, and verifying Enterprise COBOL and PL/I unit test cases that are written by using the ZUnit framework.

Getting started

ZUnit provides several tools for creating test cases, recording test case data, and running test cases. The following procedures outline the fastest path to running COBOL and PL/I test cases with ZUnit. For more information about each step in this process, click the link. For more information about other ZUnit processes, such as running a test from JCL or TSO, or generating test results in alternative formats, see the other topics in the ZUnit information set.

COBOL

  1. Set property group options for a test case. The property group defines the compiler and link options that ZUnit requires to run a test case and defines the test runner configuration and result files. You must define a property group with the options required by ZUnit and associate the property group with the programs that you want to test.
  2. Create/modify a test case. For Enterprise COBOL source files, the ZUnit feature can analyze a source program and create/modify a test case with test data. The test case generation tools simplify the process of creating test cases, incorporating test data into a unit test, editing the test data, and building and running a test case.
  3. Record test data for CICS or Db2 programs. ZUnit can record test data generated during the execution of CICS and CICS with Db2 programs. The data recording tools enable you to run and record transactions, select data records to include in your test cases, and replay programs with recorded test data.
  4. Build and run the test case. ZUnit provides menu items for running test cases. These menu items are available in the z/OS Projects and Remote Systems views. After you run a test case, ZUnit opens the test results in the test result viewer.

PL/I

  1. Set property group options for a test case. The property group defines the compiler and link options that ZUnit requires to run a test case and defines the test runner configuration and result files. You must define a property group with the options required by ZUnit and associate the property group with the programs that you want to test.
  2. Create/modify a test case program. For Enterprise PL/I source files, the ZUnit feature can analyze a source program and generate a test case with test data. The test case generation tools simplify the process of creating test cases, incorporating test data into a unit test, and building and running a test case.
  3. Build and run the test case. ZUnit provides menu items for running test cases. These menu items are available in the z/OS Projects and Remote Systems views. After you run a test case, ZUnit opens the test results in the test result viewer.

Samples