Legacy Code Test Generator Using Large Language Model

Read full text
Cited by: 0

Abstract

Legacy software systems continue to support critical enterprise applications; however, many such systems suffer from inadequate documentation and limited unit test coverage.These deficiencies significantly increase maintenance effort, hinder safe refactoring, and raise the likelihood of regression defects during software evolution.Manual creation of documentation and unit tests for legacy systems is costly, time-consuming, and often infeasible due to the absence of original design knowledge.This paper proposes a lightweight and privacy-preserving framework for automated documentation and unit test generation for legacy Java systems using a code-oriented Large Language Model (LLM).The proposed approach leverages DeepSeek-Coder 6.7B-Instruct, deployed locally to ensure source-code con-fidentiality, and operates directly on raw Java source files without requiring external artifacts such as bug reports, specifications, or pre-existing test suites.A web-based interface implemented using Gradio enables seamless integration into developer maintenance workflows.The framework performs method-level semantic analysis to generate structured, human-readable documentation and exe-cutable JUnit test cases that cover normal, boundary, and excep-tional execution paths.Experimental observations demonstrate that the generated test cases are syntactically correct, compile successfully, and enhance code comprehensibility.The results indicate that code-specialized LLMs can effectively assist devel-opers in maintaining and modernizing legacy software systems while reducing manual effort and risk.

Fields of Study & Subjects

Software Testing and Debugging Techniques VLSI and Analog Circuit Testing Engineering and Test Systems

Publication details

Journal / source
International Research Journal of Modernization in Engineering Technology and Science
Publication date
10 January 2026