Bridging Gaps in LLM Code Translation: Reducing Errors with Call Graphs and Bridged Debuggers
Open Access
- 27 October 2024
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 2448-2449
Abstract
When using large language models (LLMs) for code translation of complex software, numerous compilation and runtime errors can occur due to insufficient context awareness. To address this issue, this paper presents a code translation method based on call graphs and bridged debuggers: TransGraph. TransGraph first obtains the call graph of the entire code project using the Language Server Protocol, which provides a detailed description of the function call relationships in the program. Through this structured view of the code, LLMs can more effectively handle large-scale and complex codebases, significantly reducing compilation errors. Furthermore, TransGraph, combined with bridged debuggers and dynamic test case generation, significantly reduces runtime errors, overcoming the limitations of insufficient test case coverage in traditional methods. In experiments on six datasets including CodeNet and Avatar, TransGraph outperformed existing code translation methods and LLMs in terms of translation accuracy, with improvements of up to 10.2%.Keywords
This publication has 4 references indexed in Scilit:
- CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-X2023
- Migrating Monoliths to Microservices-based Customizable Multi-tenant Cloud-native Apps2021
- The DStar Method for Effective Software Fault LocalizationIEEE Transactions on Reliability, 2013
- Spectrum-Based Multiple Fault Localization2009