Unit Test for MainframeUnit Test for Mainframe brings the capabilities of Test4z into your VS Code development environment. Test4z provides capabilities for unit testing, record and replay testing, and code coverage metrics on user mainframe applications. Test4z is built to work with any programming language (such as COBOL, PL/I, C, or Assembler) that produces a mainframe load module. Test4z provides the most benefit for COBOL programs. The extension includes the following features:
![]() Unit Test for Mainframe is part of the Code4z experience from Broadcom, which offers a modern experience for mainframe application developers. To get started with Code4z, check out our foundational extension pack. Address Software Requirements
Verify the installation of VS Code and Test4z from the CLI:
CompatibilityUnit Test for Mainframe is supported on Visual Studio Code. We recommend the use of Zowe Explorer to access mainframe data sets in connection with your testing activities. You can use Zowe Explorer to submit JCL or to edit the recorded data. Zowe Explorer is available as part of the Code4z foundational extension pack. The Unit Test for Mainframe extension works seamlessly with the Code4z foundational extension pack for z/OS application developers. Using the ExtensionProject InitializationTo initialize a project, perform the following steps from the VS Code menu:
Execute Unit TestsTest4z allows you to run all tests or to run individual tests. In either case, you can choose to run with or without code coverage. Run all tests:
Run individual tests:
View Code Coverage MetricsTo analyze code coverage in your project, perform the following steps: Access Coverage Dashboard
View Detailed Coverage Metrics for COBOL Source Code
Integrating Coverage Reports into CI/CD PipelinesIf you want to publish code coverage reports within your CI/CD pipeline, multiple report formats are readily available within the generated Code SnippetsUnit Test for Mainframe provides COBOL code snippets that make it faster and easier to create your unit tests. Most of the code snippets directly correspond to the Test4z COBOL APIs. For more information on the Test4z COBOL APIs, see the COBOL API section in the Test4z documentation. Some snippets contain comments or highlighted variables to assist in customizing the sample code for your test program. Find and select a snippet:
LicenseThe Unit Test for Mainframe VS Code extension is made available to customers on the Visual Studio Code Marketplace in accordance with the terms and conditions contained in the provided End-User License Agreement (EULA). Privacy NoticeIn the event that Broadcom needs to process your personal data this is done in accordance with Broadcom’s Privacy Notice. Technical Assistance and SupportThe Unit Test for Mainframe extension is made available to customers on the Visual Studio Code Marketplace in accordance with the terms and conditions contained in the provided End-User License Agreement (EULA). If you are on active support for Test4z, you get technical assistance and support in accordance with the terms, guidelines, details, and parameters that are located within the Broadcom Working with Support guide. This support generally includes:
Note: To receive technical assistance and support, you must remain compliant with “Working with Support”, be current on all applicable licensing and maintenance requirements, and maintain an environment in which all computer hardware, operating systems, and third party software associated with the affected Broadcom software are on the releases and version levels from the manufacturer that Broadcom designates as compatible with the software. Changes you elect to make to your operating environment could detrimentally affect the performance of Broadcom software and Broadcom shall not be responsible for these effects or any resulting degradation in performance of the Broadcom software. Severity 1 cases must be opened via telephone and elevations of lower severity incidents to Severity 1 status must be requested via telephone. Copyright © 2025 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. |