An automated migration of legacy COBOL code to Java using artificial intelligence has revealed a troubling outcome: the translated programs carried forward the same bugs present in the original COBOL source. The finding, discussed in a recent case study, underscores the limitations of current AI-assisted code conversion tools and raises questions about their suitability for mission-critical legacy modernization projects.

What You Need to Know

COBOL, a programming language widely used in banking, insurance and government systems for decades, contains billions of lines of production code. Organizations have long sought to migrate these systems to modern languages like Java, often relying on manual rewriting or automated tools. This case study demonstrates that AI models trained for code translation can faithfully reproduce the logic of the original program, including its errors, without the ability to detect or correct them.

The Migration Challenge

Legacy COBOL systems remain essential to many large enterprises, yet the pool of developers skilled in the language continues to shrink. As a result, organizations have turned to AI models for automated translation. The approach promises faster and cheaper conversions than manual rewriting. However, the new study shows that the AI’s literal translation creates a direct copy of the original program’s behavior, including any latent bugs.

  • Literal translation: The AI model translated COBOL statements to Java equivalents without applying domain-specific logic or error handling improvements.
  • Bug preservation: All defects present in the original COBOL code, including off-by-one errors and logic flaws, were reproduced in the generated Java output.
  • No validation: The AI did not independently verify the correctness of the translated code against the intended business requirements.

How Bugs Propagate

The migration process typically involves feeding source COBOL code into a large language model that generates Java syntax. The model interprets the structure and semantics of the original program, but it lacks the ability to assess whether that logic is correct. If the original COBOL program contained a bug, the AI treats it as a feature to replicate. This means that organizations using AI migration without thorough testing may unknowingly inherit the same operational issues that plagued their legacy systems.

Why This Matters

For enterprises running mainframe COBOL applications, the inability of AI to correct bugs during migration represents a significant operational risk. A financial institution that relies on its COBOL-based core banking system, for example, cannot afford to move a buggy Java version into production. The finding suggests that AI migration tools must be paired with robust testing and validation frameworks, or that human oversight remains essential. The long-term cost of cleaning up replicated bugs could offset the short-term savings of automated migration.

What You Need to Know

Organizations planning to migrate COBOL to Java using AI should budget for extensive post-migration testing. The study highlights that AI translation is not a substitute for code review or quality assurance. Teams must treat the generated Java code as a first draft, not a final product, and invest in both automated and manual testing to catch inherited defects. Until AI models can reason about program correctness, the safest path remains a hybrid approach that combines automated translation with human expertise.