?
Рефакторинг исходного кода на основе LLM и расширения UML
The article presents a method for refactoring source code based on the integration of a large language model (LLM) and an extended UML model of the software code. The proposed approach makes it possible to identify problematic code sections using anxiety functions and structural class metrics, and then perform automated refactoring. A key feature of the method is the use of LLM to generate formal specifications in OCL (Object Constraint Language), which are then used to automatically verify the correctness of transformations by checking invariants, pre- and post-conditions. The UML extension includes local variables, method actions, and the relationships between them, which enables low‑level analysis and correct code transformation. Experimental verification has shown that the LLM + UML* method ensures high accuracy in defect detection, complete elimination of alarm features, and preservation of system functionality.