Refactoring $\neq$ Bug-Inducing: Improving Defect Prediction with Code Change Tactics Analysis

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Niu, Feifei, Shao, Junqian, Mayr-Dorn, Christoph, Huang, Liguo, Assunção, Wesley K. G., Li, Chuanyi, Ge, Jidong, Egyed, Alexander
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866908468435222528
author Niu, Feifei
Shao, Junqian
Mayr-Dorn, Christoph
Huang, Liguo
Assunção, Wesley K. G.
Li, Chuanyi
Ge, Jidong
Egyed, Alexander
author_facet Niu, Feifei
Shao, Junqian
Mayr-Dorn, Christoph
Huang, Liguo
Assunção, Wesley K. G.
Li, Chuanyi
Ge, Jidong
Egyed, Alexander
contents Just-in-time defect prediction (JIT-DP) aims to predict the likelihood of code changes resulting in software defects at an early stage. Although code change metrics and semantic features have enhanced prediction accuracy, prior research has largely ignored code refactoring during both the evaluation and methodology phases, despite its prevalence. Refactoring and its propagation often tangle with bug-fixing and bug-inducing changes within the same commit and statement. Neglecting refactoring can introduce bias into the learning and evaluation of JIT-DP models. To address this gap, we investigate the impact of refactoring and its propagation on six state-of-the-art JIT-DP approaches. We propose Code chAnge Tactics (CAT) analysis to categorize code refactoring and its propagation, which improves labeling accuracy in the JIT-Defects4J dataset by 13.7%. Our experiments reveal that failing to consider refactoring information in the dataset can diminish the performance of models, particularly semantic-based models, by 18.6% and 37.3% in F1-score. Additionally, we propose integrating refactoring information to enhance six baseline approaches, resulting in overall improvements in recall and F1-score, with increases of up to 43.2% and 32.5%, respectively. Our research underscores the importance of incorporating refactoring information in the methodology and evaluation of JIT-DP. Furthermore, our CAT has broad applicability in analyzing refactoring and its propagation for software maintenance.
format Preprint
id arxiv_https___arxiv_org_abs_2507_19714
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Refactoring $\neq$ Bug-Inducing: Improving Defect Prediction with Code Change Tactics Analysis
Niu, Feifei
Shao, Junqian
Mayr-Dorn, Christoph
Huang, Liguo
Assunção, Wesley K. G.
Li, Chuanyi
Ge, Jidong
Egyed, Alexander
Software Engineering
Just-in-time defect prediction (JIT-DP) aims to predict the likelihood of code changes resulting in software defects at an early stage. Although code change metrics and semantic features have enhanced prediction accuracy, prior research has largely ignored code refactoring during both the evaluation and methodology phases, despite its prevalence. Refactoring and its propagation often tangle with bug-fixing and bug-inducing changes within the same commit and statement. Neglecting refactoring can introduce bias into the learning and evaluation of JIT-DP models. To address this gap, we investigate the impact of refactoring and its propagation on six state-of-the-art JIT-DP approaches. We propose Code chAnge Tactics (CAT) analysis to categorize code refactoring and its propagation, which improves labeling accuracy in the JIT-Defects4J dataset by 13.7%. Our experiments reveal that failing to consider refactoring information in the dataset can diminish the performance of models, particularly semantic-based models, by 18.6% and 37.3% in F1-score. Additionally, we propose integrating refactoring information to enhance six baseline approaches, resulting in overall improvements in recall and F1-score, with increases of up to 43.2% and 32.5%, respectively. Our research underscores the importance of incorporating refactoring information in the methodology and evaluation of JIT-DP. Furthermore, our CAT has broad applicability in analyzing refactoring and its propagation for software maintenance.
title Refactoring $\neq$ Bug-Inducing: Improving Defect Prediction with Code Change Tactics Analysis
topic Software Engineering
url https://arxiv.org/abs/2507.19714