COBOL Coverage Gates Can Miss Never-Loaded Programs Without COLLECTION
Rocket’s native COBOL coverage can fail a CI build with tcutil thresholds, but never-executed programs appear only when sources are compiled into a named COLLECTION and tcutil -u can locate their .idy metadata. TESTCOVER alone records execution profiles for programs that run. [1] [2] [3]
Read the full briefing
COBOL Coverage Gates Can Miss Never-Loaded Programs Without COLLECTION
Scope: Rocket Enterprise Developer 12.0 for Eclipse (UNIX), native COBOL test coverage.
A coverage percentage is only meaningful if the tool knows which programs were expected to execute. Rocket separates that into two compiler directives. TESTCOVER instruments a native COBOL program so execution can be profiled when the application runs in test-coverage mode. It is off by default, and both compilation with the directive and execution under coverage are required to create a profile. See TESTCOVER.
Executed programs and subprograms compiled with TESTCOVER write binary .tcz results. The less obvious problem is a program that never loads: it cannot report its own execution. The COLLECTION(name) directive supplies the missing inventory mechanism by assigning related programs to a named collection. Its default is NOCOLLECTION; at the command line the name can be any string, while the IDE automatically uses the project name. See COLLECTION.
The CI utility tcutil turns those results into enforceable output:
tcutil -x myapp.xml myapp.tcz
tcutil -t 80 myapp.tczThe first command creates an XML summary suitable for transformation into a CI-specific format. The second returns a nonzero exit code when overall statement coverage is below 80%, allowing the build to fail. However, including programs that never executed requires -u. Rocket documents that -u derives the unexecuted-program information from the .tcz data and matching .idy files found in the current directory or directories named by COBIDY; it also requires compilation with COLLECTION. See Test Coverage Utility Program (tcutil).
The practical pipeline is therefore:
- Compile all programs in the intended coverage scope with
TESTCOVERand the sameCOLLECTION(name). - Run the test suite in coverage mode to produce one or more
.tczfiles. - Make the corresponding
.idyfiles discoverable through the working directory orCOBIDY. - Use
tcutil -uwhen the report must account for collection members that never loaded, and-twhen CI should enforce a threshold.
This facility is supported only for native COBOL. Coverage mode also consumes significantly more resources than normal execution, so Rocket recommends using it only in development systems, not production. Binary .tcz files can be retained as CI artifacts, opened in Enterprise Developer for detailed inspection, or converted to XML by tcutil. See Overview - Test Coverage.
Takeaway: A threshold checks observed coverage; COLLECTION plus tcutil -u makes never-loaded programs visible to that assessment.