Kernel CCA Based Transfer Learning for Software Defect Prediction

Ying Ma, Shunzhi Zhu, Yumin Chen, Jingjing LiIEICE Trans. Information and Systems 2017 · OpenReview

Introduction

Software defect prediction is a critical task for prioritizing testing efforts and improving overall code quality. However, a significant "cold start" problem exists: new projects or companies often lack the historical bug data necessary to train effective predictive models. While Cross-Company Defect Prediction (CCDP) offers a potential solution by "borrowing" knowledge from established projects, it faces two major hurdles. First, heterogeneity: different companies often use entirely different sets of software metrics. Second, non-linearity: the relationship between code features and defects is frequently complex and nonlinearly separable, making simple linear models inadequate.

To address these challenges, researchers have developed KCCA+ (Kernel Canonical Correlation Analysis plus), a novel transfer learning method that combines the "kernel trick" with canonical correlation analysis to bridge the gap between disparate datasets.

The KCCA+ Methodology

The KCCA+ framework is designed to align source and target datasets even when they do not share the same feature space. The process involves several key steps:

  1. Unified Metric Representation: To handle different feature sets, the authors employ a "unifier" approach. A shared feature space is created by padding missing metrics with zeros, allowing both source and target data to be represented in a comparable, unified format.
  2. The Kernel Trick: This is the core innovation of KCCA+. Instead of seeking linear correlations in the original feature space, the method projects the data into a much higher-dimensional Hilbert space. In this space, complex non-linear patterns in the source and target data become easier to align and correlate.
  3. Regularization: To prevent overfitting, a regularization step is included in the generalized eigenvalue problem used to find the optimal projections.
  4. Predictive Modeling: Once the data is projected into the optimized, correlated subspace, a standard Naive Bayes classifier is used to build the final defect predictor.
The KCCA+ transfer learning framework, illustrating the transformation of source and target data into a unified space followed by kernel-based alignment.

Experimental Evaluation

The study evaluated KCCA+ using two well-known software data repositories:

  • NASA Datasets: Projects CM1, PC1, and MW1 (aerospace software written in C).
  • SOFTLAB Datasets: Projects AR3, AR4, and AR5 (domestic appliance controller systems written in C).

These datasets vary significantly in size (from 36 to 705 modules) and defect density, providing a robust testbed for cross-company transfer learning.

Results and Discussion

The performance of KCCA+ was compared against four state-of-the-art methods: NN-filter, TNB, TCA+, and standard CCA+. Evaluation was based on the Area Under the Curve (AUC) and F-measure.

Comparison of AUC performance across various project pairs, demonstrating the consistent superiority of KCCA+ over baseline methods.

Key findings include:

  • Superior Predictive Power: KCCA+ consistently outperformed all other methods in terms of AUC across almost all project pairings.
  • Balanced Performance: While KCCA+ was comparable to standard CCA+ in specific instances (e.g., PC1 => AR3), it generally yielded the best F-measure results, indicating a superior balance between precision and recall.
  • Adaptability: The results highlight that combining kernel methods with transfer learning significantly improves the model's ability to adapt to "nonlinearly separable scenarios" compared to traditional linear transfer methods. By mapping data to a "common language" in a high-dimensional space, KCCA+ finds deeper commonalities that linear models miss.

Conclusion and Future Work

KCCA+ demonstrates a powerful approach to heterogeneous defect prediction by being feature-agnostic and robust to complex data distributions. However, some limitations remain. The quality of predictions is still somewhat sensitive to the volume of labeled instances, particularly for very small target datasets. Future research could explore the impact of different kernel types (e.g., polynomial or sigmoid) and address the higher computational costs associated with kernel-based methods in large-scale applications.

Summary updated

BibTeX
@article{ma2017kernel,
  author = {Ying Ma and Shunzhi Zhu and Yumin Chen and Jingjing Li},
  title = {{Kernel CCA Based Transfer Learning for Software Defect Prediction}},
  journal = {IEICE Trans. Information and Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=pwLMPQzdViIv},
}
Figure