Escalating LLM-based Code Translation Benchmarking into the Class-level Era
Authors:
- Pengyu XuePXPengyu Xue
- Linhao WuLWLinhao Wu
- Chengyi WangCWChengyi Wang
- Xiang LiXLXiang Li
- Zhen YangZYZhen Yang
- Ruikai JinRJRuikai Jin
- Yuxiang ZhangYZYuxiang Zhang
- Jia LiJLJia Li
- Yifei PeiYPYifei Pei
- Zhaoyan ShenZSZhaoyan Shen
- Xiran LyuXLXiran Lyu
Preprint
Abstract
In recent years, Large Language Models (LLMs) have significantly improved automated code translation, often achieving over 80% accuracy on existing benchmarks. However, most of these benchmarks consist of short, standalone, algorithmic samples that do not reflect practical coding tasks. To address this gap, we introduce ClassEval-T, a class-level code translation benchmark designed to assess LLM performance on real-world coding scenarios. Built upon ClassEval, a class-level Python code generation benchmark covering topics such as database operations and game design, ClassEval-T extends into Java and C++ with complete code samples and test suites, requiring 360 person-hours for manual migration. We propose three translation strategies (holistic, min-dependency, and standalone) and evaluate six recent LLMs across various families and sizes on ClassEval-T. Results reveal a significant performance drop compared to method-level benchmarks, highlighting discrepancies among LLMs and demonstrating ClassEval-T's effectiveness. We further analyze LLMs' dependency awareness in translating class samples and categorize 1,397 failure cases by the best-performing LLM for practical insights and future improvement.Keywords
All Related Versions
This publication has 10 references indexed in Scilit:
- aiXcoder-7B: A Lightweight and Effective Large Language Model for Code Processing2025
- Structured Chain-of-Thought Prompting for Code GenerationACM Transactions on Software Engineering and Methodology, 2025
- Unraveling the Potential of Large Language Models in Code Translation: How Far are We?2024
- AceCoder : An Effective Prompting Technique Specialized in Code GenerationACM Transactions on Software Engineering and Methodology, 2024
- Automated Commit Message Generation With Large Language Models: An Empirical Study and BeyondIEEE Transactions on Software Engineering, 2024
- A search-and-fill strategy to code generation for complex software requirementsInformation and Software Technology, 2024
- Exploring and Unleashing the Power of Large Language Models in Automated Code TranslationProceedings of the ACM on Software Engineering, 2024
- Deciphering the Impact of Pretraining Data on Large Language Models through Machine Unlearning2024
- DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositories2024
- Syntax and Domain Aware Model for Unsupervised Program Translation2023