构建首个评估AI代码迁移能力的基准,专测Java项目升级
FreshBrew: A Benchmark for Evaluating AI Agents on Java Code Migration
- 设计高覆盖率项目集,评估AI在迁移中保持语义一致性的能力
- 顶级模型仅成功迁移52.3%的项目,暴露现有方法局限性
- 为可信自动化代码升级提供可复现评估工具,适合研发与测试团队
AI编程助手正快速融入现代软件开发。面对不断演进的软件生态,代码库持续迁移与现代化成为关键挑战。传统方式依赖规则系统与人工干预。随着大语言模型(LLMs)的发展,基于AI的代理框架提供了新路径,但其有效性尚未系统评估。本文提出FreshBrew,一个面向项目级Java迁移的新基准,重点评估代理在保持程序语义和避免奖励滥用方面的能力,并强调高测试覆盖率对严谨评估的重要性。我们在228个仓库上评估多个前沿LLM,结果表明,表现最佳的Gemini 2.5 Flash模型仅能成功迁移52.3%的项目至JDK 17。实证分析揭示了当前代理方法在真实场景中的关键优劣势,为提升其实际应用价值提供了洞见。通过发布FreshBrew,我们旨在推动可复现、严谨的评估,加速AI驱动代码库现代化的发展。
原文摘要 · Abstract (English)
AI coding assistants are rapidly becoming integral to modern software development. A key challenge in this space is the continual need to migrate and modernize codebases in response to evolving software ecosystems. Traditionally, such migrations have relied on rule-based systems and human intervention. With the advent of powerful large language models (LLMs), AI-driven agentic frameworks offer a promising alternative-but their effectiveness has not been systematically evaluated. In this paper, we introduce FreshBrew, a novel benchmark for evaluating AI agents on project-level Java migrations, with a specific focus on measuring an agent's ability to preserve program semantics and avoid reward hacking, which we argue requires projects with high test coverage for a rigorous and reliable evaluation. We benchmark several state-of-the-art LLMs, and compare their performance against established rule-based tools. Our evaluation of AI agents on this benchmark of 228 repositories shows that the top-performing model, Gemini 2.5 Flash, can successfully migrate 52.3 percent of projects to JDK 17. Our empirical analysis reveals novel insights into the critical strengths and limitations of current agentic approaches, offering actionable insights into their real-world applicability. Our empirical study reveals failure modes of current AI agents in realistic Java modernization tasks, providing a foundation for evaluating trustworthy code-migration systems. By releasing FreshBrew, we aim to facilitate rigorous, reproducible evaluation and catalyze progress in AI-driven codebase modernization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。