Leveraging Semantic Coupling Through Class Name Embeddings for Software Change Prediction
Beyza Eken, Nur Banu Oğur · 2024
Metrics measuring coupling between code components have been effectively used to predict change-prone software classes. The majority of these coupling metrics are based on the structural aspects of code components. Although semantic coupling has been studied and found to be useful in analyzing object-oriented systems, its incorporation into change prediction models has not been explored. In this study, we propose new semantic coupling metrics calculated over class names’ embeddings and incorporate them into the prediction of change-prone classes. With the proposed metric, we aim to capture the conceptual relatedness of classes over their textual similarities of class names. Our experiment results on open-source software show that adding the semantic coupling metrics into change predictors improves the probability of detection rates up to 15% compared to the baseline predictor that uses size and complexity metrics. Moreover, the semantic coupling metrics lead to similar or superior change prediction performance compared to structural coupling metrics, and their combination is better than using solely semantic or structural coupling. The proposed semantic coupling metrics could be an alternative to structural coupling metrics for measuring relationships between software classes or they could be used to complement structural metrics in change prediction tasks. Future work is needed to understand complementary aspects of these metrics.