# Improving Software Defect Prediction in Noisy Imbalanced Datasets
## 1 Introduction  
Defects in software systems often lead to software errors and losses [1; 2]. With the development of software technology, the scale and complexity of software have grown rapidly, and software testing to discover and correct software defects has become increasingly expensive. To optimize software testing schemes, software defect prediction (SDP) is used to identify modules in software systems that may contain defects and to improve the efficiency and performance of software testing. In recent years, with the rapid development of machine learning technology, many researchers have applied machine learning to software defect prediction [3] and have achieved remarkable results [4; 5]. For machine learning to predict software defects, software defect metrics first need to be defined in order to characterize the distribution of defects. At present, CK metrics [6], process metrics [7; 8; 9; 10], and network metrics [11; 12; 13; 14; 15] are widely used for this task. The quality of the software defect dataset is one of the most important factors that affect the performance of SDP. In real-world software projects, defects usually exist in very few modules, so the defect samples in the software defect dataset are far smaller than the clean samples, resulting in serious class imbalance problems and reducing the performance of defect prediction [16]. Many scholars have proposed methods to solve the class imbalance problem, but these rebalancing methods are still limited in their application and performance [17]. Most of the existing dataset rebalancing methods are based on undersampling and oversampling [18]. Undersampling can effectively solve the class imbalance problem, but the instances discarded during undersampling may containinformation useful or important for predicting defects [19]. In SDP, oversampling is often more effective than undersampling, and minority class sample generation methods such as SMOTE and MAHAKIL [20; 21] can effectively alleviate the class imbalance problem, but these oversampling methods generate overfitting noise that can degrade the predictive performance of the model [22]. Another problem with software defect datasets involves the way labels on software samples are manually marked by testers or developers [23]. Samples may be erroneously labeled due to insufficient knowledge of the defects, the time difference between defect introduction and defect discovery, or new defects caused by defect correction [24]; this mislabeling introduces noise in the dataset, which deteriorates its quality and reduces the performance of defect prediction. At present, there are few studies on the noise of software defect datasets in the SDP field [25; 26]. To reduce the noise in the dataset, using propensity score matching (PSM), a noise reduction method used in machine learning [27], may be a good idea, being a statistical method that achieves noise reduction by addressing the difference between the distribution of the observed data and the overall distribution. This paper proposes a novel method for predicting software defects using data pre-processing. Named US-PONR--for Undersampling, Propensity-Score-Matching-Based Oversampling and Noise Reduction--this method aims to improve the quality of software defect datasets by addressing deficiencies caused by class imbalance and dataset noise. The method uses undersampling in data pre-processing to remove duplicate samples that result from multiple versions of the data. And the method uses propensity score matching (PSM) to oversample and reduce noise in the dataset, which alleviate the introduction of overfitting noise. To predict defects, an aggregated multi-classifier trained under a cross-validation (CV) scoring method was built to construct the predictor.