CODEMENV: Benchmarking Large Language Models on Code Migration

Large language models (LLMs) have shown remarkable capabilities across various software engineering tasks; however, their effectiveness in code migration-adapting code to run in different environments-remains insufficiently studied.In this work, we introduce CODEMENV: Code Migration Across Environment, a new benchmark specifically designed to assess LLMs' abilities in code migration scenarios.CODEMENV consists of 922 examples spanning 19 Python and Java packages, and covers three core tasks:(1) identifying functions incompatible with specific versions, (2) detecting changes in function definitions, and (3) adapting code to target environments.Experimental evaluation with seven LLMs on CODEMENV yield an average pass@1 rate of 26.50%, with GPT-4O achieving the highest score at 43.84%.Key findings include: (i) LLMs tend to be more proficient with newer function versions, which aids in migrating legacy code, and (ii) LLMs sometimes exhibit logical inconsistencies by identifying function changes irrelevant to the intended migration environment.The datasets are available at https://github.com/xdshen-ai/ Benchmark-of-Code-Migration.

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.findings-acl.140
Citations
2
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
4.96

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

CODEMENV: Benchmarking Large Language Models on Code Migration

Yang Cao, Yihao Yang, Muhammad Ali, Lijie Hu et al.
2 citations
Natural Language Processing Techniques
4.96
article

CODEMENV: Benchmarking Large Language Models on Code Migration

Yang Cao, Yihao Yang, Muhammad Ali, Lijie Hu, Xudong Shen, Lei Wang, Keyuan Cheng, Hanbin Wang, TengyueWang TengyueWang
article en
2 citations

Abstract

Large language models (LLMs) have shown remarkable capabilities across various software engineering tasks; however, their effectiveness in code migration-adapting code to run in different environments-remains insufficiently studied.In this work, we introduce CODEMENV: Code Migration Across Environment, a new benchmark specifically designed to assess LLMs' abilities in code migration scenarios.CODEMENV consists of 922 examples spanning 19 Python and Java packages, and covers three core tasks:(1) identifying functions incompatible with specific versions, (2) detecting changes in function definitions, and (3) adapting code to target environments.Experimental evaluation with seven LLMs on CODEMENV yield an average pass@1 rate of 26.50%, with GPT-4O achieving the highest score at 43.84%.Key findings include: (i) LLMs tend to be more proficient with newer function versions, which aids in migrating legacy code, and (ii) LLMs sometimes exhibit logical inconsistencies by identifying function changes irrelevant to the intended migration environment.The datasets are available at https://github.com/xdshen-ai/ Benchmark-of-Code-Migration.

King Abdullah University of Science and Technology
Reduced inequalities
Openalex Percentile: Top 5%
Natural Language Processing Techniques
4.96
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

CODEMENV: Benchmarking Large Language Models on Code Migration — Yang Cao, Yihao Yang, et al. · (2025) | TGRS Research Map | TGRS