# The Forgotten Role of Search Queries in IR-based Bug Localization: An Empirical Study

arXiv: https://arxiv.org/abs/2108.05341 · HTML: https://mlsanity.com/paper/2108.05341/

## Key facts

- Cited by 5 papers in the map (data through 14 Oct 2026).
- Builds on 8 of its 86 references that are in the map.
- First posted on arXiv 11 Aug 2021.

## Builds on (most cited first, 8 of 8)

- [Predicting Usefulness of Code Review Comments using Textual Features and Developer Experience](https://mlsanity.com/paper/1807.04485/) (2018)
- [RACK: Automatic API Recommendation using Crowdsourced Knowledge](https://mlsanity.com/paper/1807.02953/) (2018)
- [Improving IR-Based Bug Localization with Context-Aware Query Reformulation](https://mlsanity.com/paper/1808.00594/) (2018)
- [Improved Query Reformulation for Concept Location using CodeRank and Document Structures](https://mlsanity.com/paper/1807.04488/) (2018)
- [QUICKAR: Automatic Query Reformulation for Concept Location using Crowdsourced Knowledge](https://mlsanity.com/paper/1807.02964/) (2018)
- [An Insight into the Unresolved Questions at Stack Overflow](https://mlsanity.com/paper/1807.01850/) (2018)
- [STRICT: Information Retrieval Based Search Term Identification for Concept Location](https://mlsanity.com/paper/1807.04475/) (2018)
- [Poster: Improving Bug Localization with Report Quality Dynamics and Query Reformulation](https://mlsanity.com/paper/1807.07676/) (2018)

## Built on by (most cited first, 5 of 5)

- [RLocator: Reinforcement Learning for Bug Localization](https://mlsanity.com/paper/2305.05586/) (2023)
- [Improved IR-based Bug Localization with Intelligent Relevance Feedback](https://mlsanity.com/paper/2501.10542/) (2025)
- [A Systematic Review of Automated Query Reformulations in Source Code Search](https://mlsanity.com/paper/2108.09646/) (2021)
- [Reformulate, Retrieve, Localize: Agents for Repository-Level Bug Localization](https://mlsanity.com/paper/2512.07022/) (2025)
- [Improved Bug Localization with AI Agents Leveraging Hypothesis and Dynamic Cognition](https://mlsanity.com/paper/2601.12522/) (2026)

## Abstract (arXiv)

Being light-weight and cost-effective, IR-based approaches for bug localization have shown promise in finding software bugs. However, the accuracy of these approaches heavily depends on their used bug reports. A significant number of bug reports contain only plain natural language texts. According to existing studies, IR-based approaches cannot perform well when they use these bug reports as search queries. On the other hand, there is a piece of recent evidence that suggests that even these natural language-only reports contain enough good keywords that could help localize the bugs successfully. On one hand, these findings suggest that natural language-only bug reports might be a sufficient source for good query keywords. On the other hand, they cast serious doubt on the query selection practices in the IR-based bug localization. In this article, we attempted to clear the sky on this aspect by conducting an in-depth empirical study that critically examines the state-of-the-art query selection practices in IR-based bug localization. In particular, we use a dataset of 2,320 bug reports, employ ten existing approaches from the literature, exploit the Genetic Algorithm-based approach to construct optimal, near-optimal search queries from these bug reports, and then answer three research questions. We confirmed that the state-of-the-art query construction approaches are indeed not sufficient for constructing appropriate queries (for bug localization) from certain natural language-only bug reports although they contain such queries. We also demonstrate that optimal queries and non-optimal queries chosen from bug report texts are significantly different in terms of several keyword characteristics, which has led us to actionable insights. Furthermore, we demonstrate 27%--34% improvement in the performance of non-optimal queries through the application of our actionable insights to them.
