DOI QR코드

DOI QR Code

Analyzing Characteristics of Code Refactoring for Python Deep-Learning Applications

파이썬 딥러닝 응용의 코드 리팩토링 특성 분석

  • 김동관 (목포해양대학교 컴퓨터공학과)
  • Received : 2022.09.01
  • Accepted : 2022.10.04
  • Published : 2022.10.28

Abstract

Code refactoring refers to a maintenance task to change the code of a software system in order to consider new requirements, fix bugs, and restructure code. There have been various studies of refactoring subjects such as refactoring types, refactoring benefits, and CASE tools. However, Java applications rather than python ones have been benefited by refactoring-based coding practices. There are few cases of refactoring stuides on Python applications. This paper finds and analyzes single refactoring operations and composite refactoring operations for Python-based deep learning systems. In addition, we find that there is a statistically significant difference in the frequency of occurrence of single and complex refactoring operations in the two groups of deep learning applications and typical Python applications. Furthermore, we analyze keywords of commit messages to catch refactoring intentions of software developers.

코드 리팩토링은 소프트웨어 시스템의 코드를 변경함으로써 새로운 요구사항 반영, 버그 수정, 코드 구조화 등을 달성하기 위한 유지보수 활동이다. 리팩토링 유형, 리팩토링 효과, 지원 도구 등에 관한 다양한 연구가 진행 중이다. 하지만, 많은 연구들이 자바 응용들을 대상으로 하고 있으며 파이썬 응용에 관한 리팩토링 연구는 사례가 많지 않다. 본 논문은 파이썬으로 개발된 딥러닝 시스템을 대상으로 단일 리팩토링과 복합 리팩토링을 식별하고 특성을 분석하였다. 또한, 딥러닝 응용과 일반 파이썬 응용 두 그룹에서 단일 및 복합 리팩토링 연산의 발생 빈도에 있어 통계학적 유의미한 차이가 있음을 확인하였다. 또한, 커밋 메시지의 키워드를 분석하여 소프트웨어 개발자들의 리팩토링 의도가 커밋 메시지에 반영되었는지를 분석하였다.

Keywords

Acknowledgement

본 논문은 2021년도 정부(교육부)의 재원으로 한국연구재단의 지원을 받아 수행된 연구임(No. 2021R1I1A3056172)

References

  1. Martin Fowler, Kent Beck, John Brant, William Opdyke, and Don Roberts, 1999. Refactoring: Improving The Design Of Existing Code (1st ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
  2. G. Lacerda, F. Petrillo, M. Pimenta, and Y. G. Gueheneuc, "Code smells and refactoring: A tertiary systematic review of challenges and observations," Journal of Systems and Software Vol.167, 2020.
  3. C. Tavares, M. Bigonha, and E. Figueiredo. "Analyzing the impact of refactoring on bad smells," In Proceedings of the 34th Brazilian Symposium on Software Engineering, 2020.
  4. C. Silva, A. Santana, E. Figueiredo, and M. A. S. Bigonha, "Revisiting the Bad Smell and Refactoring Relationship: A Systematic Literature Review," In Proceedings of the XXIII Iberoamerican Conference on Software Engineering (CIbSE), 2020.
  5. R. Haas and B. Hummel, "Deriving extract method refactoring suggestions for long methods," In International Conference on Software Quality, Springer, Cham, 2016.
  6. M. Shahidi, M. Ashtiani, and M. Zakeri-Nasrabadi, "An automated extract method refactoring approach to correct the long method code smell," J. of Systems and Software, Vol.187, 2022.
  7. A. Brito, A. Hora, and M. T. Valente. "Refactoring graphs: Assessing refactoring over time," In 2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER), IEEE, 2020.
  8. A. Brito, A. Hora, and M. T. Valente, "Towards a Catalog of Composite Refactorings," arXiv:2201.04599, 2022
  9. L. Sousa, D. Cedrim, A. Garcia, W. Oizumi, A. C. Bibiano, D. Oliveira, M. Kim, and A. Oliveira, "Characterizing and identifying composite refactorings: Concepts, heuristics and patterns," In 17th International Conference on Mining Software Repositories (MSR), 2020.
  10. A. C. Bibiano, E. Fernandes, D. Oliveira, A. Garcia, M. Kalinowski, B. Fonseca, R. Oliveira, A. Oliveira, and D. Cedrim "A quantitative study on characteristics and effect of batch refactoring on code smells," In 2019 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), IEEE, 2019.
  11. P. S. Sagar, E. A. AlOmar, M. W. Mkaouer, A. Ouni, and C. D. Newman, "Comparing commit messages and source code metrics for the prediction refactoring activities," Algorithms 14, No.10, 2021.
  12. M. Aniche, E. Maziero, R. Durelli, and V. Durelli, "The effectiveness of supervised machine learning algorithms in predicting software refactoring," IEEE Transactions on Software Engineering, Vol.48, Issue 4, 2020.
  13. H. Atwi, B. Lin, N. Tsantalis, Y. Kashiwa, Y. Kamei, N. Ubayashi, G. Bavota, and M. Lanza. "PyRef: refactoring detection in Python projects," In 2021 IEEE 21st International Working Conference on Source Code Analysis and Manipulation (SCAM), IEEE, 2021.
  14. M. Dilhara, A. Ketkar, N. Sannidhi, and D. Dig, "Discovering repetitive code changes in Python ML systems," In International Conference on Software Engineering, ACM/IEEE., 2022.
  15. Z. Chen, C. Lin, M. Wanwangying, Z. Xiaoyu, Z. Yuming, and X. Baowen, "Understanding metric-based detectable smells in Python software: A comparative study," Information and Software Technology, Vol.94, 2018.
  16. H. Jebnoun, H. B. Braiek, M. M. Rahman, and F. Khomh, "The scent of deep learning code: An empirical study," Proceedings of the 17th International Conference on Mining Software Repositories, 2020.
  17. D. Spadini, M. Aniche, and A. Bacchelli. "Pydriller: Python framework for mining software repositories," In Proceedings of the 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, 2018.