Combining Textual and Behavioral Features to Improve Method-Level Bug Localization
The information retrieval-based bug localization approach exploits semantic similarity to locate source code errors through bug reports. The main difficulty lies in distinguishing the semantics of candidate codes. The candidate code semantic information directly impacts the localization accuracy through semantic mapping. Most existing approaches increase the distinguishability by mining the semantic features of candidate codes to improve feature quantity. However, on the basis of extracting text keywords as features in the traditional bug localization approach, simply superimposing the feature quantities and calculating the suspiciousness of candidate codes based on experience is very limited in improving the accuracy of bug localization. In this paper, we distinguish the types of features that can be attached. Then, we determine the range of candidate codes according to the program execution behavior information. Mining similar codes from historical requirements, we expand the semantics of candidate codes based on the attention mechanism. Finally, we combine the code execution behavior features and text features with different weights to calculate the suspicious degree of candidate codes. The optimization method maximizes the location accuracy of bugs. We implemented MethodLocator, a method-level bug localization method that combines textual and behavioral features, and we conducted bug localization experiments on seven open-source projects. Compared with state-of-the-art methods, MethodLocator improves MRR by 3.4%-47.2% and MAP by 2.0%-38.4%. Our statistical tests show that our improvement is significant.
Authors
- Fan Ying (ORCID: https://orcid.org/0000-0003-3243-5802)
- Xinyu Gu (ORCID: https://orcid.org/0000-0001-6762-7463)
- Qing Tian (ORCID: https://orcid.org/0000-0003-0030-3645)
- Xiaozhuo Li
- Yaqiang Zhao
- Jianbin Song (ORCID: https://orcid.org/0000-0002-7207-8523)
Institutions
- Beijing Emergency Medical Center (CN)
- First Research Institute of the Ministry of Public Security (CN)
Publication Details
- Published
- 2024-12-06
- DOI
- https://doi.org/10.1109/ricai64321.2024.10911654
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00