Advancing Automated In-Isolation Validation in Repository-Level Code Translation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Ke, Kaiyao, Ibrahimzada, Ali Reza, Pan, Rangeet, Sinha, Saurabh, Jabbarvand, Reyhaneh
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917165265846272
author Ke, Kaiyao
Ibrahimzada, Ali Reza
Pan, Rangeet
Sinha, Saurabh
Jabbarvand, Reyhaneh
author_facet Ke, Kaiyao
Ibrahimzada, Ali Reza
Pan, Rangeet
Sinha, Saurabh
Jabbarvand, Reyhaneh
contents Repository-level code translation aims to migrate entire repositories across programming languages while preserving functionality automatically. Despite advancements in repository-level code translation, validating the translations remains challenging. This paper proposes TRAM, which combines context-aware type resolution with mock-based in-isolation validation to achieve high-quality translations between programming languages. Prior to translation, TRAM retrieves API documentation and contextual code information for each variable type in the source language. It then prompts a large language model (LLM) with retrieved contextual information to resolve type mappings across languages with precise semantic interpretations. Using the automatically constructed type mapping, TRAM employs a custom serialization/deserialization workflow that automatically constructs equivalent mock objects in the target language. This enables each method fragment to be validated in isolation, without the high cost of using agents for translation validation, or the heavy manual effort required by existing approaches that rely on language interoperability. TRAM demonstrates state-of-the-art performance in Java-to-Python translation, underscoring the effectiveness of its integration of RAG-based type resolution with reliable in-isolation validation.
format Preprint
id arxiv_https___arxiv_org_abs_2511_21878
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Advancing Automated In-Isolation Validation in Repository-Level Code Translation
Ke, Kaiyao
Ibrahimzada, Ali Reza
Pan, Rangeet
Sinha, Saurabh
Jabbarvand, Reyhaneh
Software Engineering
Programming Languages
Repository-level code translation aims to migrate entire repositories across programming languages while preserving functionality automatically. Despite advancements in repository-level code translation, validating the translations remains challenging. This paper proposes TRAM, which combines context-aware type resolution with mock-based in-isolation validation to achieve high-quality translations between programming languages. Prior to translation, TRAM retrieves API documentation and contextual code information for each variable type in the source language. It then prompts a large language model (LLM) with retrieved contextual information to resolve type mappings across languages with precise semantic interpretations. Using the automatically constructed type mapping, TRAM employs a custom serialization/deserialization workflow that automatically constructs equivalent mock objects in the target language. This enables each method fragment to be validated in isolation, without the high cost of using agents for translation validation, or the heavy manual effort required by existing approaches that rely on language interoperability. TRAM demonstrates state-of-the-art performance in Java-to-Python translation, underscoring the effectiveness of its integration of RAG-based type resolution with reliable in-isolation validation.
title Advancing Automated In-Isolation Validation in Repository-Level Code Translation
topic Software Engineering
Programming Languages
url https://arxiv.org/abs/2511.21878