Refactoring is a systematic process of improving code quality while preserving the functional behavior of the software. In recent years, integrated development environments (IDEs) have added or improved automatic refactoring in their features, to enhance developers’ productivity and reduce the likelihood of human errors. With the advancement and increasing popularity of large language models (LLMs), coding automation using them has gained enormous attention and has shown to be effective in performing refactorings on the source code automatically. However, this automation can carry the risk of introducing errors or hallucinations that may break or alter the software functionality. The error-proneness and the possibility of hallucinations in LLMs limit their ability to be fully integrated into an automated refactoring pipeline (e.g., IDEs) and often require humans in the loop to verify the performed modifications. In this position paper, we examine the limitations of existing LLM-based refactoring techniques. We propose research directions to address these limitations and improve the quality of LLM-based code refactoring for reliable software maintenance.
Fabian Stolp Hasso Plattner Institute, University of Potsdam, Charlotte Brandebusemeyer Hasso Plattner Institute, University of Potsdam, Franziska Hradilak Hasso Plattner Institute, University of Potsdam, Lara Kursawe Hasso Plattner Institute, University of Potsdam, Magnus Menger Hasso Plattner Institute, University of Potsdam, Franz Sauerwald Hasso Plattner Institute, University of Potsdam, Bert Arnrich Hasso Plattner Institute, University of Potsdam