Software Defect Prediction Method Based on Attention and Cost Sensitivity
Software defect prediction aims to identify code modules that are prone to defects in advance,assisting the software quality assurance team to appropriately allocate resources and manpower.Currently,the software defect prediction method based on stable learning lacks the global information of code images during the process of feature extraction,and disregards the influence of im-balanced data on model performance.To address these issues,a software defect prediction method based on attention and cost sensi-tivity is proposed.This method enhances the global attention module in the software defect prediction and stable learning(SDP-SL)neural network,which focuses on the features of defective codes in the images.Moreover,it improves the classifier's loss function to the cost sensitive loss function,reducing the influence of the class imbalance on the model performance.To evaluate the performance of software defect prediction method based on attention and cost sensitivity(SDP-SLAC),multiple comparative experiments are con-ducted on ten open-source Java projects in the PROMISE database.The results show that the SDP-SLAC method effectively enhances the performance of defect prediction models.
software defect predictionglobal attentioncost sensitiveclass imbalanceloss function