IBM Developer for z/OS Enterprise Edition - Group home

Wondering what’s new with ZUnit this summer?

By Claire Nelson posted Fri June 12, 2020 12:00 AM

  
The world that we are currently in is in a strange state of flux. The new norm consists of juggling online schools, conference calls interjected with dogs whining to go out, kids asking for a zillion things - the lines between work and personal life are very blurry. My workspaces vary from the kitchen table, a backyard bench or a work desk - depending on who needs what at that moment in time.
workspaces
Restrictions on meeting our customers across the globe or even stepping into offices didn’t stop us - at the IBM Z DevOps shop - from tinkering away and churning out new products and releases. One such outcome is a new version of ZUnit - the Unit Testing feature in IBM Developer for z/OS.

With the drive to deliver business innovations to meet customer demand, and embrace CI/CD practices and parallel development, testing and unit testing in particular has become significant. When you deploy a program change into a shared CICS environment and the transaction fails, you can spend a lot of time in analyzing whether it is indeed a problem with your code or with the environment or another change that was done by a different developer. Being able to test changes much earlier in the development cycle - before committing or deploying the code - saves a lot of time wasted away in defect analysis. True Unit Testing is developer-led and independent of the environment. The tests must be repeatable and run fast. These are the tenets that we strive to bring into ZUnit as well.

In IDz 14.2.1, ZUnit introduced a new version of the test runner - the IBM z/OS Dynamic Test Runner, that enabled unit test support for COBOL CICS programs that access Db2. It enabled the recording of data from a transaction and importing this data into the testcases. The generated testcases could then be executed in a stubbed manner - without requiring access to a CICS or Db2 subsystem and without any rebuild of the application code. This provides the developer the ability to run unit tests for CICS programs from their personal libraries before committing or deploying code. Please see the blog by Bill Alexander for more details.

Today, I am happy to share with you the news that we have extended this support to COBOL batch programs accessing Db2. With this, you can
1. Record data from a COBOL Batch job and import this data into a test - making it easier to start creating the tests and add on more scenarios. The recording dialog can be invoked from a ZUnit testcase editor. It allows you to point to a Batch JCL which executes the program to be tested. ZUnit creates a modified copy of the JCL with the recording parameters and submits it and collects the intercepted Db2 calls. This can then be imported into the Test case editor
zUnitDb2
2.Edit data or add more tests and generate the COBOL testcase program which consolidates all the individual test scenarios. This program can be stored in an SCM like any other program.
3.Run the tests without the need for a Db2 subsystem. This allows you to run the same test multiple times.

Isn’t this such a relief? No more forgetting to delete data from the Db2 table to run tests. Talk about repeatability!

But this is not all. We did manage to put some more things. Here's a short summary of the additional features that are available with IDz 14.2.3 -
1.Our existing COBOL batch support - which included support for testing programs via Linkage and Batch programs accessing QSAM/VSAM files - is now available with the IBM z/OS Dynamic Test Runner. This allows you to use the new recording feature to record and import data passed via Linkage in sub program calls from a non Db2 Batch program. This also implies that you can invoke sub-program stubs without the need to relink your application code.

2.ZUnit now supports pointers in the Linkage section of program to program calls in batch
zUnit-pointersupport

3.There are many ways to use a dataset (Sequential or VSAM) in ZUnit. You can stub it by entering data into the editor or import data from the dataset into the editor. You also have an option to reuse your existing mainframe datasets and compare the output file with an expected value. With this release, you can customize your output file comparisons with process statements when you choose to use mainframe datasets as file input/output
FileCompare

4. Over the year, we have also been working to put in improvements to our existing features. The improved redefines selection feature enables you to apply different redefine structures to different tests. This makes testing programs handling different kinds of data within the same data structures much easier.
zUnitRedefines

5.And last but not the least, we continue to enhance our products to support modern SCMs like Git and IBM Engineering Workflow Management(formerly Rational Team Concert). The ZUnit artifacts can be saved into a local project - and easily checked in to Git and EWM. You can now identify program and testcase dependencies using the latest version of the Run configuration available with local projects, making running the unit tests from a pipeline much easier.

Yes - it’s been a busy year. As always, we look forward to hearing from you as we work to improve and add in more features.

I am thankful to all my colleagues at IBM who have persisted through these times to continue to brainstorm and work as a team. We have also found new ways and topics to connect with each other apart from work - sharing recipes and outcomes of dinner experiments. Here’s hoping you discover this as a time to dust and bring out that old paintbrush, guitar or notebook. Wish you a safe and wonderful summer.