# Spec2COBOLRot: An Agentic-AI Degradation Loop for Realistic COBOL Corpus Generation

arXiv: https://arxiv.org/abs/2609.26835 · HTML: https://mlsanity.com/paper/2609.26835/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use.
- Builds on 7 of its 21 references that are in the map.
- First posted on arXiv 21 Sep 2026.

## Placed in

- LLM agents and tool use / [Software engineering coding agents](https://mlsanity.com/agents/software-engineering-coding-agents/)

## Builds on (most cited first, 7 of 7)

- [Training Language Models on Synthetic Edit Sequences Improves Code Synthesis](https://mlsanity.com/paper/2410.02749/) (2024)
- [Automated Testing of COBOL to Java Transformation](https://mlsanity.com/paper/2504.10548/) (2025)
- [Contemporary COBOL: Developers' Perspectives on Defects and Defect Location](https://mlsanity.com/paper/2105.01830/) (2021)
- [OpenCBS: An Open-Source COBOL Defects Benchmark Suite](https://mlsanity.com/paper/2206.06260/) (2022)
- [Enhancing COBOL Code Explanations: A Multi-Agents Approach Using Large Language Models](https://mlsanity.com/paper/2507.02182/) (2025)
- [Quality Evaluation of COBOL to Java Code Transformation](https://mlsanity.com/paper/2507.23356/) (2025)
- [Impact of Comments on LLM Comprehension of Legacy Code](https://mlsanity.com/paper/2506.11007/) (2025)

## Abstract (arXiv)

COBOL remains widely deployed, yet representative corpora reflecting real production code are rarely available, limiting rigorous benchmarking of modernization approaches. We propose a systematic agentic AI pipeline for generating realistic COBOL programs, combining specification-driven generation with iterative degradation guided by patterns and complexity targets extracted from real production code. Here, realism is understood as structural fidelity to production code as captured by our metrics. We evaluate whether degradation reaches target complexity levels while preserving business behavior, and examine the limits of the approach, across three programs from distinct business domains. Results show the pipeline reliably produces syntactically valid programs and moves them toward realistic structural complexity. However, preserving business behavior is not always achieved by construction, and targeting structural metrics independently of business logic risks producing programs whose complexity does not reflect a plausible maintenance history. We discuss these limitations and outline a more realistic alternative as a direction for future work, generating legacy programs from scratch along a simulated development history.
