AI-Assisted Automated Code Refactoring and Technical Debt Reduction: Supporting Digital Knowledge Documentation and Preservation
DOI:
https://doi.org/10.55630/dipp.2026.16.15Keywords:
Technical Debt, Code Smell Detection, Refactoring Prioritization, Machine Learning, Digital Knowledge PreservationAbstract
Technical debt represents a persistent challenge in software engineering, characterized by design decisions that increase long-term maintenance costs and reduce software quality. This study evaluates whether AI-assisted refactoring prioritization can reduce technical debt more effectively than traditional rule-based static analysis, using cyclomatic complexity, maintainability index, and remediation effort as debt indicators. Across a dataset of 120,000 code samples and six real Java source files, AI-assisted prioritization achieves 18%–89% greater cumulative complexity reduction compared to rule-based baselines. Beyond software quality, this work contributes to the emerging field of digital knowledge documentation by demonstrating how intelligent, structured analysis tools can preserve and improve access to complex technical information assets over time.References
Azeem, M. I., Palomba, F., Shi, L., & Wang, Q. (2019). Machine learning techniques for code smell detection: A systematic literature review and meta-analysis. Information and Software Technology, 108, 115–138. https://doi.org/10.1016/j.infsof.2018.12.009
Cordeiro, J., Noei, S., & Zou, Y. (2026). An empirical study on the code refactoring capability of large language models. ACM Transactions on Software Engineering and Methodology. Advance online publication. https://doi.org/10.1145/3801158
Counsell, S., Liu, X., Eldh, S., Tonelli, R., Marchesi, M., Concas, G., & Murgia, A. (2015). Re-visiting the ‘Maintainability Index’ metric from an object-oriented perspective. In 2015 41st Euromicro Conference on Software Engineering and Advanced Applications (SEAA) (pp. 84–87). https://doi.org/10.1109/SEAA.2015.41
Dewangan, S., Rao, R. S., Chowdhuri, S. R., & Gupta, M. (2023). Severity classification of code smells using machine-learning methods. SN Computer Science, 4(5), Article 564. https://doi.org/10.1007/s42979-023-01979-8
Fontana, F. A., Mäntylä, M. V., Zanoni, M., & Marino, A. (2016). Comparing and experimenting machine learning techniques for code smell detection. Empirical Software Engineering, 21(3), 1143–1191. https://doi.org/10.1007/s10664-015-9378-4
McCabe, T. J. (1976). A complexity measure. IEEE Transactions on Software Engineering, 2(4), 308–320. https://doi.org/10.1109/TSE.1976.233837
Ouni, A., Kessentini, M., Inoue, K., & Ó Cinnéide, M. (2017). Search-based web service antipatterns detection. IEEE Transactions on Services Computing, 10(4), 603–617. https://doi.org/10.1109/TSC.2015.2502595
Pomian, D., Bellur, A., Dilhara, M., Kurbatova, Z., Bogomolov, E., Sokolov, A., Bryksin, T., & Dig, D. (2024). EM-Assist: Safe automated ExtractMethod refactoring with LLMs. In Companion Proceedings of the 32nd ACM International Conference on the Foundations of Software Engineering (FSE 2024) (pp. 582–586). https://doi.org/10.1145/3663529.3663803
Sandouka, R., & Aljamaan, H. (2023). Python code smells detection using conventional machine learning models. PeerJ Computer Science, 9, Article e1370. https://doi.org/10.7717/peerj-cs.1370
Shirafuji, A., Oda, Y., Suzuki, J., Morishita, M., & Watanobe, Y. (2023). Refactoring programs using large language models with few-shot examples. In 2023 30th Asia-Pacific Software Engineering Conference (APSEC) (pp. 151–160). https://doi.org/10.1109/APSEC60848.2023.00025
Zazworka, N., Shaw, M. A., Shull, F., & Seaman, C. (2011). Investigating the impact of design debt on software quality. In Proceedings of the 2nd Workshop on Managing Technical Debt (MTD '11) (pp. 17–23). https://doi.org/10.1145/1985362.1985366
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Digital Presentation and Preservation of Cultural and Scientific Heritage

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
