Comparing Commit Messages and Source Code Metrics for the Prediction Refactoring Activities

被引:11
|
作者
Sagar, Priyadarshni Suresh [1 ]
AlOmar, Eman Abdulah [1 ]
Mkaouer, Mohamed Wiem [1 ]
Ouni, Ali [2 ]
Newman, Christian D. [1 ]
机构
[1] Rochester Inst Technol, New York, NY 14623 USA
[2] Univ Quebec, Ecole Technol Super, Quebec City, PQ H3C 1K3, Canada
关键词
refactoring; software quality; commits; software metrics; software engineering; SOFTWARE; CLASSIFICATION;
D O I
10.3390/a14100289
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Understanding how developers refactor their code is critical to support the design improvement process of software. This paper investigates to what extent code metrics are good indicators for predicting refactoring activity in the source code. In order to perform this, we formulated the prediction of refactoring operation types as a multi-class classification problem. Our solution relies on measuring metrics extracted from committed code changes in order to extract the corresponding features (i.e., metric variations) that better represent each class (i.e., refactoring type) in order to automatically predict, for a given commit, the method-level type of refactoring being applied, namely Move Method, Rename Method, Extract Method, Inline Method, Pull-up Method, and Push-down Method. We compared various classifiers, in terms of their prediction performance, using a dataset of 5004 commits and extracted 800 Java projects. Our main findings show that the random forest model trained with code metrics resulted in the best average accuracy of 75%. However, we detected a variation in the results per class, which means that some refactoring types are harder to detect than others.
引用
收藏
页数:20
相关论文
共 50 条
  • [31] A catalog of metrics at source code level for vulnerability prediction: A systematic mapping study
    Codabux, Zadia
    Zakia Sultana, Kazi
    Chowdhury, Md Naseef-Ur-Rahman
    JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2024, 36 (07)
  • [32] Web service QoS prediction using improved software source code metrics
    Rangarajan, Sarathkumar
    Liu, Huai
    Wang, Hua
    PLOS ONE, 2020, 15 (01):
  • [33] Machine learning based software fault prediction utilizing source code metrics
    Bhandari, Guru Prasad
    Gupta, Ratneshwer
    PROCEEDINGS ON 2018 IEEE 3RD INTERNATIONAL CONFERENCE ON COMPUTING, COMMUNICATION AND SECURITY (ICCCS), 2018, : 40 - 45
  • [34] Analysing Bug Prediction Capabilities of Static Code Metrics in Open Source Software
    Ferzund, Javed
    Ahsan, Syed Nadeem
    Wotawa, Franz
    SOFTWARE PROCESS AND PRODUCT MEASUREMENT, 2008, 5338 : 331 - 343
  • [35] Code Smell Analyzer: A Tool To Teaching Support Of Refactoring Techniques Source Code
    Sirqueira, T. F. M.
    Brandl, A. H. M.
    Pedro, E. J. P.
    Silva, R. S.
    Araujo, M. A. P.
    IEEE LATIN AMERICA TRANSACTIONS, 2016, 14 (02) : 877 - 884
  • [36] Design of e-activities for the learning of code refactoring tasks
    Lopez, Carlos
    Alonso, Jesus M.
    Marticorena, Raul
    Maudes, Jesus M.
    2014 International Symposium on Computers in Education (SIIE), 2014, : 35 - 40
  • [37] Pattern-based refactoring process of sequential source code
    Molitorisz, Korbinian
    PROCEEDINGS OF THE 17TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING (CSMR 2013), 2013, : 357 - 360
  • [38] Refactoring Android Source Code Smells From Android Applications
    Fawad, Muhammad
    Rasool, Ghulam
    Riaz, Muhammad Bilal
    IEEE ACCESS, 2025, 13 : 14122 - 14150
  • [39] Comparing Software Architecture Descriptions and Raw Source-Code: A Statistical Analysis of Maintainability Metrics
    Anjos, Eudisley
    Castor, Fernando
    Zenha-Rela, Mario
    COMPUTATIONAL SCIENCE AND ITS APPLICATIONS (ICCSA 2013), PT III, 2013, 7973 : 199 - 213
  • [40] An infrastructure to support meta-differencing and refactoring of source code
    Collard, ML
    18TH IEEE INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, PROCEEDINGS, 2003, : 377 - 380