Test tools that are not here
There are COBOL test tools, and they are not in this image. A page about them could copy a screenshot from a vendor site and call it a test run; this one does not. It says what each tool is, what it needs, why it cannot run here, and how a project that needs it would install it. No command on this page was run, and no output on it was produced by a tool.
The rule of this group
Every other page in this group prints output from a run in this container. This page prints none, because there is none: the tools below are absent from the image, and a made-up report would be worse than a missing one. What a reader can check here is the reasoning, and what they can run on their own machine is in the rest of the group: the harness, the shell runner, the checked build, the golden file and gcov.
cobol-check
cobol-check is an open-source unit-testing tool for COBOL, started in the Open Mainframe Project. Its idea is the one this group builds by hand: test cases live beside the program, the tool generates a COBOL driver from them, runs the driver and reports pass and fail per case. The test cases are written in a form the tool reads from the source, so a program and its tests stay in one file.
What it needs is the reason it is not here. The tool itself runs on a JVM, and the generated drivers need a COBOL compiler; this image has GnuCOBOL and no Java at all, so the tool would have to bring a runtime with it. A run would then test the discount unit of these pages in the same way the hand-written harness does, with more machinery around it.
It is worth knowing for one thing: it shows what a COBOL test framework looks like when the language has no reflection. The tool cannot discover a test, so it generates a program; the program calls the unit and compares values; a report is lines of text. The hand-written harness on the first page of this group is that program, minus the generator.
zUnit
zUnit is IBM\'s unit-test framework for Enterprise COBOL on z/OS, part of the IBM Developer for z/OS toolset. It records a program run under the debugger, turns the recording into a test case with the inputs and outputs captured, and replays it later to see whether the program still produces the same answer. The generated test is COBOL, and the runner is a z/OS job.
It needs z/OS, Enterprise COBOL and the IBM tooling, none of which this container has or can emulate. The idea is portable and the pages here use it twice: the golden file of the fourth page is a recording of an output, and the harness of the first page is a replay of inputs with the expected answers written down. A zUnit test and a golden file fail for the same reason and are read the same way.
The commercial tools
Two more names come up in large shops. Total Test, from BMC (formerly Compuware), records and replays test cases for mainframe programs, including COBOL with CICS and Db2, and keeps the results in a repository that a release process reads. Enterprise Test Server, from Micro Focus (now OpenText), runs COBOL applications off the mainframe for testing, so a test can run on a Linux server against the same sources.
Both are commercial products for organisations with mainframes, and both solve a problem this group does not have: a test that has to reproduce CICS transactions, Db2 state and JCL steps. On a Linux box with a compiler and a shell, the harness, the runner and the golden file cover the same ground for a batch program, which is what the rest of this group shows.
What is in this image
tool present why
cobc 3.2.0 yes the compiler and its -debug and --coverage options
gcov yes counts the lines of the C that cobc writes
diff, sh, make yes golden files, runners, a build
cobol-check no needs a JVM; no Java in the image
zUnit no needs z/OS and IBM Enterprise COBOL
Total Test no commercial, mainframe, licensed
Enterprise Test no commercial, licensed, a server of its own
The image was checked for the first three and the last four by looking for their commands and runtimes; nothing was installed and nothing was downloaded. That is the whole of the evidence this page can offer, and it is more than a screenshot would be.
If you need one of them
The route for each, in words and without a command this container could run:
- cobol-check: install a JVM, get the tool from its project page, point its configuration at the COBOL compiler, and run it against a source file whose test cases it reads. The generated driver is a COBOL program, so the compiler has to be the one the project uses.
- zUnit: install IBM Developer for z/OS on a workstation and the zUnit runtime on the z/OS system, record a test case from a program run, and run the generated test as a job. The licence and the mainframe are part of the requirement, not an afterthought.
- Total Test or Enterprise Test Server: a commercial licence, an installation on the platform the vendor supports, and a project that maps the programs and their data into the tool. The vendor documentation is the only honest source for the steps.
A reader who has none of these and a Linux machine has the four pages before this one, and they run: the compiler is the test runner if the test is a program, the shell is the runner if the test is a command, and gcov says which lines the tests never reached. That is not a compromise for small programs; it is how most COBOL on Linux is tested today.
No program on this page was run and no output on it was produced by a test tool: none of the tools described here is installed in this image. The other pages of the group were built with cobc (GnuCOBOL) 3.2.0 on Alpine Linux 3.24.3 (x86_64) in a Docker container.
Article author: Arthur Isaev