Refactoring a Codebase with and without Generative AI: A Comparative Study

Authors

  • Anna Hou Shepherd University
  • Skylar Myers Shepherd University
  • Rachael Poffenberger Shepherd University
  • Weidong Liao Shepherd University

DOI:

https://doi.org/10.55632/pwvas.v98i1.1308

Abstract

Anna Hou, Skylar Myers, Rachael Poffenberger, and Dr. Weidong Liao (Faculty Advisor), Dept of Computer and Information Sciences, Shepherd University, Shepherdstown, WV, 25443. Refactoring a Codebase with and without Generative AI: A Comparative Study.

The objective of this study is to compare the efficiency and accuracy of software refactoring workflows with and without Generative AI tools.

Maintaining legacy software is traditionally a time-intensive process involving manual code comprehension, test generation, and structural alteration. We conducted a comparative study of the workflows for refactoring an existing legacy codebase. The first workflow is the traditional and manual one that relies on standard static analysis and IDE features. The second workflow utilizes Generative AI assistants, specifically Google AntiGravity and Gemini Code Assist. Our comparative analysis measured the time expended, the number of logical errors introduced, and the overall improvement in code readability. The results indicate that the AI-assisted workflow significantly reduced the time required for initial code comprehension and boilerplate unit test generation. The AI tools rapidly identified technical debt and generated functional refactoring snippets. However, the traditional manual workflow, while slower, would result in fewer architectural misalignments during complex dependency injections. We conclude that Generative AI significantly accelerates the refactoring process, particularly in the discovery and test generation phases, but rigorous human oversight remains critical to ensure structural integrity and prevent AI-generated logic errors. This project was supported by the National Science Foundation S-STEM grant awarded to Shepherd University.

 

Author Biography

Weidong Liao, Shepherd University

Associate Professor of Computer and Information Sciences

Downloads

Published

2026-04-08

How to Cite

Hou, A., Myers, S., Poffenberger, R., & Liao, W. (2026). Refactoring a Codebase with and without Generative AI: A Comparative Study. Proceedings of the West Virginia Academy of Science, 98(1). https://doi.org/10.55632/pwvas.v98i1.1308

Issue

Section

Meeting Abstracts-Poster