Leveraging LLMs for Legacy Code Modernization: Evaluation of LLM-Generated Documentation
Legacy software systems, written in outdated languages like MUMPS and mainframe assembly, pose challenges in efficiency, maintenance, staffing, and security. While LLMs offer promise for modernizing these systems, their ability to understand legacy languages is largely unknown. This paper investigates the utilization of LLMs to generate documentation for legacy code using two datasets: an electronic health records (EHR) system in MUMPS and an open-source application in IBM mainframe Assembly Language Code (ALC). We propose a prompting strategy for generating line-wise code comments and a rubric to evaluate their completeness, readability, usefulness, and hallucination. Our study assesses the correlation between human evaluations and automated metrics, such as code complexity and reference-based metrics. We find that LLM-generated comments for MUMPS and ALC are generally hallucination-free, complete, readable, and useful compared to ground-truth comments, though ALC poses challenges. However, no automated metrics strongly correlate with comment quality to predict or measure LLM performance. Our findings highlight the limitations of current automated measures and the need for better evaluation metrics for LLM-generated documentation in legacy systems.
Authors
- Paul M. Kirk (ORCID: https://orcid.org/0000-0002-0658-7338)
- S. Rosen
- Anand Patel (ORCID: https://orcid.org/0000-0002-0296-8686)
- Michael W. Doyle (ORCID: https://orcid.org/0000-0002-3560-3966)
- Emily Escamilla (ORCID: https://orcid.org/0000-0003-3845-7842)
- John P. Phillips
- Eric O. Scott (ORCID: https://orcid.org/0000-0003-2101-4420)
- A. Madan (ORCID: https://orcid.org/0000-0001-6148-5118)
- Nitin Naik (ORCID: https://orcid.org/0000-0002-0659-9646)
- William Macke
- A. Sridharan
- J. A. Zimmer
- Colin Diggs
- Zachary Robin
- Chris Glasz
- Doug Wendt
- Justin F. Brunelle
- Samruddhi Thaker
- Naveed Nekoo
- Paul Ursino
- Michael Bartholf
Institutions
- Mitre (United States) (US)
Publication Details
- Published
- 2025-05-03
- DOI
- https://doi.org/10.1109/llm4code66737.2025.00027
- Citations
- 3
- Primary Topic
- Library Science and Information Systems
- Type
- article
- Field-Weighted Citation Impact
- 9.74