DepWareTrans: Dependency-Aware Incremental Repository Migration across Co-executable Languages

Sivajeet Chand, Alexander Pretschner, Steve Haupt, Derui Zhu, Sushant Kumar PandeyarXiv 2026

TL;DR

While Large Language Models (LLMs) excel at translating individual code files, they struggle with repository-scale migrations because they break complex, cross-file dependencies. DepWareTrans solves this by analyzing codebase dependency graphs to group interdependent files into "dependency-consistent batches" for joint translation. This approach achieves 100% compilation and test success when migrating a 51K line-of-code industrial system from Java to Kotlin, while slashing LLM token consumption by over 70%.

What Problem Does This Paper Address?

Software migration—such as moving a legacy Java codebase to Kotlin to leverage modern features like null-safety—is a massive engineering headache. While incremental migration is theoretically possible for "co-executable" languages (those sharing a runtime like the JVM or .NET), doing it automatically at scale remains an open challenge.

Current state-of-the-art LLM migration tools operate file-by-file or fragment-by-fragment. When files are translated in isolation, the implicit invariants between them shatter. This leads to dependency inconsistency: compilation errors due to missing symbols, mismatched types, or broken APIs at the boundaries between translated and untranslated files. Even when developers use iterative feedback loops (feeding compiler errors back to the LLM), the model gets trapped in endless cycles of fixing one file only to break another.

Methods

DepWareTrans introduces a dependency-aware incremental migration framework that shifts the unit of translation from isolated files to structurally cohesive subgraphs.

Figure 1: Overview of the dependency-aware migration framework. The process begins with dependency analysis (file-level graph construction and SCC-based cycle handling), followed by readiness evaluation based on dependency status and migration state. Ready batches are translated using an LLM and validated via compilation and testing, with errors iteratively refined through feedback. Sub-steps within each stage are executed in a top-to-bottom order as shown in the figure.

The pipeline consists of four major phases:

  1. Dependency Analysis & Cycle Handling: The framework builds a file-level directed dependency graph. Because real-world codebases are full of cyclic dependencies, it uses Strongly Connected Components (SCCs) to detect these loops and collapse them into single atomic component nodes, creating an acyclic graph (DAG).
  2. Batch Construction: It partitions the component-level DAG into "dependency-consistent batches" (up to 25 files per batch), ensuring that mutually dependent files are kept together and external dependencies are resolved sequentially.
  3. Batch-Level Translation: Instead of feeding single files to an LLM, DepWareTrans prompts the model with the entire batch simultaneously, alongside relevant external context (like referenced method signatures and interfaces).
  4. Iterative Validation: Leveraging language interoperability, the framework integrates the translated batch into the mixed-language repository and runs the actual build system and test suite. If compilation or test failures occur, the exact error logs are fed back to the LLM for localized refinement.
Figure 2: Dependency-aware batch construction. Source files are modeled as a dependency graph; cycles are collapsed into SCCs as atomic units. The graph is then partitioned into dependency-consistent batches, grouping interdepen- dent files for coherent translation.

Datasets

The authors evaluated DepWareTrans across several open-source and industrial codebases:

  • STAR (Industrial System): A production project management web application comprising 51,020 lines of code (LOC) across 1,470 Java files with a 96.47% line test coverage.
  • Apache Commons Repositories: Six widely used open-source Java libraries (cli, codec, csv, exec, fileupload, text) ranging from 5K to 29K LOC.
  • Cross-Language Benchmarks: To test generalizability, they included repositories for Java→Scala (Commons Text) and C#→F# (GuardClauses, MediatR, csharp-mcp).

Key Insights and Ideas

  • Linkage is the Real Enemy: An analysis of migration failures reveals that the bottleneck isn't the LLM's ability to translate logic locally. Instead, over 96% of failures in complex repositories stem from compile-time reference breakages (cannot find symbol).
  • Feedback Needs Stable Boundaries: Iterative error correction fails at the file level because the surrounding context is unstable. By batching interdependent files, DepWareTrans localizes errors, making compiler feedback highly actionable for the LLM.
  • Batching Saves Tokens: Counterintuitively, sending multiple files at once drastically reduces costs. Because batching prevents the LLM from entering failing, repetitive feedback loops, it yields a 70.5% reduction in total token consumption compared to file-by-file baselines.

Key Results

The experimental results highlight a massive performance gap between traditional file-by-file methods and the dependency-aware approach:

  • The Industrial Trial (STAR): Standard file-by-file translation with feedback failed completely on the production repository, yielding only 38.16% compilation success and a dismal 9.39% test success rate. DepWareTrans achieved 100% compilation and test success, converging in an average of 3.45 iterations per batch.
  • Instant Success on Complex Repos: For the commons-text library, file-by-file methods stalled at an 8.04% test success rate. DepWareTrans achieved 100% success on the very first try without even needing the feedback loop, proving that structural grouping alone resolves the majority of migration errors.
  • Ecosystem Agnostic: The framework successfully generalized across different language pairs (Java→Scala, C#→F#) and backend models (including GPT and Claude variants), consistently reaching 100% end-to-end correctness where baselines fluctuated wildly.

Limitations and Future Work

Despite its success, DepWareTrans hits a speed bump when encountering "architectural hubs"—exceptionally large, highly central classes. For instance, in the commons-csv repository, the framework capped out at 91.67% success due to a single 3K LOC builder class that broke under strict API constraints. The authors note that these massive hub components may still require specialized decomposition or manual developer guidance.

Additionally, the framework is strictly bound to co-executable language pairs that share a runtime. Migrating across non-interoperable boundaries (e.g., Java to Rust or C++ to Go) remains an open problem, as intermediate mixed-language states cannot be easily compiled and tested.

Summary updated

BibTeX
@misc{chand2026depwaretrans,
  author = {Sivajeet Chand and Alexander Pretschner and Steve Haupt and Derui Zhu and Sushant Kumar Pandey},
  title = {{DepWareTrans: Dependency-Aware Incremental Repository Migration across Co-executable Languages}},
  year = {2026},
  eprint = {2608.14128},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.14128},
}
Figure