Proving the Java Behaves Like the COBOL

Nobody can prove that a translated program behaves identically to the original, and the people who build COBOL to Java translators say so in print. The IBM Research team that evaluates watsonx Code Assistant for Z opens its argument with exactly that: proving equivalence between two programs is undecidable, so a formal proof is impractical for this job. Tools such as KLEE and CBMC can check equivalence in narrow scenarios and cannot bridge the semantic gap between the two languages. Whatever a bank or insurer does before cutover, it will not be a proof.

That leaves evidence, and the quality of the evidence is the entire game. The IBM paper describes a layered approach. Analytic checkers look at syntax (is the output empty, does it parse, does it repeat itself endlessly), at variable access (every COBOL read or write should have a Java access of the same type), at procedure calls, and at middleware calls such as EXEC SQL and EXEC CICS, matched one to one with unmatched Java calls treated as hallucinations. On top of those sits an LLM acting as judge, which scores fidelity on a seven-point scale. The authors say plainly that no single method is enough.

Their running example is the most instructive part. They inject three faults into a translation of a CICS paragraph: a wrong variable access, a wrong exception type, and a wrong parameter value in the abend call. The analytic checkers caught the first and the third. They missed the second. The LLM judge gave the translation an overall score of 5, "mostly accurate," and one of its four reasoning points correctly identified the wrong exception type. Another point raised a problem that did not exist, a claim that variables were used before assignment, and a third wrongly declared the ABEND translation correct. The judge never detected the first or third fault. Each method caught what the other missed, and neither caught everything. If I were running a program that moves a core ledger, that single example would be enough to settle whether one validation method is sufficient.

The arithmetic of long programs makes this worse. The same paper observes that if a program has ten paragraphs and each is translated with 90 percent accuracy, the probability of a fully correct program is only about 34 percent. The exact figure for 0.9 to the tenth power is 0.349, so the paper's number is a slightly low rounding, and the point stands either way: roughly one program in three. Real programs have far more than ten paragraphs. A translator that sounds excellent per unit can be unreliable per program, and the business works at the level of the program, because a ledger that is right ninety times out of a hundred is wrong.

The second IBM paper, from different authors in IBM Research and IBM Z Software, goes after behavior directly. It generates unit tests for the COBOL using symbolic execution, mocks the external calls, converts the tests into JUnit, and runs them against the Java. The point is to run the same inputs through both programs and compare outcomes, which is the nearest thing to an equivalence argument that practice allows. The paper reports coverage of the generated COBOL tests, measured as branch coverage per paragraph. On 51 multi-path paragraphs from two IBM demo applications, 43 (84 percent) reached full branch coverage and 46 (90 percent) exceeded 80 percent. On an internal IBM compiler benchmark of 94,524 paragraphs, 87,725 (92.8 percent) reached full branch coverage. Those numbers describe how well the generated tests exercise the COBOL, not how often the Java matched it. The Java side appears only through representative programs: one set of four generated tests all passed, and another set of two both failed because the translation had inverted a loop condition. The COBOL tested for WS-EXITEARLY equal to 'Y' while the Java tested for equal to 'N', which is correct only if the variable can hold nothing but those two values. The authors also describe where the harness runs out. COBOL checks specific SQL return codes, Java reports SQL errors as general exceptions, and so a Java test cannot always reach the path for a particular non-zero SQL code. Variables that become local in Java cannot be asserted. A test that passes against a mock that misrepresents the middleware proves agreement with the mock, and the paper's own examples show where that gap opens.

The Microsoft team's account of its agent factory makes the same point from the other direction. The authors write that deterministic control structures, especially tests, were crucial for verifying and validating the agents' output. Their post reports no conversion accuracy and no test pass rates. I find that candor useful. It tells me the validation harness was needed for the same reason the agents were needed: the model's output is a hypothesis, and something outside the model has to test it.

Here is the pattern I would expect to hold up, framed as a hypothetical because none of the sources report an end-to-end cutover. Take a month of real production inputs for a batch job, run them through the COBOL system and the Java system, and diff every output record. Add the rare paths that symbolic execution surfaces and that production data may never have exercised. Keep the legacy system running behind the new one for a defined period, with a decision rule written in advance for what a discrepancy means and who decides. The harness is evidence from three directions, and the rollback plan is the answer to what happens when the evidence turns out to be incomplete.

There is a cost consequence in that last sentence. The harness takes real engineering effort, probably more than anyone budgets, and the IBM evaluation paper itself reports that dynamic testing, meaning compiling and executing the translated code, has so far yielded the lowest return on investment among its techniques, largely because the project did not yet support error-free translation of full programs. The cheap checks are cheap because they are partial. The expensive check is expensive because it is the one that looks like the truth, and IBM's low return on it reflects translation quality at the time, so I would expect the return to improve as the translations do. A modernization plan that prices the translation and treats the validation as overhead has the economics backward, because the validation determines whether the cutover date holds.

The question a board should ask is also the one that vendors rarely volunteer. How much of the legacy behavior has been exercised against the new system, and who decided that was enough? The answer is a number, and it can be tracked from the first week.


Sources: Hans et al., "Automated Testing of COBOL to Java Transformation," IBM Research and IBM Z Software (arXiv 2504.10548, Apr 2025); Froimovich et al., "Quality Evaluation of COBOL to Java Code Transformation," IBM Research (arXiv 2507.23356, Jul 2025); Microsoft All Things Azure, "How We Use AI Agents for COBOL Migration and Mainframe Modernization" (Julia Kordick and Gustav Kaleta, Jul 9, 2025).