Enriching automatic test case generation by extracting relevant test inputs from bug reports

Wendkûuni C. Ouédraogo, Laura Plein, Abdoul Kader Kaboré, Andrew Habib, Jacques Klein, David Lo, Tegawendé F. Bissyandé

Abstract

Automated test case generation is a critical component of modern software quality assurance, yet tools like EvoSuite and Randoop often fail to generate the specific, "natural" input values necessary to trigger complex logic errors. This paper presents BRMiner, a novel framework that bridges the gap between unstructured, human-written bug reports and automated test generation. By employing Large Language Models (LLMs) to filter and refine "literal" inputs—such as specific strings, numeric values, or data structures—found within bug reports, BRMiner provides high-quality "seeds" for automated generators. Our evaluation on the Defects4J benchmark demonstrates that BRMiner achieves a Relevant Input Rate (RIR) of 60.03% and enables the detection of 58 unique bugs that traditional automated methods failed to uncover.

Introduction

The "holy grail" of software engineering is fully automated test case generation capable of achieving high code coverage and identifying subtle bugs without human intervention. While state-of-the-art tools are proficient at exploring broad execution paths, they frequently struggle with the "input problem": they lack the semantic context to generate the precise data values required to reach deep logic branches or trigger specific crashes.

Conversely, bug reports submitted by users and developers are a rich source of these "golden" inputs. A typical report often includes the exact configuration, string, or sequence of events that led to a failure. However, these reports are inherently messy, containing a mixture of natural language, stack traces, and code snippets. Traditional extraction methods, such as regular expressions, often suffer from high noise levels, pulling in irrelevant data like developer signatures or unrelated URLs.

Example of a GitHub bug report (Jackson #3447) containing specific input patterns—a deeply nested JSON structure—that trigger a StackOverflowError.

Methodology: The BRMiner Framework

BRMiner addresses the extraction challenge by combining traditional program analysis with the semantic reasoning capabilities of LLMs. The workflow consists of four primary stages:

  1. Parsing: The system retrieves bug reports from platforms like GitHub or Jira. It utilizes tools like Infozilla to distinguish between natural language text and embedded code snippets.
  2. Extraction: Potential input candidates are identified through two parallel tracks. A Javalang parser analyzes code snippets for hardcoded constants, while regular expressions scan the natural language text for quoted strings and numeric values.
  3. LLM Filtering: To eliminate noise, BRMiner employs GPT-3.5-turbo as a semantic filter. Using a Tree of Thoughts (ToT) prompting strategy, the model is tasked with reasoning whether a candidate input is contextually relevant to the described bug. This allows the system to distinguish between a URL that is part of a bug and one that is merely part of a signature.
  4. Test Generation: The refined, high-quality inputs are injected into the static input pools of tools like EvoSuite or Randoop. This "seeding" process allows the automated tools to start their search from contextually relevant points in the input space.
A reproduction test case illustrating how the specific input patterns (the nested structure) extracted from the bug report are used to generate a functional test.

Experimental Evaluation

The authors evaluated BRMiner using the Defects4J benchmark, analyzing over 22,000 bug reports across 17 open-source Java projects. The goal was to determine the prevalence of relevant inputs in reports and the effectiveness of BRMiner in extracting them.

Key Insights

  • LLMs as Semantic Filters: The study highlights that LLMs are most effective not as primary test generators, but as intelligent filters that understand the context of a bug.
  • Implicit vs. Explicit Mentions: While only 36% of reports explicitly mention problematic inputs, another 43% describe them implicitly. BRMiner’s LLM component successfully infers these implicit inputs where traditional scripts fail.
  • The "AllLit" Strategy: Interestingly, using inputs mined from all bug reports within a project improved bug detection. This suggests that certain "problematic" data types tend to recur within a specific codebase.

Results

BRMiner demonstrated significant improvements over baseline methods:

  • Accuracy: It achieved a Relevant Input Rate (RIR) of 60.03%, outperforming both purely traditional and purely LLM-based approaches.
  • Bug Detection: The framework facilitated the discovery of 58 unique bugs that were previously missed by standard automated generation.
  • Coverage Gains: Integration with EvoSuite led to measurable increases in branch, instruction, method, and line coverage.

Limitations and Future Work

Despite its success, several challenges remain. The "Oracle Problem"—determining if a generated test actually passed or failed without a known correct version—remains a hurdle for live environments. Additionally, the cost and latency of LLM queries pose scalability concerns. Future work will focus on integrating BRMiner directly into CI/CD pipelines to enable the automatic generation of regression tests immediately upon the submission of a new bug report.

Summary updated

BibTeX
@article{ouedraogo2025enriching,
  author = {Wendkûuni C. Ouédraogo and Laura Plein and Abdoul Kader Kaboré and Andrew Habib and Jacques Klein and David Lo and Tegawendé F. Bissyandé},
  title = {{Enriching automatic test case generation by extracting relevant test inputs from bug reports}},
  journal = {Empir. Softw. Eng.},
  year = {2025},
  doi = {10.1007/s10664-025-10635-z},
}
Figure