Home / Journals / CMC / Online First / doi:10.32604/cmc.2024.057697
Special Issues
Table of Content

Open Access

ARTICLE

A Fine-Grained Defect Prediction Method Based on Drift-Immune Graph Neural Networks

Fengyu Yang1,2,*, Fa Zhong2, Xiaohui Wei1, Guangdong Zeng2
1 School of Aerospace Engineering, Nanjing University of Aeronautics and Astronautics, Nanjing, 210016, China
2 School of Software, Nanchang Hangkong University, Nanchang, 330029, China
* Corresponding Author: Fengyu Yang. Email: email

Computers, Materials & Continua https://doi.org/10.32604/cmc.2024.057697

Received 25 August 2024; Accepted 15 November 2024; Published online 09 December 2024

Abstract

The primary goal of software defect prediction (SDP) is to pinpoint code modules that are likely to contain defects, thereby enabling software quality assurance teams to strategically allocate their resources and manpower. Within-project defect prediction (WPDP) is a widely used method in SDP. Despite various improvements, current methods still face challenges such as coarse-grained prediction and ineffective handling of data drift due to differences in project distribution. To address these issues, we propose a fine-grained SDP method called DIDP (drift-immune defect prediction), based on drift-immune graph neural networks (DI-GNN). DIDP converts source code into graph representations and uses DI-GNN to mitigate data drift at the model level. It also analyses key statements leading to file defects for a more detailed SDP approach. We evaluated the performance of DIDP in WPDP by examining its file-level and statement-level accuracy compared to state-of-the-art methods, and by examining its cross-project prediction accuracy. The results of the experiment show that DIDP showed significant improvements in F1-score and Recall@Top20%LOC compared to existing methods, even with large software version changes. DIDP also performed well in cross-project SDP. Our study demonstrates that DIDP achieves impressive prediction results in WPDP, effectively mitigating data drift and accurately predicting defective files. Additionally, DIDP can rank the risk of statements in defective files, aiding developers and testers in identifying potential code issues.

Keywords

Software defect prediction; data drift; graph neural networks; information bottleneck
  • 105

    View

  • 34

    Download

  • 0

    Like

Share Link