# Dissimilarity Space Based Multi-Source Cross-Project Defect Prediction
## 1 Introduction  
The defect prediction model is helpful for software testers to allocate limited resources to the most error-prone software modules [1], which is important to the field of software quality assurance. Within-project defect prediction (WPDP) builds prediction models based on sufficient data from a software history store within the project, and these data satisfy the same statistical distribution. However, it is difficult to obtain sufficient training data in a new project, and as the company evolves, the previous data may no longer be applicable [2]. Cross-project defect prediction (CPDP) can solve the above problem in WPDP, and the method uses other project data to train prediction models, but due to the different development programming methods and other aspects of different projects, the distribution of source and target data sets are different [3]. [PERSON] et al. pointed out that the processing of data characteristics and processes is the key factor of CPDP method [1]. CPDP uses transferring learning methods to obtain useful information from the source domain that is similar to the distribution of the target data. This method can satisfy the same distribution hypothetical requirement between training and test data [4]. However,selecting source domain datasets randomly may result in negative transferring and poor performance because of low correlation with the target set [5]. The multi-source cross-project defect prediction method is proposed by researchers to reduce the effects of source component shift. Experts have noticed that (dis)similarity representation can enhance the expression ability of samples, and the performance of classifier could be improved in pattern recognition [6; 7]. The reason is that the dissimilarity is a crucial factor in recognition and categorization. By establishing the dissimilarity space, the original attributes of samples are replaced by the dissimilarity between pairs of samples. This method retains the original information of the dataset and makes each sample obtain the relationship with other objects, so it can enhance the discriminant ability of the sample attributes to the class label. The dissimilarity representation method maps samples into the dissimilarity space, in which several representative samples are selected from the target dataset as the prototype set. The samples of the dissimilarity space are calculated from the source domain, the target set and the prototype set. This method avoids the effects of different measurement standards for the same metric and reduces the dimension for classifiers [7]. How to build the training dataset in the dissimilarity space is critical to improving the performance of the prediction model. In this paper, a multi-source cross-project defect prediction method based on dissimilarity space (DM-CPDP) is proposed. This DM-CPDP method has three phases. In the dissimilarity space constructing phase, we select some representative samples from the target set as the prototype set. Then, the arc-cosine kernel function is used to measure the sample dissimilarity between the prototype set and the source domain or target datasets. In the training dataset selection phase, the earth mover's distance (EMD) method is used to calculate the cost, which is required to convert the data of the source domain, and in the dissimilarity space we select the corresponding samples with a small cost as the training set. In the last phase, we use the KNN method to assign labels to the unlabeled target samples, and the defect prediction model is constructed by the TrAdaBoost method in the dissimilarity space. The contributions to this paper can be highlighted as follows:  
* In order to construct dissimilarity space, we propose a framework which uses the density-based clustering method to select all density center samples of the target set as the prototype set. Then the arc-cosine kernel function is utilized to measure the sample dissimilarity between the prototype set and the source domain or target datasets.