CSE-WSS: Code Structure Enhancement Framework with Weighted Semantic Similarity for Changeset-Based Bug Localization

Zhenghao Liu, Yuan Li, Jiexin Wang, Yi Cai · 2025

Bug localization aims to locate the specific software artifacts responsible for triggering bugs as reported in bug reports, assisting software developers in conserving substantial resources and time during the debugging process. In recent years, there has been a shift toward changeset-based bug localization, with current approaches increasingly utilizing deep learning models that excel at understanding semantics to capture semantic relationships, to locate bug-inducing changesets. These models have already achieved notable improvements in performance. However, these approaches still have two limitations: (1) Insufficient interaction between bug reports and changesets. The feature interaction in current approaches is restricted to the final semantic similarity calculation, which may hinder overall model performance. (2) Under-exploration of rich code structural information. Changesets and bug reports are typically treated as distinct modalities-code and text, respectively, however existing approaches primarily mine code features in text form, neglecting the rich structural information in the changesets. To address these limitations, we propose CSE-WSS, a framework to improve feature interaction and representation learning for changeset-based bug localization. Specifically, we first introduce a new semantic similarity algorithm, Weighted Semantic Similarity (WSS), to conduct a comprehensive and fine-grained token-level interaction, which can aid in obtaining a more precise relevance score. Then we design a novel contrastive training technique, Code Structure Enhancement Contrastive Learning (CSE), to incorporate the rich structural information within changesets, which can help model understand the code semantics. Furthermore, we evaluate the performance of CSE- WSS across six widely used open-source projects, experimental results have demonstrated that CSE- WSS achieves significant improvements compared to four baseline models. Moreover, ablation and generalization studies of CSE-WSS further highlight its effectiveness in the task.

Read the paper · More papers on PaperTik