Introduction
Predicting software defects in the early stages of development is a critical challenge in software engineering. While machine learning classifiers have proven effective, they typically require substantial historical training data. For new projects, this data is often unavailable, leading researchers to adopt Cross-Project Defect Prediction (CPDP). CPDP involves "borrowing" data from a source project and adapting it for a target project using a transfer learner paired with a classifier.
However, the CPDP landscape is vast. With dozens of potential transfer learners and classifiers, each possessing unique hyper-parameters, finding the optimal combination is a complex combinatorial and continuous search problem. Traditional approaches often rely on ad-hoc selections or flat search spaces (standard AutoML), which are computationally expensive and often inefficient. This paper introduces BiLO-CPDP, a tool that utilizes bi-level programming to navigate this search space effectively.
The Bi-Level Optimization Framework
To address the inefficiencies of flat search spaces, BiLO-CPDP formulates model discovery as a hierarchical optimization problem. This approach decouples algorithm selection from hyper-parameter tuning, ensuring that the search remains focused and computationally feasible.
As shown in the framework overview, the system operates on two distinct levels:
- Upper-Level Optimization (The Leader): This level handles the combinatorial task of selecting the best pair of algorithms. It searches through a portfolio of 13 transfer learners and 16 classifiers using Tabu Search. By maintaining a "tabu list" of recently explored solutions, the algorithm avoids local optima and explores the search space more broadly.
- Lower-Level Optimization (The Follower): Once a pair is selected, this level optimizes its specific hyper-parameters. It employs the Tree-structured Parzen Estimator (TPE), a Bayesian optimization method designed to handle expensive evaluations by building surrogate models of the performance space.
Navigating the Search Space
The complexity of the CPDP problem stems from the diversity of available algorithms. BiLO-CPDP manages a wide array of transfer learning techniques, each with its own set of parameters that must be tuned to the specific characteristics of the target project.
By treating this as a nested problem, BiLO-CPDP avoids the "inactive parameter" trap common in flat AutoML tools, where the optimizer wastes time tuning parameters for algorithms that aren't even currently selected.
Experimental Evaluation
The authors evaluated BiLO-CPDP using 20 open-source projects from three major datasets: AEEEM, ReLink, and JURECZKO. The study utilized a round-robin approach across 10,952 instances to simulate real-world scenarios where a new project lacks historical data.
Key findings from the experiments include:
- Superior Performance: BiLO-CPDP outperformed 21 existing hand-crafted CPDP techniques, ranking first on 70% of the tested projects.
- Efficiency over AutoML: Compared to Auto-Sklearn, which uses a flat search space, BiLO-CPDP achieved statistically significant improvements in AUC across all 20 projects.
- The Importance of Combinations: The researchers found that exploring a wide variety of algorithm combinations (Upper-Level) was more beneficial than exhaustive micro-tuning of a single combination (Lower-Level) within a fixed time budget.
Conclusion
BiLO-CPDP demonstrates that a hierarchical, bi-level approach to model discovery is significantly more effective than traditional flat search methods for Cross-Project Defect Prediction. By dynamically discovering the best architecture for each specific project, BiLO-CPDP moves away from the search for a "universal" model and toward a more flexible, automated solution for software quality assurance. Future work will explore multi-objective optimization to balance predictive accuracy with computational costs.
Summary updated