COBOLAssist: Analyzing and Fixing Compilation Errors for LLM-Powered COBOL Code Generation

📅 2026-04-05
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the prevalent issue of compilation errors—such as incomplete code, syntactic flaws, and type mismatches—in COBOL code generated by large language models (LLMs). The authors propose an iterative repair framework grounded in compiler feedback, which systematically categorizes COBOL compilation errors for the first time and leverages this feedback to guide LLMs through multiple rounds of refinement. This approach establishes a closed-loop pipeline for error detection, classification, and automatic correction. Experimental results demonstrate a substantial improvement in code quality: the compilation success rate for GPT-4o increases from 41.8% to 95.89%, and GPT-4’s pass@1 score rises from 9.1 to 22.6. The proposed method effectively mitigates challenges in maintaining legacy systems exacerbated by the scarcity of skilled COBOL developers.
📝 Abstract
Legacy programming languages such as COBOL (Common Business-Oriented Language) remain critical in business computing. However, maintaining legacy COBOL systems is increasingly challenging due to a declining pool of skilled developers and the persistence of COBOL errors that require deep domain expertise to resolve. This paper investigates the challenges of COBOL compilation errors and introduces a framework leveraging large language models (LLMs) to address these issues. We first categorize the common compilation errors in LLM-generated COBOL code into three groups: incomplete code errors, syntax errors, and type-related errors. We further propose COBOLAssist, a technique to enhance code correctness through iterative repairs guided by compilation feedback. Our evaluation using five LLMs including GPT variants and mAInframer, shows a high prevalence of incorrect program structures and function usage in COBOL programs and demonstrates the effectiveness of COBOLAssist, with the compilation success rates increasing from 29.5\% to 64.38\% for GPT-4o-mini and from 41.8\% to 95.89\% for GPT-4o. It also improves pass@1 significantly, for example from 9.1 to 22.6 for GPT-4. Notably, while mAInframer-34B achieves the highest compilation success rate, its functional correctness remains limited. This research not only highlights the limitations in current LLMs for COBOL but also demonstrates a practical path forward for automated debugging in legacy systems.
Problem

Research questions and friction points this paper is trying to address.

COBOL
compilation errors
LLM-generated code
legacy systems
code correctness
Innovation

Methods, ideas, or system contributions that make the work stand out.

COBOLAssist
large language models
compilation error repair
legacy code maintenance
iterative debugging
🔎 Similar Papers
No similar papers found.