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 条
  • [1] Enhancing Source Code Refactoring Detection with Explanations from Commit Messages
    Krasniqi, Rrezarta
    Cleland-Huang, Jane
    PROCEEDINGS OF THE 2020 IEEE 27TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER '20), 2020, : 512 - 516
  • [2] Can Refactoring be Self-Affirmed? An Exploratory Study on How Developers Document their Refactoring Activities in Commit Messages
    AlOmar, Eman Abdullah
    Mkaouer, Mohamed Wiem
    Ouni, Ali
    2019 IEEE/ACM 3RD INTERNATIONAL WORKSHOP ON REFACTORING (IWOR 2019), 2019, : 51 - 58
  • [3] On Automatically Generating Commit Messages via Summarization of Source Code Changes
    Fernando Cortes-Coy, Luis
    Linares-Vasquez, Mario
    Aponte, Jairo
    Poshyvanyk, Denys
    2014 14TH IEEE INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM 2014), 2014, : 275 - 284
  • [4] Source Code Metrics for Software Defects Prediction
    Rebro, Dominik Arne
    Rossi, Bruno
    Chren, Stanislav
    38TH ANNUAL ACM SYMPOSIUM ON APPLIED COMPUTING, SAC 2023, 2023, : 1469 - 1472
  • [5] Importance and Aptitude of Source code Density for Commit Classification into Maintenance Activities
    Honel, Sebastian
    Ericsson, Morgan
    Lowe, Welf
    Wingkvist, Anna
    2019 IEEE 19TH INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY (QRS 2019), 2019, : 109 - 120
  • [6] Source Code Rejuvenation Is Not Refactoring
    Pirkelbauer, Peter
    Dechev, Damian
    Stroustrup, Bjarne
    SOFSEM 2010: THEORY AND PRACTICE OF COMPUTER SCIENCE, PROCEEDINGS, 2010, 5901 : 639 - 650
  • [7] On the Impact of Refactoring Operations on Code Quality Metrics
    Chaparro, Oscar
    Bavota, Gabriele
    Marcus, Andrian
    Di Penta, Massimiliano
    2014 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2014, : 456 - 460
  • [8] An Approach for Source Code Classification Using Software Metrics and Fuzzy Logic to Improve Code Quality with Refactoring Techniques
    Lerthathairat, Pornchai
    Prompoon, Nakornthip
    SOFTWARE ENGINEERING AND COMPUTER SYSTEMS, PT 3, 2011, 181 : 478 - 492
  • [9] Refactoring Edit History of Source Code
    Hayashi, Shinpei
    Omori, Takayuki
    Zenmyo, Teruyoshi
    Maruyama, Katsuhisa
    Saeki, Motoshi
    2012 28TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), 2012, : 617 - 620
  • [10] Automating Source Code Refactoring in the Classroom
    AlOmar, Eman Abdullah
    Mkaouer, Mohamed Wiem
    Ouni, Ali
    PROCEEDINGS OF THE 55TH ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION, SIGCSE 2024, VOL. 1, 2024, : 60 - 66