TRANSMISSION // 2612.00798v1
When AI Migrates Java to Kotlin, Passing Tests Isn’t Enough
Source published
A benchmark of real Java-to-Kotlin repository migrations finds that build and test success can hide incomplete conversions and compatibility problems.

Java and Kotlin can coexist in one project—which makes gradual migration possible, but also makes it easy for a conversion to look complete when Java files remain. J2KMigBench tests two AI coding agents on real repository tasks, checking not just whether projects build and tests pass, but whether every requested file is actually converted.
The question behind the benchmark
Moving a Java project to Kotlin is not simply a matter of rewriting syntax. The new code has to work with existing callers, build settings and tests. Because Java and Kotlin interoperate, a project may continue to build and pass tests even if some requested Java files were never replaced. That creates a gap between “the project still works” and “the migration is done.”
In J2KMigBench, Moshood A. Fakorede, Marcoantoni Rubio-Gonzalez and Umar Farooq ask how often AI coding agents can complete this kind of in-place migration while preserving a project’s checks—and what the resulting Kotlin looks like compared with developers’ versions.
Building realistic tasks
The researchers started with Java-to-Kotlin changes in real GitHub pull requests. After checking whether projects could be rebuilt and run in an offline environment, and whether tasks met their selection criteria, they retained 31 tasks from six repositories. These involved 167 requested Java-to-Kotlin file pairs. The agent received the original Java, a task description based on the source and pull-request information, and a working project environment. The developer’s Kotlin implementation was withheld.
Two models—Gemini 3.8 Flash and GPT-6.1 Terra—ran through the OpenHands coding-agent framework, using the same task budget and configuration. Each model was run once per task. The benchmark counted a task as resolved only if the project compiled, its stable baseline tests still passed, and every requested Java file had been replaced by its Kotlin counterpart. The three checks matter separately: passing tests alone does not prove that the migration is complete.
What the agents achieved
Gemini resolved 25 of 31 tasks, or 80.6%; Terra resolved 26, or 83.9%. Their overall task counts were close, but other measures differed. Gemini converted 141 of the 167 requested file pairs, compared with Terra’s 129. Terra’s average reported model cost was lower: $0.15 per task, versus $1.25 for Gemini. These are costs for model calls, not the full cost of using or reviewing an agent.
The clearest warning came from patches that built and preserved the tests while converting at most one requested file. Six patches fit that description. In one example, Java files remained in place, supplying behavior that let the project’s tests continue to pass. In other cases, converted code caused trouble at the boundary with existing callers: for example, changing a Java record to a Kotlin data class left record-style accessor calls uncompilable.
This is why the benchmark treats file completion as its own requirement. A successful build and passing tests are useful evidence, but they do not establish that the requested work was carried out—or that every relevant behavior and interface is preserved.
Similarity is not a style verdict
The researchers also compared generated Kotlin with the developers’ versions. On 112 files converted by both models, Gemini’s mean token edit similarity was 0.57 and Terra’s was 0.53. That says Gemini’s code was somewhat closer under this particular text-based measure; it does not establish that it was more correct or better written.
The authors also counted selected language constructs, including ways Kotlin handles nulls and property accessors. The agents made different choices from the developers and from each other. But these counts cannot, by themselves, determine whether a choice is idiomatic: behavior, interface requirements and surrounding code all matter. The study does not rank the models’ Kotlin style.
What remains uncertain
The results are a snapshot, not a broad verdict on AI migration. The evaluation covers 31 tasks across six repositories, two models and one agent configuration, with only one run per model per task. Outcomes could differ on another run, with other projects, or with different models and tools. The authors also note that a stable passing test set does not prove behavioral equivalence or that the tests cover every important case. Agent-written characterization tests were not independently frozen and replayed against both versions, so they cannot settle that question here.
The work is an arXiv preprint, and the supplied source does not establish that it has been peer reviewed. Its findings should therefore be read as an early benchmark result. Within that scope, the practical message is specific: evaluating repository migrations requires checking build health, tests and completion separately, while treating similarity and style indicators as evidence to inspect—not as substitutes for correctness.
- Java to Kotlin migration
- AI coding agents
- software engineering
- J2KMigBench
- repository-level benchmarking
- code compatibility
Reviewed cross-references
These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.
Biomedical coding agents can miss the science behind the code
Supporting evidence: Both papers show a bounded limitation of test-based evaluation: in J2KMigBench, six migration patches passed builds and baseline tests while converting at most one requested file; in MEDSWE-BENCH, over 80% of scientific failures passed agents’ local tests while violating scientific or repository requirements. The tasks and failure criteria differ, so this supports the need for checks beyond local test success, not a direct comparison of benchmark performance.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2612.00798v1 — Original paper
Excerpt reference:
static/papers/2612.00798v1.md:473-549
Basis: Paper text
Source file SHA-256:c34292bbe6d8eb63cf236a3139724c0c1ab9450358b84aa98ffb1c08493733c92612.01540v1 — Original paper
Excerpt reference:
static/papers/2612.01540v1.md:816-871
Basis: Paper text
Source file SHA-256:d8ef7b836596060f0974ba36987a3c02a97f8eff5e4ce475db6da53c67ed0963
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
A change-cost view of software complexity
Source published
Shared keywords: ai coding agents, software engineering
When AI Coding Agents Should Delegate
Source published
Shared keywords: ai coding agents, software engineering
For Code-Finding Agents, Exploration Beat Extra Structure
Source published
Shared keywords: ai coding agents, software engineering
Why AI coding agents need more than a rulebook
Source published
Shared keywords: ai coding agents
When AI coding agents get a map to the rules
Source published
Shared keywords: ai coding agents, software engineering