EUVIMEDEUVIMED entdecken
Crossref

ToCoLo: A File-level Context-aware Approach for User Review-based Code Localization

Kuo Chi, Chuanyi Li, Zhou Yang, Changan Niu, Bin Luo, David Lo, Vincent Ng

ACM Transactions on Software Engineering and Methodology · 15.07.2026

DOI: 10.1145/3831051 ↗

Kurz gefasst

Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 15.07.2026. Verfasst von Kuo Chi und 6 weiteren Autor:innen. Die Arbeit nennt 71 Literaturangaben.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

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.

Zitieren

APA

Chi, K., Li, C., Yang, Z., Niu, C., Luo, B., Lo, D., & Ng, V. (2026). ToCoLo: A File-level Context-aware Approach for User Review-based Code Localization. ACM Transactions on Software Engineering and Methodology. https://doi.org/10.1145/3831051

Vancouver

Chi K, Li C, Yang Z, Niu C, Luo B, Lo D, et al. ToCoLo: A File-level Context-aware Approach for User Review-based Code Localization. ACM Transactions on Software Engineering and Methodology. 2026. doi:10.1145/3831051

BibTeX
@article{Chi2026,
  author = {Chi, Kuo and Li, Chuanyi and Yang, Zhou and Niu, Changan and Luo, Bin and Lo, David and Ng, Vincent},
  title = {ToCoLo: A File-level Context-aware Approach for User Review-based Code Localization},
  journal = {ACM Transactions on Software Engineering and Methodology},
  year = {2026},
  doi = {10.1145/3831051}
}
Kostenlos starten →