Abstract
Software maintenance, specifically the migration of legacy codebases to modern platforms, remains a labor-intensive task for engineers. MigrationBench is a large-scale benchmark designed to evaluate the capability of Large Language Models (LLMs) to perform repository-level migrations from Java 8 to Java 17 and 21. Unlike previous benchmarks focused on isolated code snippets, MigrationBench requires models to navigate interconnected files and resolve complex dependency issues. Our evaluation of state-of-the-art models reveals that while iterative feedback significantly improves performance, "maximal" migration—which includes full dependency upgrades—remains a formidable challenge for current AI agents.
Introduction
The rapid evolution of software ecosystems necessitates frequent migrations to leverage performance improvements and security patches. However, migrating entire repositories is significantly more complex than fixing local bugs. It requires a holistic understanding of project dependencies, build systems, and functional equivalence. MigrationBench addresses the lack of rigorous, large-scale benchmarks for this "boss level" task, providing a framework to test AI's potential in industrial-scale software evolution.
Methodology
The authors established a pipeline to curate high-quality migration tasks from thousands of GitHub repositories. A critical step involved identifying a stable "base commit" on Java 8 to ensure a reliable starting point for migration.
Evaluation Tiers
The benchmark defines two levels of success:
- Minimal Migration: The repository must compile and pass all existing unit tests on Java 17.
- Maximal Migration: In addition to minimal requirements, all project dependencies must be upgraded to their latest stable major versions, often triggering cascading breaking changes.
SD-Feedback Baseline
To simulate a realistic developer workflow, the researchers implemented a Self-Debugging (SD) Feedback loop. Instead of a single-shot generation, the LLM iteratively receives compiler errors and test failure logs, allowing it to refine its patches over multiple rounds.
Datasets
MigrationBench comprises three distinct subsets:
- migration-bench-full: 5,102 repositories with existing unit tests for primary evaluation.
- migration-bench-utg: 4,814 repositories without tests, designed for research into automated test generation.
- migration-bench-selected: A curated "gold standard" subset of 300 diverse and complex repositories used for benchmarking state-of-the-art models.
Experimental Results
The study evaluated several models, including Claude-3.5-Sonnet-v2 and Llama-3.1-70B, against a traditional rule-based tool, OpenRewrite.
Model Performance
Claude-3.5-Sonnet-v2 emerged as the top performer, particularly in the "Minimal" migration category. However, the "Maximal" migration task proved significantly harder for all models, highlighting the difficulty of managing cross-dependency breaking changes.
The Power of Iteration
A key finding was the impact of iterative feedback. Models that failed initially often reached success after 10 to 20 rounds of debugging. The efficacy of this approach scales with the number of iterations, as shown in the performance curve for Claude-3.5-Sonnet-v2.
Discussion and Limitations
The results underscore that repository context and unit tests are vital guardrails for successful migration. Larger, more complex projects see a sharp decline in success rates, suggesting that current LLMs still struggle with high-dimensional project structures.
Limitations: * Test Coverage: The benchmark's reliance on existing tests means migrations might pass without being fully functionally equivalent if coverage is low. * Idiomatic Code: Current metrics do not evaluate whether the migrated code utilizes modern Java features (e.g., Records) effectively. * Dependency Scope: The "Maximal" task is currently limited to a subset of 240 popular dependencies.
Conclusion
MigrationBench provides a rigorous testing ground for the next generation of AI software engineers. While models like Claude-3.5-Sonnet-v2 show promise, the gap between minimal compilation and full modernization indicates that repository-level migration remains an open research challenge.
Summary updated