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 条
  • [21] Understanding Source Code Differences by Separating Refactoring Effects
    Thangthumachit, Sirinut
    Hayashi, Shinpei
    Saeki, Motoshi
    2011 18TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2011), 2011, : 339 - 347
  • [22] Insecurity Refactoring: Automated Injection of Vulnerabilities in Source Code
    Schuckert, Felix
    Katt, Basel
    Langweg, Hanno
    COMPUTERS & SECURITY, 2023, 128
  • [23] Towards an Autonomous Bot for Automatic Source Code Refactoring
    Wyrich, Marvin
    Bogner, Justus
    2019 IEEE/ACM 1ST INTERNATIONAL WORKSHOP ON BOTS IN SOFTWARE ENGINEERING (BOTSE 2019), 2019, : 24 - 28
  • [24] WCET optimization strategy based on source code refactoring
    Fanqi Meng
    Xiaohong Su
    Cluster Computing, 2019, 22 : 5563 - 5572
  • [25] WCET optimization strategy based on source code refactoring
    Meng, Fanqi
    Su, Xiaohong
    CLUSTER COMPUTING-THE JOURNAL OF NETWORKS SOFTWARE TOOLS AND APPLICATIONS, 2019, 22 (Suppl 3): : S5563 - S5572
  • [26] Code and commit metrics of developer productivity: a study on team leaders perceptions
    Edson Oliveira
    Eduardo Fernandes
    Igor Steinmacher
    Marco Cristo
    Tayana Conte
    Alessandro Garcia
    Empirical Software Engineering, 2020, 25 : 2519 - 2549
  • [27] Impermanent identifiers: Enhanced source code comprehension and refactoring
    Guerra, Eduardo Martins
    Ivo, Andre A. S.
    Pereira, Fernando O.
    Robbes, Romain
    Janes, Andrea
    Silveira, Fabio Fagundes
    JOURNAL OF SYSTEMS AND SOFTWARE, 2024, 216
  • [28] Code and commit metrics of developer productivity: a study on team leaders perceptions
    Oliveira, Edson
    Fernandes, Eduardo
    Steinmacher, Igor
    Cristo, Marco
    Conte, Tayana
    Garcia, Alessandro
    EMPIRICAL SOFTWARE ENGINEERING, 2020, 25 (04) : 2519 - 2549
  • [29] On the Co-Occurrence of Refactoring of Test and Source Code
    Nagy, Nicholas Alexandre
    Abdalkareem, Rabe
    2022 MINING SOFTWARE REPOSITORIES CONFERENCE (MSR 2022), 2022, : 122 - 126
  • [30] A Systematic Literature Survey of Software Metrics, Code Smells and Refactoring Techniques
    Agnihotri, Mansi
    Chug, Anuradha
    JOURNAL OF INFORMATION PROCESSING SYSTEMS, 2020, 16 (04): : 915 - 934