# Cross-Project Defect Prediction Based on Domain Adaptation and LSTM Optimization
## 3 Methodology
### Proposed Features Selection Approach
The higher the _AUC_, the better the prediction:

\[AUC=\frac{\Sigma_{ins_{i}\text{ }e\text{ }Positive\text{ }Classrank(ins_{i})-\frac{M(M+1)}{2}}}{M.N} \tag{15}\]

where the numbers of positive and negative cases are represented by \(M\) and \(N\), and the average positive samples rank is \(\Sigma_{ins_{i}\text{ }e\text{ }Positive\text{ }Classrank(ins_{i})}\). ### Baseline Models

To test the efficacy of our SCAG-LSTM method, a comparative analysis is conducted that evaluates its prediction performance against a total of six state-of-the-art CPDP approaches, three for AEEEM and three for PROMISE datasets. These approaches are detailed succinctly in Table 3.

### Research Questions

In this section, we will discuss the motivations, along with the research problems. This work aims to address the following research questions. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Baseline Models** & **Reference No.** & **Advantages** & **Disadvantages** \\ \hline TPTL [31] & [PERSON] et al., 2019 & The two-phase transfer learning model improves prediction accuracy and efficiency by utilizing transfer learning. & Generalizability is limited because of the concentration on a particular collection of defect datasets. \\ \hline ALTRA [41] & [PERSON] et al., 2020 & ALTRA employs utilization of active learning to overcome the data distribution differences across source and target projects. & Limits the validation on different datasets by just conducting empirical research on the PROMISE dataset. \\ \hline DAKTSVMO [27] & [PERSON] et al., 2021 & Its ability to align the data distribution across different software projects allows for domain adaptation in CPDP. & Lack of comparison with different domain adaption approaches. \\ \hline MSCPDP [50] & [PERSON] et al., 2022 & Ability to leverage information from multiple sources projects for enhanced prediction accuracy. & Did not entirely outperform more advanced single-source single-target approaches. \\ \hline TFIA [24] & [PERSON] et al., 2022 & Feature-level filtering strategy to improve data distribution differences between projects. & Doesn’t investigate how changing certain parameters affects the performance of the model \\ \hline GBCPDP [34] & [PERSON] et al., 2023 & Uses graph features taken from CFG and DDG to build a predictive model using LSTM, offering a systematic framework. & Relying exclusively on CFG and DDG as graph features could fail to capture all necessary context-relevant data for defect prediction. \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Summary of the Baseline models for comparison. RQ1: Does balancing data and removing noisy instances from data improve the performance of our proposed model SCAG-LSTM? This research question investigates the effectiveness of our data-balancing method to improve the performance of the proposed model in CPDP. RQ2: Does the feature selection approach suggested in this paper have any impact on the performance of the model SCAG-LSTM? This research question analyzes the usefulness of our feature selection approach to improve the performance of the proposed model in CPDP. RQ3: How effective is our SCAG-LSTM model? How much improvement can SCAG-LSTM achieve over the related models? This research question seeks to determine how well the proposed method performs in CPDP in comparison to existing state-of-the-art approaches. The motivation for the above mentioned research questions is driven by the implementation of feature selection and data balancing approaches in CPDP studies. The most recent CPDP research [22; 23; 24] indicates that, in order to make a model that can accurately predict defects and prevent the model from being biased toward the majority class, it is crucial to apply data balancing methods to handle the imbalanced nature of the dataset and remove noisy and irrelevant instances. [PERSON] et al. [42] integrated an undersampling method to balance the imbalanced datasets. [PERSON] et al. [51] explored undersampling techniques and proved that undersampling easily handles the imbalanced nature of the data.