# Multi-Source Heterogeneous Kernel Mapping in Software Defect Prediction
###### Abstract  
Heterogeneous defect prediction (HDP) is a significant research topic in cross-project defect prediction (CPDP), due to the inconsistency of metrics used between source and target projects. While most HDP methods aim to improve the performance of models trained on data from one source project, few studies have investigated how the number of source projects affects predictive performance. In this paper, we propose a new multi-source heterogeneous kernel mapping (MSHKM) algorithm to analyze the effects of different numbers of source projects on prediction results. First, we introduce two strategies based on MSHKM for multi-source HDP. To determine the impact of the number of source projects on the predictive performance of the model, we regularly vary the number of source projects in each strategy. Then, we compare the proposed MSHKM with state-of-the-art HDP methods and within-project defect prediction (WPDP) methods, in terms of three common performance measures, using 28 data sets from five widely used projects. Our results demonstrate that, (1) in the multi-source HDP scenario, strategy 2 outperforms strategy 1; (2) for MSHKM, a lower number of source projects leads to better results and performance under strategy 1, while \(n=4\) is the optimal number under strategy 2; (3) MSHKM performs better than related state-of-the-art HDP methods; and (4) MSHKM outperforms WPDP. In summary, our proposed MSHKM algorithm provides a promising solution for heterogeneous cross-project defect prediction, and our findings suggest that the number of source projects should be carefully selected to achieve optimal predictive performance. cross-project defect prediction; heterogeneous defect prediction; product metrics; transfer learning +
Footnote †: journal: Medical  
the software under test (target project). This process is called cross-project defect prediction (CPDP) [5; 6; 7]. Furthermore, when the name, order, and number of metric elements across projects are consistent with the metric elements of the tested software, the constructed CPDP model is called a homogeneous defect prediction model, also known as a cross-project defect prediction with common metrics (CPDP-CM) model [8]. However, in practice, there are often large differences in the feature spaces of metrics and the distribution of data between source and target projects, due to differences in application domains, programming languages, development processes, and coder experience, which poses a challenge for CPDP. Generally speaking, the metrics of the source project and those of the target project frequently exhibit disparities; that is, the type or number of metrics is different; this situation is named heterogeneous. For this situation, traditional CPDP methods are not applicable and have limitations. To solve the inconsistency of metrics between source and target projects, researchers have proposed heterogeneous defect prediction (HDP) approaches [9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23]. Although there have been some studies on HDP, most of the data comes from just one source project, and the limitation of a single source project is that it is too dependent on its data quality. If the data from a source project is poorly correlated to the target one, the performance of the classifier may decrease, or even lead to a negative transfer. For a scenario with multi-source projects, negative transfers can be reduced by increasing the number of source projects. However, there are not many studies on multi-source HDP, and the models associated with it need improving. Moreover, few studies have focused on how the number of source projects impacts model performance. In practice, the experience of selecting the proper number of source projects can directly guide engineers to build high-performance models, under the premise of saving time and improving efficiency.