NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Detect Related Bugs from Source Code Using Bug Information

Deqing Wang, Mengxiang Lin, Hui Zhang, Hongping Hu

In the world of large-scale software development, developers often implement the same logic across multiple classes through method overriding and overloading. While this is a cornerstone of object-oriented programming, it creates a dangerous side effect: if a developer makes a logical error in one method, they likely made the exact same mistake in its "siblings" across the codebase.

This paper, presented at COMPSAC 2010, introduces Rebug-Detector, a tool designed to find these "related bugs" by bridging the gap between natural language bug reports and raw source code.

TL;DR

Rebug-Detector is an automated tool that extracts clues from existing bug reports (like descriptions and code snippets) to find similar, unreported bugs in overridden or overloaded methods. In a test on the Apache Lucene project, it successfully identified 21 real bugs and 10 new suspected bugs in just over 15 minutes.

What Problem Does This Paper Address?

The authors tackle the "logical clone" problem. While existing tools are great at finding literal copy-pasted code errors, they often miss bugs caused by shared logical flaws across polymorphic methods.

When a bug is reported in a repository like Jira, the reporter often provides a "smoking gun"—a description of why the logic fails or even a snippet of the fix. However, developers often fix the specific instance reported but forget to check the dozens of other classes that implement the same interface or extend the same base class using the same (flawed) logic. Rebug-Detector automates this "search for siblings" to ensure a bug is squashed everywhere it lives.

Methods

Rebug-Detector operates in four main stages:

  1. Bug Feature Extraction: The tool parses XML bug reports from repositories. It uses Natural Language Processing (NLP) techniques, including Part-of-Speech (POS) tagging, to separate "Natural Features" (descriptive text) from "Program Features" (actual code snippets or variable names mentioned in the report).
  2. Bug Method Localization: It identifies which specific method in the source code is being discussed in the bug report.
  3. Code Feature Extraction: The tool scans the entire codebase for methods that override or overload the buggy method. To make comparisons more accurate, it performs variable normalization—replacing local variable names with their data types (e.g., changing collator to Collator) so that different naming styles don't hide identical logic. It then uses Suffix Arrays to find common substrings between the known buggy code and potential candidates.
  4. Similarity Calculation: It calculates a similarity score between the known buggy method and its siblings. If a sibling method contains the specific "Program Features" (like a faulty if statement) mentioned in the bug report, it is flagged as a high-priority potential bug.

Datasets

The authors evaluated their tool using:

  • Project: Apache Lucene-Java (version 2.4.1), a high-performance text search engine.
  • Scale: 330 class files and approximately 106,754 lines of code.
  • Bug Reports: 24 valid bug reports pulled from the Lucene Jira repository, which involved 71 distinct methods.

Key Insights and Ideas

  • Bug Reports are Gold Mines: Bug reports aren't just complaints; they often contain the precise logical rules that were violated. By treating the bug report as a "search query" for the source code, the authors find bugs that static analysis alone might miss.
  • Polymorphism as a Bug Vector: The paper highlights that method overriding is a primary way bugs "replicate" across a system. If RangeQuery.equals() is broken, there is a high statistical probability that RangeFilter.equals() is broken in the exact same way.
  • The Power of Normalization: By stripping away variable names and focusing on types and structure, the tool can identify "logical clones" even when the code isn't a literal copy-paste.

Key Results

  • Effectiveness: Rebug-Detector found 61 related bugs in total.
  • 21 were "real bugs" (confirmed as already fixed in later versions or confirmed by developers).
  • 10 were "suspected bugs" (newly discovered).
  • 30 were false positives.
  • Efficiency: The entire detection process for the Lucene project took only 15.5 minutes on a standard dual-core PC.
  • Real-World Impact: The authors submitted a newly discovered bug (LUCENE-2131) to the Lucene developers, who confirmed it was a real bug.

Limitations and Future Work

  • False Positive Rate: At nearly 50%, the false positive rate is relatively high. This could lead to "alert fatigue" for developers. The authors plan to refine their similarity heuristics to reduce this.
  • Complex Reports: The tool struggles when a bug report is "noisy"—for example, if a report mentions 30+ different methods, the tool has difficulty pinpointing the actual source of the error.
  • Language Constraints: While the logic is general, the current implementation is specific to Java. Future work involves extending the frontend parser to support languages like C++.
  • Semantic Complexity: Some bugs are caused by deep architectural issues or specific character encoding problems (like non-ASCII field names) that simple substring matching and POS tagging cannot yet detect.

Summary updated

BibTeX
@inproceedings{wang2010detect,
  author = {Deqing Wang and Mengxiang Lin and Hui Zhang and Hongping Hu},
  title = {{Detect Related Bugs from Source Code Using Bug Information}},
  booktitle = {COMPSAC},
  year = {2010},
  url = {https://openreview.net/forum?id=Ok9hFUD5HuU},
}

Loading related content...

Figure