Skeleton-Guided-Translation: A Benchmarking Framework for Code Repository Translation with Fine-Grained Quality Evaluation

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Zhang, Xing, Wen, Jiaheng, Yang, Fangkai, Zhao, Pu, Kang, Yu, Wang, Junhao, Wang, Maoquan, Huang, Yufan, Nallipogu, Elsie, Lin, Qingwei, Dang, Yingnong, Rajmohan, Saravan, Zhang, Dongmei, Zhang, Qi
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866913666964652032
author Zhang, Xing
Wen, Jiaheng
Yang, Fangkai
Zhao, Pu
Kang, Yu
Wang, Junhao
Wang, Maoquan
Huang, Yufan
Nallipogu, Elsie
Lin, Qingwei
Dang, Yingnong
Rajmohan, Saravan
Zhang, Dongmei
Zhang, Qi
author_facet Zhang, Xing
Wen, Jiaheng
Yang, Fangkai
Zhao, Pu
Kang, Yu
Wang, Junhao
Wang, Maoquan
Huang, Yufan
Nallipogu, Elsie
Lin, Qingwei
Dang, Yingnong
Rajmohan, Saravan
Zhang, Dongmei
Zhang, Qi
contents The advancement of large language models has intensified the need to modernize enterprise applications and migrate legacy systems to secure, versatile languages. However, existing code translation benchmarks primarily focus on individual functions, overlooking the complexities involved in translating entire repositories, such as maintaining inter-module coherence and managing dependencies. While some recent repository-level translation benchmarks attempt to address these challenges, they still face limitations, including poor maintainability and overly coarse evaluation granularity, which make them less developer-friendly. We introduce Skeleton-Guided-Translation, a framework for repository-level Java to C# code translation with fine-grained quality evaluation. It uses a two-step process: first translating the repository's structural "skeletons", then translating the full repository guided by these skeletons. Building on this, we present TRANSREPO-BENCH, a benchmark of high quality open-source Java repositories and their corresponding C# skeletons, including matching unit tests and build configurations. Our unit tests are fixed and can be applied across multiple or incremental translations without manual adjustments, enhancing automation and scalability in evaluations. Additionally, we develop fine-grained evaluation metrics that assess translation quality at the individual test case level, addressing traditional binary metrics' inability to distinguish when build failures cause all tests to fail. Evaluations using TRANSREPO-BENCH highlight key challenges and advance more accurate repository level code translation.
format Preprint
id arxiv_https___arxiv_org_abs_2501_16050
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Skeleton-Guided-Translation: A Benchmarking Framework for Code Repository Translation with Fine-Grained Quality Evaluation
Zhang, Xing
Wen, Jiaheng
Yang, Fangkai
Zhao, Pu
Kang, Yu
Wang, Junhao
Wang, Maoquan
Huang, Yufan
Nallipogu, Elsie
Lin, Qingwei
Dang, Yingnong
Rajmohan, Saravan
Zhang, Dongmei
Zhang, Qi
Software Engineering
Artificial Intelligence
The advancement of large language models has intensified the need to modernize enterprise applications and migrate legacy systems to secure, versatile languages. However, existing code translation benchmarks primarily focus on individual functions, overlooking the complexities involved in translating entire repositories, such as maintaining inter-module coherence and managing dependencies. While some recent repository-level translation benchmarks attempt to address these challenges, they still face limitations, including poor maintainability and overly coarse evaluation granularity, which make them less developer-friendly. We introduce Skeleton-Guided-Translation, a framework for repository-level Java to C# code translation with fine-grained quality evaluation. It uses a two-step process: first translating the repository's structural "skeletons", then translating the full repository guided by these skeletons. Building on this, we present TRANSREPO-BENCH, a benchmark of high quality open-source Java repositories and their corresponding C# skeletons, including matching unit tests and build configurations. Our unit tests are fixed and can be applied across multiple or incremental translations without manual adjustments, enhancing automation and scalability in evaluations. Additionally, we develop fine-grained evaluation metrics that assess translation quality at the individual test case level, addressing traditional binary metrics' inability to distinguish when build failures cause all tests to fail. Evaluations using TRANSREPO-BENCH highlight key challenges and advance more accurate repository level code translation.
title Skeleton-Guided-Translation: A Benchmarking Framework for Code Repository Translation with Fine-Grained Quality Evaluation
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2501.16050