Agentic AI
AI Pipeline Generates Realistic COBOL Code to Help Modernize Legacy Systems
Researchers developed an automated system that creates synthetic COBOL programs matching real production code structure, but found maintaining business logic during transformation remains challenging.
Researchers have introduced an agentic AI approach to synthesizing realistic COBOL programs—a critical need given that COBOL remains deeply embedded in enterprise systems yet authentic production code is rarely available for testing modernization tools.
The Challenge with COBOL Benchmarking#
Despite its continued prevalence in banking, insurance, and government sectors, COBOL corpora that faithfully represent real-world production environments are scarce. This scarcity hampers rigorous evaluation of software modernization techniques. The research team sought to bridge this gap by constructing a pipeline that generates synthetic COBOL programs with structural properties mirroring genuine legacy systems.
How the Pipeline Works#
The system, called Spec2COBOLRot, combines specification-driven program generation with iterative degradation. Rather than writing COBOL from scratch, the pipeline starts with high-level specifications and progressively adds complexity through controlled transformations. The key innovation is anchoring this degradation to patterns and complexity metrics extracted from actual production code, aiming for outputs that reflect plausible legacy program evolution.
The researchers tested the approach across three distinct business domains, measuring both structural fidelity and behavioral correctness.
Results and Limitations#
The pipeline successfully produced syntactically valid COBOL programs and moved them toward realistic complexity levels. However, two significant challenges emerged: preserving business logic was not guaranteed during the degradation process, and targeting structural metrics in isolation from business semantics can yield programs whose complexity lacks connection to a credible development history.
The authors acknowledge these gaps and propose an alternative direction: generating legacy programs from scratch by simulating an authentic development timeline, which could better capture the interplay between code structure and functional evolution.

