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.
Overview
For a description of the concepts and terminology for ZUnit, see z/OS Automated Unit Testing Framework (ZUnit).
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
- 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.
- Generate a test case program. 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.
- 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.
- 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
- 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.
- 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.
- 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
For information about sample programs that are included with ZUnit, see the following topics:
- Enterprise COBOL AZUTC001 sample test case template (for AZUTSTRN runner)
- Enterprise COBOL AZUTC004 sample test case (for AZUTSTRN runner)
- Enterprise COBOL AZUTC003 sample test case (for AZUTSTRN runner)
- Enterprise PL/I AZUTC002 sample test case template (for AZUTSTRN runner)
- Enterprise PL/I AZUTC005 sample test case (for AZUTSTRN runner)
- Enterprise COBOL AZUTC006 sample test case (for AZUTSTRN runner)
- Enterprise COBOL AZUTC007 sample test case (for BZUPLAY runner)
Resources for learning available on the web
- Developer for z/OS product website (link opens in a new window)