ET-SDP: Enhancing Code Embeddings with Effort-Related and Test Coverage Metrics for Improved Software Defect Prediction
Abstract
Abstract Software defect prediction (SDP) aims to identify defect-prone code modules in order to optimize testing resources and improve software quality. While traditional approaches rely on software metrics derived from code structure, this paper proposes , an approach that enhances code embeddings using effort-related and test coverage metrics. We introduce three feature sets: the top-30 software metrics selected through clustering relevance ranking, 170 effort-related metrics capturing development process characteristics, and five test coverage metrics derived from unit tests. Our evaluation on 15 releases of Apache Calcite and 6 releases of Apache Ant-Ivy demonstrates that effort-related and test coverage metrics provide better defect prediction performance with far fewer features than traditional software metrics. In unsupervised clustering experiments, effort-based embeddings achieve better alignment with defect labels. In supervised classification, effort-related features achieve an AUC of 0.932 on Calcite and 0.883 on Ant-Ivy, outperforming the top-30 software metrics at comparable feature count (AUC of 0.632 and 0.587, respectively). Feature importance analysis reveals that test coverage metrics are the strongest predictors of defect proneness. These findings suggest that process-oriented metrics, particularly those related to code testing and development history, capture defect patterns more effectively per feature than static code structure metrics, offering practical guidance for software quality assurance.
// Source
Authors: Ioana-Gabriela Chelaru, Gabriela Czibula, Zsuzsanna Marian, Istvan-Gergely Czibula
Institutions: Babeș-Bolyai University