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 条
  • [41] An Automated Refactoring Approach to Remove Unnecessary Complexity in Source Code
    Magalhaes, Nathan Manera
    Campos Junior, Heleno de Souza
    Pereira Araujo, Marco Antonio
    Neves, Vania de Oliveira
    II BRAZILIAN SYMPOSIUM ON SYSTEMATIC AND AUTOMATED SOFTWARE TESTING (SAST 2017), 2017,
  • [42] Self-Admitted Technical Debt in Commit Messages: Comparing Java, Python, and R
    Codabux, Zadia
    Vidoni, Melina
    Fard, Fatemeh H.
    SSRN, 2022,
  • [43] Method-Level Bug Severity Prediction using Source Code Metrics and LLMs
    Mashhadi, Ehsan
    Ahmadvand, Hossein
    Hemmati, Hadi
    2023 IEEE 34TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING, ISSRE, 2023, : 635 - 646
  • [44] Analyzing Fault Prediction Usefulness from Cost Perspective using Source Code Metrics
    Kumar, Lov
    Sureka, Ashish
    2017 TENTH INTERNATIONAL CONFERENCE ON CONTEMPORARY COMPUTING (IC3), 2017, : 71 - 77
  • [45] On the Use of Commit Messages to Support the Creation of Datasets for Fault Prediction: an Empirical Assessment
    Caulo, Maria
    Scanniello, Giuseppe
    2019 45TH EUROMICRO CONFERENCE ON SOFTWARE ENGINEERING AND ADVANCED APPLICATIONS (SEAA 2019), 2019, : 193 - 198
  • [46] Identification of refactoring opportunities for source code based on class association relationships
    Liu, Wei
    Yang, Na
    Huang, Xin-di
    Hu, Wei
    Hu, Zhi-gang
    JOURNAL OF CENTRAL SOUTH UNIVERSITY, 2020, 27 (12) : 3768 - 3778
  • [47] Comparing Code Coverage Metrics for Analog Behavioral Models
    Fuertig, Andreas
    Paschke, Moritz
    Hedrich, Lars
    2017 14TH INTERNATIONAL CONFERENCE ON SYNTHESIS, MODELING, ANALYSIS AND SIMULATION METHODS AND APPLICATIONS TO CIRCUIT DESIGN (SMACD), 2017,
  • [48] Search-Based Refactoring Detection from Source Code Revisions
    Hayashi, Shinpei
    Tsuda, Yasuyuki
    Saeki, Motoshi
    IEICE TRANSACTIONS ON INFORMATION AND SYSTEMS, 2010, E93D (04): : 754 - 762
  • [49] Source Code Metrics and Maintainability: A Case Study
    Hegedus, Peter
    Bakota, Tibor
    Illes, Laszlo
    Ladanyi, Gergely
    Ferenc, Rudolf
    Gyimothy, Tibor
    SOFTWARE ENGINEERING, BUSINESS CONTINUITY, AND EDUCATION, 2011, 257 : 272 - +
  • [50] Source code metrics: A systematic mapping study
    Nunez-Varela, Alberto S.
    Perez-Gonzalez, Hector G.
    Martinez-Perez, Francisco E.
    Soubervielle-Montalvo, Carlos
    JOURNAL OF SYSTEMS AND SOFTWARE, 2017, 128 : 164 - 197