# Cross-Project Defect Prediction Based on Domain Adaptation and LSTM Optimization
## 3 Methodology
### Proposed Features Selection Approach
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Source** & **Target** & **TPTL** & **DA-KTSVMO** & **GB-CPDP** & **Ours** \\ \hline synapse\_1.2 & poi-2.5 & 0.462 & 0.533 & 0.631 & 0.651 \\ synapse\_1.2 & xerces-1.2 & 0.433 & 0.542 & 0.466 & 0.602 \\ camel-1.4 & ant-1.6 & 0.575 & 0.463 & 0.416 & 0.656 \\ camel-1.4 & jedit.4.1 & 0.396 & 0.402 & 0.356 & 0.636 \\ xerces-1.3 & poi-2.5 & 0.349 & 0.537 & 0.544 & 0.595 \\ xerces-1.3 & synapse\_1.1 & 0.536 & 0.329 & 0.469 & 0.588 \\ xerces-1.2 & xalan-2.5 & 0.447 & 0.462 & 0.383 & 0.571 \\ lucene\_2.2 & xalan-2.5 & 0.506 & 0.438 & 0.502 & 0.612 \\ synapse\_1.1 & poi-3.0 & 0.342 & 0.566 & 0.537 & 0.602 \\ ant-1.6 & poi-3.0 & 0.353 & 0.315 & 0.384 & 0.520 \\ camel-1.4 & ant-1.6 & 0.556 & 0.511 & 0.652 & 0.782 \\ lucene\_2.2 & ant-1.6 & 0.377 & 0.539 & 0.669 & 0.772 \\ log4j-1.1 & ant-1.6 & 0.595 & 0.585 & 0.676 & 0.745 \\ log4j-1.1 & lucene\_2.0 & 0.478 & 0.576 & 0.622 & 0.733 \\ lucene\_2.0 & log4j-1.1 & 0.419 & 0.561 & 0.489 & 0.742 \\ lucene\_2.0 & xalan-2.5 & 0.510 & 0.510 & 0.514 & 0.546 \\ jedit\_4.1 & camel-1.4 & 0.447 & 0.502 & 0.501 & 0.678 \\ jedit\_4.1 & xalan-2.4 & 0.332 & 0.386 & 0.443 & 0.552 \\ Average & & 0.451 & 0.487 & 0.514 & 0.643 \\ \hline \hline \end{tabular}
\end{table} 
Table 11: _AUC_ of the proposed approach and baseline methods on PROMISE. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Source** & **Target** & **TPTL** & **DA-KTSVMO** & **GB-CPDP** & **Ours** \\ \hline synapse\_1.2 & poi-2.5 & 0.485 & 0.498 & 0.593 & 0.674 \\ synapse\_1.2 & xerces-1.2 & 0.485 & 0.563 & 0.681 & 0.712 \\ camel-1.4 & ant-1.6 & 0.541 & 0.655 & 0.532 & 0.669 \\ camel-1.4 & jedit\_4.1 & 0.329 & 0.441 & 0.466 & 0.612 \\ xerces-1.3 & poi-2.5 & 0.588 & 0.477 & 0.568 & 0.633 \\ xerces-1.3 & synapse\_1.1 & 0.488 & 0.468 & 0.502 & 0.602 \\ xerces-1.2 & xalan-2.5 & 0.471 & 0.437 & 0.696 & 0.722 \\ lucene\_2.2 & xalan-2.5 & 0.621 & 0.702 & 0.568 & 0.733 \\ synapse\_1.1 & poi-3.0 & 0.493 & 0.510 & 0.571 & 0.630 \\ ant-1.6 & poi-3.0 & 0.518 & 0.383 & 0.572 & 0.619 \\ camel-1.4 & ant-1.6 & 0.603 & 0.642 & 0.661 & 0.713 \\ lucene\_2.2 & ant-1.6 & 0.411 & 0.570 & 0.658 & 0.729 \\ log4j-1.1 & ant-1.6 & 0.631 & 0.509 & 0.682 & 0.733 \\ log4j-1.1 & lucene\_2.0 & 0.529 & 0.621 & 0.613 & 0.757 \\ lucene\_2.0 & log4j-1.1 & 0.546 & 0.571 & 0.647 & 0.719 \\ lucene\_2.0 & xalan-2.5 & 0.632 & 0.604 & 0.594 & 0.669 \\ jedit\_4.1 & camel-1.4 & 0.267 & 0.355 & 0.556 & 0.644 \\ jedit\_4.1 & xalan-2.4 & 0.425 & 0.563 & 0.669 & 0.680 \\ Average & & 0.504 & 0.532 & 0.602 & 0.680 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: F1-measure of the proposed approach and baseline methods on PROMISE. ## 6 Threats to Validity

### Internal Validity

The degree of trust by which the causal relationship under investigation in a study is independent of other factors, or is unaffected by other variables, is known as internal validity. As a result, the accuracy of our testing setup is crucial to maintaining internal validity. TensorFlow serves as the backend for Keras, which we employ in this study to construct the SCAG-LSTM model. Since these technologies and tools have been used extensively in relevant research, they can be trusted. We additionally do white-box testing on the source code to ensure that it is error-free. Another important danger to internal validity comes from the datasets. The reference datasets are unbalanced and exhibit a deficiency in the true distribution of the fraction of classes that are defective and those that are not. In order to increase the data's realism regarding the defect's actual existence in the software system, we alter the original datasets to mitigate this threat. Data sampling strategies are used to modify the dataset's distribution. However, we accept that many statistical tests can be performed to verify the statistical significance of our conclusions. Therefore, we propose to undertake more statistical testing in our future work. Figure 10: Bar chart of prediction performance of proposed model and comparative models on PROMISE.