Unit Test for MainframeIntroductionThe Unit Test for Mainframe VS Code extension 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:
Prerequisites
Verify their installation 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 package. The Unit Test for Mainframe extension works seamlessly with the Code4z extension pack for z/OS application developers. Using the ExtensionProject InitializationTo initialize a project, perform the following steps from the VS Code menu:
COBOL Language Support ConfigurationTo use the Test4z code snippets, a COBOL LSP is required. Install Broadcom's COBOL Language Support or the complete Code4z package. You can configure the COBOL LSP to find the Test4z COBOL API copybooks. This helps with syntax checking of the code and navigation to the copybooks. The
If you want to add the path to the Test4z COBOL API copybooks into an existing configuration, perform the following steps:
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 SnippetsThe Unit Test for Mainframe VS Code extension 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 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 SupportIf you are on active support for Test4z, you may be entitled to technical assistance and support in accordance with the terms of your agreement and Broadcom's support policies. Copyright © 2024 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. |