# Transfer Convolutional Neural Network for Cross-Project Defect Prediction
## 2 Related Work  
Most existing SDP studies [1; 2; 3] use machine learning techniques to predict defects and evaluate them under a within-project setting where the SDP model is trained and applied in the same project. In practice, we can hardly obtain sufficient training data for a new project, but there is abundant labeled data from public datasets provided by various organizations (e.g., PROMISE [15], AEEEM [16]). Based on these datasets, many CPDP methods have been proposed to train a predictor by using cross-project data.  
In early CPDP studies, [PERSON] et al. [17] evaluated CPDP models on 12 real-world applications containing 622 pairs of cross-project prediction tasks. Only 3.4% of tasks achieved performance levels matching those of conventional SDP models indicating that cross-project prediction was still a challenge. [PERSON] et al. [18] conducted large-scale experiments on 34 datasets and concluded that the CPDP approach based on data selection is comparable with the methods used in training data in the same project. In recent years, various researchers have been trying to enhance CPDP's performance. [PERSON] et al. [14] proposed an algorithm called transfer naive Bayes (TNB) that reweights the instances of the source project by a data gravitation (DG) [19] method and feeds them into a naive Bayes classifier. The DG method can weaken the impact of irrelevant source data to some extent. Considering the data distribution divergence, [PERSON] et al. [10] put forward a transferable feature learning method named TCA+, which extends a classic TCA [20] algorithm with customized normalization rules. In recent years, some researchers have explored the CPDP method with a small ratio of labeled within-project data. [PERSON] et al. [21] proposed a hybrid model reconstruction approach (HYDRA), which first constructed \(\mathrm{N}+1\) genetic algorithm (GA) classifiers by a small ratio of labeled within-project data and a GA step. Then, HYDRA adopted a boosting step to learn a weight for each classifier. In our paper, we focus on methods that only use source project labeled data because they can handle the cold-start issue of software defect data.  
In the above CPDP studies, the discriminant features adopted to construct predictive models were elaborately extracted (e.g., Halstead [5], McCabe [6], and CK [7] features). These handcrafted features usually do not contain semantic features of the programs, which may result in poor performance of the SDP model [22]. In recent years, DL has been well studied as one of the techniques for automatic feature generation [22]. In the field of SDP, DL could also be used to extract the semantic features of software programs. To mine the relationship between semantic features and source code, [PERSON] et al. [9] leveraged a powerful DBN to learn the semantic representations from the programs' abstract syntax trees (ASTs). [PERSON] et al. [8] attempted to build a framework called defect prediction through CNN (DPCNN) to generate semantic and structural features from programs automatically. It is worth mentioning that DPCNN applies the word embedding technique and combines the CNN-generated features with handcrafted features to enhance SDP's performance. Both [8] and [9] evaluated the methods for SDP tasks, and the results in terms of the F-measure showed that DL-generated featurescan contribute to SDP performance. However, whether the DL-generated features produced by DBN and DPCNN can be directly used in the CPDP task needs further exploration. this is exactly what we want to discuss in this paper.