# A Novel Approach for Software Defect prediction Based on the Power Law Function
## 3 Experimental
### Comparative Experiment  
To verify the performance of the proposed software defect prediction approach, we selected four classic algorithms used for defect prediction with unlabeled datasets: k-means [16; 17], CLA and CLAMI (Clustering and labeling Approach based on Matrix Instances) [4], and x-means [18]. These traditional methods are based on classical data clustering method, such as k-means, x-means and so on. We compared the proposed approach with these algorithms on twelve randomly selected public datasets [43; 44; 45]. These public datasets are produced from real software systems, with different sizes and types, which can be utilized as a representation for different software systems. Details of datasets used in the comparative experiment (Section 3.3) are shown in Table 3. The selected algorithms were common unsupervised software defect prediction algorithms. \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Actual**} & \multicolumn{2}{c}{**Predicted**} \\ \cline{2-3}  & **True** & **False** \\ \hline True & TP (true positive) & FN (false negative) \\ False & FP (false positive) & TN (true negative) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Confusion matrix. Tables 4-6 show comparisons of _precision_, _recall_, and _F-measure_ results between the proposed approach and other methods in the comparative experiment. The highest values of each dataset are highlighted in bold. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Datasets**} & \multicolumn{5}{c}{**Methods**} \\ \cline{2-5}  & **K-Means** & **CLA** & **CLAMI** & **X-Means** &
\begin{tabular}{c} **Power Law** \\ **Function Approach** \\ \end{tabular} \\ \hline Camel1.6 & 0.146 & 0.247 & 0.247 & 0.256 & **0.276** \\ Forrest-0.8 & 0.040 & 0.076 & 0.070 & 0.071 & **0.125** \\ Synapse-1.0 & 0.033 & 0.189 & 0.029 & 0.034 & **0.194** \\ Berek & **1.000** & 0.636 & 0.632 & 0.385 & 0.778 \\ Intercafe & - & 0.230 & 0.230 & 0.111 & **0.231** \\ Termo & 0.400 & 0.467 & 0.500 & 0.421 & **0.571** \\ Pleeans2 & 0.276 & **0.375** & 0.308 & 0.276 & 0.364 \\ ar1 & 0.138 & 0.115 & 0.107 & **0.250** & 0.119 \\ ar4 & 0.333 & **0.340** & 0.307 & 0.600 & 0.333 \\ ar5 & **0.636** & 0.470 & 0.444 & 0.630 & 0.444 \\ Apache & 0.714 & 0.726 & 0.737 & 0.625 & **0.737** \\ Safe & **0.733** & 0.640 & 0.630 & 0.650 & 0.607 \\ \hline Average & **0.404** & 0.376 & 0.353 & 0.359 & 0.398 \\ \hline \hline \end{tabular} Boldface typeface indicates the highest value of each dataset.  
\end{table} 
Table 4: Comparisons of precision results between the proposed approach and other methods. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Group**} & \multirow{2}{*}{**Dataset**} & \multicolumn{2}{c}{**\# of instances**} & \multirow{2}{*}{**\# of Metrics**} \\ \cline{3-3} \cline{5-5}  & & **All** & **Buggy (\%)** \\ \hline \multirow{8}{*}{Promise} & Camel1.6 & 965 & 188 (19.48\%) \\  & Forrest-0.8 & 32 & 2 (6.25\%) \\ \cline{1-1}  & Synapse-1.0 & 157 & 16 (10.19\%) \\ \cline{1-1}  & Berek & 43 & 16 (37.21\%) \\ \cline{1-1}  & Intercafe & 27 & 4 (14.81\%) \\ \cline{1-1}  & Termo & 42 & 13 (30.95\%) \\ \cline{1-1}  & Pbean2 & 51 & 10 (19.61\%) \\ \cline{1-1}  & ar1 & 121 & 9 (7.44\%) \\ \cline{1-1}  & ar4 & 107 & 20 (18.69\%) \\ \cline{1-1}  & ar5 & 36 & 8 (22.22\%) \\ \cline{1-1}  & Apache & 194 & 98 (50.52\%) \\ \cline{1-1}  & Safe & 56 & 22 (39.29\%) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Overview of experimental datasets. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Datasets**} & \multicolumn{5}{c}{**Methods**} \\ \cline{2-5}  & **K-Means** & **CLA** & **CLAMI** & **X-Means** & \begin{tabular}{c} **Power Law** \\ **Function Approach** \\ \end{tabular}