arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2602.09930cs.SE
收藏

JMigBench: 一个用于评估大语言模型在源代码迁移(Java 8到Java 11)任务的基准

JMigBench: A Benchmark for Evaluating LLMs on Source Code Migration (Java 8 to Java 11)

University College London(伦敦大学学院);Nanjing University(南京大学)

Nishil Amin, Zhiwei Fei, Xiang Li, Justyna Petke, He Ye

AI总结:

JMigBench基准评估了大语言模型在Java 8到Java 11源代码迁移任务中的表现,发现其在简单API替换上有效,但对复杂迁移任务仍存在不足。

摘要:

我们构建了一个基准,用于评估大型语言模型(LLMs)在源代码迁移任务中的表现,特别是将函数从Java 8升级到Java 11。我们首先收集了来自开源仓库的功能对数据集,但由于数据质量的限制,我们构建了一个涵盖八个过时API类别的精制数据集。使用这个数据集,Mistral Codestral模型通过CodeBLEU和基于关键词的指标进行评估,以衡量词汇和语义相似性以及迁移正确性。结果表明,评估的模型(Mistral Codestral)可以处理简单的一对一API替换,但仅在11.11%的情况下实现完全迁移,但在更复杂的迁移如CORBA或JAX-WS时表现不佳。这些发现表明,Mistral Codestral可以部分减少开发者的努力,通过自动化重复的迁移任务,但尚不能在JMigBench基准范围内取代人类。该基准和分析为未来的工作提供了基础,包括扩展数据集、完善提示策略以及改进不同LLM的迁移性能。

英文摘要:

We build a benchmark to evaluate large language models (LLMs) for source code migration tasks, specifically upgrading functions from Java 8 to Java 11. We first collected a dataset of function pairs from open-source repositories, but limitations in data quality led us to construct a refined dataset covering eight categories of deprecated APIs. Using this dataset, the Mistral Codestral model was evaluated with CodeBLEU and keyword-based metrics to measure lexical and semantic similarity as well as migration correctness. Results show that the evaluated model (Mistral Codestral) can handle trivial one-to-one API substitutions with moderate success, achieving identical migrations in 11.11% of the cases, but it struggles with more complex migrations such as CORBA or JAX-WS. These findings suggest Mistral Codestral can partially reduce developer effort by automating repetitive migration tasks but cannot yet replace humans within the scope of the JMigBench benchmark. The benchmark and analysis provide a foundation for future work on expanding datasets, refining prompting strategies, and improving migration performance across different LLMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑