# An Improved Confounding Effect Model for Software Defect Prediction
## 4 Experiments and Results
### Presence and Extent of Confounding Effect  
We analyze the extent of the confounding effect on each metric using the method introduced in Section 3.3. The data results are shown in Table 4. The indexes in Table 4 correspond to those of Table 3. Since the number of metrics collected by each project varies, we use #NA to represent empty items, which means the metric is not included in this project. It can be observed that the range of change in the odds ratio is widely distributed. \begin{table}
\begin{tabular}{c l l} \hline \hline
**No.** & **MetricName** & **Description** \\ \hline
9 & DECISION\_COUNT & number of decisions \\ \hline
10 & DECISION\_DENSITY & decision complexity \\ \hline
11 & DESIGN\_COMPLEXITY & design complexity \\ \hline
12 & DESIGN\_DENSITY & design density \\ \hline
13 & EDGE\_COUNT & number of boundary \\ \hline
14 & ESSENTIAL\_COMPLEXITY & Intrinsic complexity \\ \hline
15 & ESSENTIAL\_DENSITY & Intrinsic density \\ \hline
16 & LOC\_EXECTABLE & number of executable lines \\ \hline
17 & PARAMETER\_COUNT & number of parameters \\ \hline
18 & GLOBAL\_DATA\_COMPLEXITY & global data complexity \\ \hline
19 & GLOBAL\_DATA\_DENSITY & global data density \\ \hline
20 & HALSTEAD\_CONTENT & content metric \\ \hline
21 & HALSTEAD\_DifficUITY & complexity \\ \hline
22 & HALSTEAD\_EFFORT & programming efficiency \\ \hline
23 & HALSTEAD\_ERROR\_EST & misprediction \\ \hline
24 & HALSTEAD\_LENGTH & program length \\ \hline
25 & HALSTEAD\_LEVEL & programming language class \\ \hline
26 & HALSTEAD\_PROG\_TIME & how long wrote the program \\ \hline
27 & HALSTEAD\_VOLUME & program capacity \\ \hline
28 & MAINTENANCE\_SEVERITY & maintenance severity \\ \hline
29 & MODIFIED\_CONDITION\_COUNT & modify the number of conditional statements \\ \hline
30 & MULTIPLE\_CONDITION\_COUNT & number of conditional statements \\ \hline
31 & NODE\_COUNT & number of nodes \\ \hline
32 & NORMALIZED\_CYLOMATIC\_COMPLEXITY & canonical cyclomatic complexity \\ \hline
33 & NUM\_OPERANDS & number of operands \\ \hline
34 & NUM\_OPERATORS & number of operators \\ \hline
35 & NUM\_UNIQUE\_OPERANDS & number of special operands \\ \hline
36 & NUM\_UNIQUE\_OPERATORS & number of special operators \\ \hline
37 & NUMBER\_OF\_LINES & number of rows \\ \hline
38 & PERCENT\_COMMENTS & percent of comments \\ \hline
39 & LOC\_TOTAL & total lines of code \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Cont. The greater the change in the odds ratio, the greater the effect of the confounding variable on the metric's predictive ability, and the greater the change in the odds ratio, the stronger the effect is considered to be.Conversely, the smaller the change in the odds ratio, the smaller the extent of the confounding variable on the metric's predictive ability, and it is considered that the confounding effect is weaker. For example, in project CM1, we declare that the confounding variable has a stronger effect on BRANCH_COU than LOC_BLA. We set the threshold value to 20%. That is, when the odds ratio change is greater than 20% before and after the confounding variable is controlled, we consider that the confounder will have a significant effect on the metric. For example, in project CM1, the confounding variable significantly affects HALSTEAD_DIFFICU but not HALSTEAD_EFFO. It can be concluded from Table 4 that the confounding variable generally has confounding effects on different metrics. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**No. of Metrics** & **CM1** & **JM1** & **KC1** & **MC2** & **PC3** & **PC5** \\ \hline
1 & 33.0\% & 100.0\% & 88.2\% & 100.0\% & 211.3\% & 48.6\% \\
2 & 100.0\% & 6.3\% & 90.3\% & 100.0\% & 53.7\% & 134.1\% \\
3  
For different projects, confounders have a general effect on metrics. This bias results when using code metrics for prediction. The scope of confounding effects varies from project to project. We take projects CM1 and JM1 as examples, combined with our confounding effect model proposed in Section 3.2.