# Dissimilarity Space Based Multi-Source Cross-Project Defect Prediction
## 4 Experiments
### Performance Index  
In this paper, the prediction results are measured according to the indexes of F-measure, AUC (Area Under ROC Curve), and cost-effectiveness. The performance index is calculated based on the confusion matrix shown in Table 3. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Project** & **Examples** & **Defect Class** & **\%Defective** & **Features** \\ \hline \multicolumn{5}{c}{NASA} \\ \hline CM1 & 327 & 42 & 12.84 & 37 \\ PC1 & 705 & 61 & 8.65 & 37 \\ PC2 & 745 & 16 & 2.15 & 36 \\ PC3 & 1563 & 160 & 10.24 & 37 \\ PC4 & 1287 & 177 & 13.75 & 37 \\ PC5 & 1723 & 471 & 27.34 & 39 \\ KC1 & 1183 & 314 & 26.54 & 21 \\ KC2 & 522 & 107 & 20.49 & 21 \\ KC3 & 194 & 36 & 18.56 & 39 \\ KC4 & 125 & 61 & 48.80 & 42 \\ MC1 & 327 & 42 & 12.84 & 37 \\ MC2 & 125 & 55 & 35.20 & 39 \\ MW1 & 253 & 27 & 10.67 & 37 \\ JM1 & 10878 & 2105 & 19.35 & 21 \\ \hline \multicolumn{5}{c}{SOFTLAB} \\ \hline ar3 & 63 & 8 & 12.70 & 29 \\ ar4 & 107 & 20 & 18.69 & 29 \\ ar5 & 36 & 8 & 22.22 & 29 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Data set. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Metrics** & **Type** & **Metric** & **Type** \\ \hline UniqOpnd & DHalstead & LOC & McCabe \\ TotalOp & DHalstead & EV(g) & McCabe \\ UniqOp & DHalstead & V(g) & McCabe \\ TotalOpnd & DHalstead & IV(g) & McCabe \\ L & DHalstead & LOCcode & LineCount \\ V & DHalstead & LOCCcomment & LineCount \\ N & DHalstead & LOCBlank & LineCount \\ I & DHalstead & LOCCodeAndcomment & LineCount \\ D & DHalstead & B & DHalstead \\ T & DHalstead & E & DHalstead \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Software metric element. True Positive (TP): represents the number of positive samples predicted as positive classes. False Positive (FP): represents the number of positive samples predicted as negative classes. False Negative (FN): represents the number of negative samples predicted as positive class. True Negative (TN): represents the number of negative samples predicted as negative classes. F-measure is determined by both recall and precision, and its value is close to the smaller value of both. So that the larger F-measure means that both recall and precision are larger, the formula is shown in (13), where \(\alpha\) is used to regulate the relative importance of precision and recall, and its value is usually at 1. \[\text{F-measure}\;=\frac{(1+\alpha)\times\text{recall}\times\text{precision}}{ \text{recall}+\alpha*\text{precision}} \tag{13}\]  
\[\text{recall}\;=\frac{\text{TP}}{\text{TP}+\text{FN}} \tag{14}\]  
\[\text{precision}\;=\frac{\text{TP}}{\text{TP}+\text{FP}} \tag{15}\]  
Recall is the ratio of correctly predicting the number of defective modules to the number of real defective modules, indicating how many positive samples are correctly predicted. Precision is the ratio between correctly predicting the number of defective modules and the number of all predicted defective modules, indicating how many predictions are correct in positive samples. AUC is defined as the area under the receiver operating characteristics (ROC) curve. This performance indicator is one of the criteria for judging the two-category model. Cost-effectiveness refers to maximizing benefits by spending the same cost. Cost-effectiveness measures the percentage of defects that can be identified by the predictive model by examining the top 20 percent of the samples [11; 25]. [PERSON] et al. consider that the cost of software includes not only the effort of inspecting the defective modules, but also the failure cost of classifying a defective sample as a non-defective sample [26]. Incorrectly predicted defective samples will have a greater impact on software. Therefore, they propose a measurement method based on confusion matrix, and the cost-effectiveness is calculated according to the Equation (16). Compared with other methods, this method is more concise, and it is not affected by the order and the size of defect modules.