# Software Defect Prediction Using Heterogeneous Ensemble Classification Based on Segmented Patterns
## 6 Datasets Description  
To facilitate the replication and verification of our experiments, the proposed approach is applied to a series of 21 well-studied public and available online software defect benchmark datasets with various attributes and instances. Eleven of the studied datasets are obtained from the NASA corpus while ten from the PROMISE software engineering corpus [73]. However, the NASA corpus is a known-to-be noisy corpus [74; 75]. To avoid the effect of such noisy data on the results of our experiments, we use the cleaned version of the NASA corpus as provided by [74], which is available online ([[https://figshare.com/articles/MDP_data_sets_D_and_D_zipped_up/6071675](https://figshare.com/articles/MDP_data_sets_D_and_D_zipped_up/6071675)]([https://figshare.com/articles/MDP_data_sets_D_and_D_zipped_up/6071675](https://figshare.com/articles/MDP_data_sets_D_and_D_zipped_up/6071675))). The NASA datasets were collected from real software projects from different domains by NASA and have various software modules developed in several different programming languages including, C, C++, and Java, various scales of lines of code, and various types of software metrics. For instance, in the cleaned version of the NASA corpus, the JM1 dataset consists of 7782 instances (1672 defective/6110 defect-free) where each instance includes a total of 22 attributes, of which five are different lines of code measures, three are McCabe metrics, four are base Halstead measures, eight are derived Halstead measures, one is a branch-count, and one is a decision attribute that indicates whether a particular instance is defective or non-defective. The PROMISE datasets were collected from open source software projects developed in a variety of settings (e.g., Apache, GNU) which provides different metrics than the NASA corpus does. Table 2 shows information and some general statistics of each dataset.  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & \multicolumn{2}{c}{**Actual**} \\ \cline{2-3}  & **Defect** & **No Defect** \\ \hline Predicted defects & TP & FP \\ Predicted non-defects & FN & TN \\ \hline \hline \end{tabular}
\end{table}
Table 1: Confusion matrix.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Datasets** & **Attributes** & **Instances** & **Defects** & **Non-Defects** & **Defects\%** & **Non-Defects \%** \\ \hline cm1 & 38 & 327 & 42 & 285 & 12.8 & 87.2 \\ jm1 & 22 & 7782 & 1672 & 6110 & 21.5 & 78.5 \\ kc1 & 22 & 1183 & 314 & 869 & 26.5 & 73.5 \\ kc3 & 40 & 194 & 36 & 158 & 18.6 & 81.4 \\ mcl & 39 & 1988 & 46 & 1942 & 2.3 & 97.7 \\ mw1 & 38 & 253 & 27 & 226 & 10.7 & 89.3 \\ pc1 & 38 & 705 & 61 & 644 & 8.7 & 91.3 \\ pc2 & 37 & 745 & 16 & 729 & 2.1 & 97.9 \\ pc3 & 38 & 1077 & 134 & 943 & 12.4 & 87.6 \\ pc4 & 38 & 1287 & 177 & 1110 & 13.8 & 86.2 \\ pc5 & 39 & 1711 & 471 & 1240 & 27.5 & 72.5 \\ \hline ant-1.7 & 21 & 745 & 166 & 579 & 22.3 & 77.7 \\ camel-1.6 & 21 & 965 & 188 & 777 & 19.5 & 80.5 \\ ivy-2.0 & 21 & 352 & 40 & 312 & 11.4 & 88.6 \\ jedit-4.3 & 21 & 492 & 11 & 481 & 2.2 & 97.8 \\ log4j-1.2 & 21 & 205 & 189 & 16 & 92.2 & 7.8 \\ lucene-2.4 & 21 & 340 & 203 & 137 & 59.7 & 40.3 \\ poi-3.0 & 21 & 442 & 281 & 161 & 63.6 & 36.4 \\ tomcat-6 & 20 & 858 & 77 & 781 & 9 & 91 \\ xalan-2.6 & 21 & 885 & 411 & 474 & 46.4 & 53.6 \\ xerces-1.4 & 21 & 588 & 437 & 151 & 74.3 & 25.7 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Datasets specifications.