Table of Contents
Fetching ...

Extracting Conceptual Knowledge to Locate Software Issues

Ying Wang, Wenjun Mao, Chong Wang, Zhenhao Zhou, Yicheng Zhou, Wenyun Zhao, Yiling Lou, Xin Peng

TL;DR

Issue localization in large-scale software projects is hampered by missing high-level conceptual views, concern tangling, and concern scattering. RepoLens introduces a two-stage offline-online framework that extracts and enriches conceptual terms from code, builds a repository-wide knowledge base, and uses issue-driven retrieval, clustering, and ranking to provide high-level concerns that guide LLM-based localization with minimal prompt changes. Empirical results on SWE-Lancer-Loc show consistent improvements across three baselines and multiple base models, with particularly large gains at function-level localization and strong generalizability, supported by ablation and human evaluations of concern quality. The approach demonstrates the practical value of grounding localization in explicit concept-level knowledge, offering scalable benefits for bug localization in large repositories and potential applicability to broader developer-assistance tasks.

Abstract

Issue localization, which identifies faulty code elements such as files or functions, is critical for effective bug fixing. While recent LLM-based and LLM-agent-based approaches improve accuracy, they struggle in large-scale repositories due to concern tangling, where relevant logic is buried in large functions, and concern scattering, where related logic is dispersed across files. To address these challenges, we propose RepoLens, a novel approach that abstracts and leverages conceptual knowledge from code repositories. RepoLens decomposes fine-grained functionalities and recomposes them into high-level concerns, semantically coherent clusters of functionalities that guide LLMs. It operates in two stages: an offline stage that extracts and enriches conceptual knowledge into a repository-wide knowledge base, and an online stage that retrieves issue-specific terms, clusters and ranks concerns by relevance, and integrates them into localization workflows via minimally intrusive prompt enhancements. We evaluate RepoLens on SWE-Lancer-Loc, a benchmark of 216 tasks derived from SWE-Lancer. RepoLens consistently improves three state-of-the-art tools, namely AgentLess, OpenHands, and mini-SWE-agent, achieving average gains of over 22% in Hit@k and 46% in Recall@k for file- and function-level localization. It generalizes across models (GPT-4o, GPT-4o-mini, GPT-4.1) with Hit@1 and Recall@10 gains up to 504% and 376%, respectively. Ablation studies and manual evaluation confirm the effectiveness and reliability of the constructed concerns.

Extracting Conceptual Knowledge to Locate Software Issues

TL;DR

Issue localization in large-scale software projects is hampered by missing high-level conceptual views, concern tangling, and concern scattering. RepoLens introduces a two-stage offline-online framework that extracts and enriches conceptual terms from code, builds a repository-wide knowledge base, and uses issue-driven retrieval, clustering, and ranking to provide high-level concerns that guide LLM-based localization with minimal prompt changes. Empirical results on SWE-Lancer-Loc show consistent improvements across three baselines and multiple base models, with particularly large gains at function-level localization and strong generalizability, supported by ablation and human evaluations of concern quality. The approach demonstrates the practical value of grounding localization in explicit concept-level knowledge, offering scalable benefits for bug localization in large repositories and potential applicability to broader developer-assistance tasks.

Abstract

Issue localization, which identifies faulty code elements such as files or functions, is critical for effective bug fixing. While recent LLM-based and LLM-agent-based approaches improve accuracy, they struggle in large-scale repositories due to concern tangling, where relevant logic is buried in large functions, and concern scattering, where related logic is dispersed across files. To address these challenges, we propose RepoLens, a novel approach that abstracts and leverages conceptual knowledge from code repositories. RepoLens decomposes fine-grained functionalities and recomposes them into high-level concerns, semantically coherent clusters of functionalities that guide LLMs. It operates in two stages: an offline stage that extracts and enriches conceptual knowledge into a repository-wide knowledge base, and an online stage that retrieves issue-specific terms, clusters and ranks concerns by relevance, and integrates them into localization workflows via minimally intrusive prompt enhancements. We evaluate RepoLens on SWE-Lancer-Loc, a benchmark of 216 tasks derived from SWE-Lancer. RepoLens consistently improves three state-of-the-art tools, namely AgentLess, OpenHands, and mini-SWE-agent, achieving average gains of over 22% in Hit@k and 46% in Recall@k for file- and function-level localization. It generalizes across models (GPT-4o, GPT-4o-mini, GPT-4.1) with Hit@1 and Recall@10 gains up to 504% and 376%, respectively. Ablation studies and manual evaluation confirm the effectiveness and reliability of the constructed concerns.

Paper Structure

This paper contains 36 sections, 8 figures, 6 tables.

Figures (8)

  • Figure 1: Motivating Example
  • Figure 2: Overview of RepoLens
  • Figure 3: Prompt Template for Term Explanation
  • Figure 4: An Example of Extracted Conceptual Term and Its Explanations
  • Figure 5: Prompt Template for Concern Clustering
  • ...and 3 more figures