Answers are grounded in this paper and cite their sources.
Platforms like the Google Play Store have become the backbone of the mobile internet era. User reviews play a key role in the development of mobile applications. These reviews help developers identify issues, suggest new features, and report bugs, which drives continuous app improvement and platform evolution. An important research problem has emerged: given a user review, how to automatically identify relevant code snippets from the codebase to assist developers? Existing solutions typically compute similarity between user reviews and individual method code snippets in isolation. However, highly similar code snippets (e.g., code clones) are widespread across the codebase. Although such snippets may appear semantically similar, their actual relevance often depends on the file-level context in which they reside. By ignoring this contextual information, existing approaches can be misled by similar but irrelevant methods, leading to incorrect or unstable code localization results. This observation motivates us to propose ToCoLo (Two-Stage Approach for User Review-based Code Localization), a two-stage approach that explicitly incorporates file-level context to constrain method-level localization. In the first stage, we leverage an LLM to generate natural language summaries for code files and use them to identify a small set of candidate files that are most relevant to a given user review. In the second stage, we perform fine-grained method-level matching only within the retrieved files, and return the most relevant code snippets as localization results. Our experimental evaluation demonstrates that ToCoLo consistently improves user review-based code localization across different backbone models. With UnixCoder as the backbone, ToCoLo achieves absolute improvements of 8.3% in Top-1 accuracy, 7.0% in Top-3, and 6.9% in Mean Reciprocal Rank (MRR) compared to the one-stage baseline. Using Qwen3-Embedding-0.6B, ToCoLo attains a Top-1 gain of 6.2%, and 6.1% in MRR. These results indicate that ToCoLo is more effective at ranking truly relevant code snippets at the very top of the localization results. Moreover, to comprehensively investigate how ToCoLo improves code localization via file-level retrieval, we analyze its effects on interference reduction, failure recovery, and retrieval quality, and design a systematic study consisting of three complementary analyses. These analyses examine the problem from three perspectives: (1) Analysis A shows that file-level retrieval effectively reduces interference from similar code snippets, successfully eliminating up to 72% of interference cases; (2) Analysis B shows that, in cases where the One-Stage method fails to correctly localize any ground-truth method, ToCoLo successfully locates 23.2% of these cases, and among the located cases, up to 81.4% are driven by retrieving previously missing relevant files; (3) Analysis C further validates the importance of file-level retrieval in ToCoLo , indicating that retrieval quality has a significant impact on final localization performance.
No takes yet. Share an insight, caveat, or question.
Chi et al. (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: