Skip to main content
QUICK REVIEW

[Paper Review] Fault Localization Using Textual Similarities

Zachary P. Fry, Westley Weimer|arXiv (Cornell University)|Nov 13, 2012
Software Engineering ResearchComputer Science41 references7 citations
TL;DR

This paper proposes a language-independent, static fault localization technique that uses textual similarity between defect reports and source code to reduce the search space for bug localization. By analyzing natural language in reports and code (e.g., identifiers, comments, stack traces), it ranks source files using a structured document similarity metric, achieving a 91.5% reduction in files inspected per defect on 5345 real-world defects across 6.5 million lines of code.

ABSTRACT

Maintenance is a dominant component of software cost, and localizing reported defects is a significant component of maintenance. We propose a scalable approach that leverages the natural language present in both defect reports and source code to identify files that are potentially related to the defect in question. Our technique is language-independent and does not require test cases. The approach represents reports and code as separate structured documents and ranks source files based on a document similarity metric that leverages inter-document relationships. We evaluate the fault-localization accuracy of our method against both lightweight baseline techniques and also reported results from state-of-the-art tools. In an empirical evaluation of 5345 historical defects from programs totaling 6.5 million lines of code, our approach reduced the number of files inspected per defect by over 91%. Additionally, we qualitatively and quantitatively examine the utility of the textual and surface features used by our approach.

Motivation & Objective

  • Address the high cost of software maintenance by improving fault localization efficiency.
  • Reduce developer effort in triaging and locating defects reported by users.
  • Develop a scalable, language-independent technique that does not require test cases, compilation, or execution traces.
  • Leverage natural language features in both defect reports and source code to improve localization accuracy.
  • Demonstrate the effectiveness of textual similarity in identifying fault-relevant code files across large, real-world software systems.

Proposed method

  • Represent defect reports and source files as structured documents based on natural language content (e.g., comments, identifiers, stack traces).
  • Apply a document similarity metric that computes similarity between defect reports and source files using term frequency and inverse document frequency (TF-IDF) weighting.
  • Break down documents into substructures (e.g., method names, comments, variable names) to improve granularity and relevance of similarity matching.
  • Rank source files by similarity score to prioritize those most likely to contain the fault.
  • Use only static, syntactic, and textual features—no test cases, execution traces, or dynamic analysis.
  • Formalize similarity as a vector-space model where similarity is computed between the TF-IDF weighted vectors of report and code text.

Experimental results

Research questions

  • RQ1Can natural language features in defect reports and source code be effectively used to localize faults without test cases?
  • RQ2How does the proposed similarity-based approach compare to baseline techniques like stack trace analysis in reducing search space?
  • RQ3To what extent do factors like report priority or duplicate reports influence the performance of the fault localization model?
  • RQ4Is the success of the method primarily driven by word choice in natural language artifacts, as hypothesized?
  • RQ5Can a lightweight, static, language-independent approach achieve state-of-the-art fault localization accuracy on real-world systems?

Key findings

  • The proposed method reduced the average number of files inspected per defect by 91.5% across 5345 historical defects in three large programs totaling 6.5 million lines of code.
  • The technique outperformed baseline methods such as using user-reported stack traces, which reduced the search space by only 53.1%.
  • The model’s performance was not significantly affected by report priority or the number of duplicate reports, indicating that these metadata factors are not strong predictors of localization accuracy.
  • The primary driver of success was human word choice in natural language artifacts—supporting the hypothesis that shared vocabulary between reporters and developers enables effective fault localization.
  • The method achieved state-of-the-art performance without requiring test suites, compilation, or dynamic analysis, demonstrating scalability and practicality in real-world maintenance scenarios.
  • The empirical evaluation confirmed that structured textual analysis of source code and reports is sufficient for high-accuracy fault localization, even in the absence of execution traces or test cases.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.