Artificial Intelligence1 min read

Legacy Modernization with LLMs: Does the Translation Behave Like the Original?

By · Published by Everything Blog

In short

Recent evaluations using Claude Code with Opus 5.5 revealed that every examined legacy code translation contained functional errors. Although basic operations routinely succeeded and passed standard console tests, boundary conditions exposed major inconsistencies in logic. For example, testing an accumulated sum that exceeded field boundaries caused three identical translations of one program to generate three totally different numerical outcomes. Software migrations demand exact algorithmic fidelity, making these inconsistent translations a significant liability.

Key points

  • Compilable code generated by large language models does not guarantee functional equivale…: Compilable code generated by large language models does not guarantee functional equivalence with the original legacy software.
  • Inconsistent edge-case handling poses serious risks for organizations requiring byte-for-…: Inconsistent edge-case handling poses serious risks for organizations requiring byte-for-byte fidelity in migrated systems.
  • Legacy software modernization efforts must rigorously audit translations to ensure exact…: Legacy software modernization efforts must rigorously audit translations to ensure exact matching of rounding and numerical constraints.

Sources checked by our analysis pipeline: 1

The big question is this one: when an LLM translates code, does it translate it correctly? This is what we want to answer in this article.

In article 1 we described our experiments, in which an LLM translated RPG applications to Java, the same code more than once, and we saw that everything it produced compiled. In article 2 we saw that the translations differ from each other, because each run makes its own design decisions.

Now we get to what is probably the most central question of the whole series, and certainly the one a client cares about more than any other, which is whether the translated application does what the original did.

The short answer is that it does not. In most of the cases we tried, the program behavior (output written in the console, changes on the database) was the expected one, but we found errors in every translation we examined, and we reviewed only a fraction of the code. Below I go through them one by one, with the code where it helps.

This series

-…

Artificial Intelligence