Enhancing Code Refactoring with AI: Automating Software Improvement Processes

Authors

  • Anbarasu Arivoli Target, Minneapolis, MN, USA. Author

DOI:

https://doi.org/10.63530/IJCSITR_2023_04_02_009

Keywords:

AI-driven refactoring, code smells, machine learning, software design patterns, software maintenance

Abstract

Refactoring is a standard practice in software development aimed at improving code structure without altering its behavior. While essential for long-term maintainability, the process often demands significant time and manual effort, especially in large or legacy codebases. Recent advances in artificial intelligence offer practical methods to support and automate various stages of refactoring, from identifying code smells to applying design improvements. This paper reviews the use of machine learning models for detecting structural issues in code, explores AI techniques that recommend or implement design pattern enhancements, and compares AI-assisted refactoring with traditional manual approaches. The paper also outlines a proposed solution framework that combines automated smell detection, intelligent code transformation, and developer validation. Practical considerations such as accuracy, workflow integration, and balancing automation and control are discussed. The findings highlight how AI tools, when used carefully, can help teams improve code quality more consistently and efficiently.

References

Marinescu, R. (2004). Detection strategies: Metrics-based rules for detecting design flaws. Proceedings of the 20th IEEE International Conference on Software Maintenance, 350–359.

Azeem, M., Palomba, F., Shihab, E., & Wang, Q. (2019). Machine learning techniques for code smell detection: A systematic literature review. Journal of Systems and Software, 155, 65–95.

Tufano, M., Watson, C., Bavota, G., Poshyvanyk, D., & Di Penta, M. (2020). Deep learning similarities from different representations of source code. Empirical Software Engineering, 25(3), 1874–1914.

Ouni, A., Kessentini, M., Sahraoui, H., & Inozemtseva, L. (2017). Search-based software refactoring: A systematic literature review. Information and Software Technology, 81, 159–175.

Mahmoudi, M., Shiri, M. E., & Rabiee, H. R. (2020). Automatic code refactoring through Q-learning. Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, 664–668.

Zaidman, A., Van Rompaey, B., Demeyer, S., & Van Deursen, A. (2010). Studying the relation between refactorings and software defect prediction. Software Quality Journal, 18(4), 383–417.

Palomba, F., Bavota, G., Penta, M. D., Oliveto, R., & De Lucia, A. (2015). Mining version histories for detecting code smells. IEEE Transactions on Software Engineering, 41(5), 462–489.

Bharadwaj, R., & Parker, I. (2023). Double-edged sword of LLMs: mitigating security risks of AI-generated code. In Disruptive Technologies in Information Sciences VII (Vol. 12542, pp. 141–146). SPIE.

McIntosh, S., Kamei, Y., Adams, B., & Hassan, A. E. (2014). An empirical study of the impact of modern code review practices on software quality. Empirical Software Engineering, 21(5), 2146–2189.

Chui, M., Hall, B., Mayhew, H., Singla, A., & Sukharevsky, A. (2022). The state of AI in 2022—and a half decade in review. McKinsey & Company.

Amazon Web Services. (2021). Improving the CPU and latency performance of Amazon applications using Amazon CodeGuru Profiler. AWS DevOps Blog.

Cheirdari, F., & Karabatis, G. (2018). Analyzing false positive source code vulnerabilities using static analysis tools. In 2018 IEEE International Conference on Big Data (Big Data) (pp. 4782–4788). IEEE.

Downloads

Published

17-12-2023

How to Cite

Anbarasu Arivoli. (2023). Enhancing Code Refactoring with AI: Automating Software Improvement Processes. International Journal of Computer Science and Information Technology Research , 4(2), 86-99. https://doi.org/10.63530/IJCSITR_2023_04_02_009