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

Defect Prediction Guided Search-Based Software Testing

Anjana Perera, Aldeida Aleti, Marcel Böhme, Burak Turhan

TL;DR

Researchers have developed a way to make automated software testing significantly more efficient by using "defect prediction" to decide where to spend a limited testing budget. By prioritizing "buggy-looking" code, their approach (SBST-DPG) found up to 13.1% more real-world bugs than standard methods within the same timeframe.

What Problem Does This Paper Address?

Search-Based Software Testing (SBST) is a powerful technique that uses genetic algorithms to automatically generate test cases. Traditionally, these tools have one primary goal: code coverage. The logic is simple—you can't find a bug in code you haven't executed.

However, the authors point out two major flaws in this "coverage-first" status quo:

  1. Coverage $\neq$ Bugs: You can execute a line of code without actually triggering the specific conditions that cause it to fail.
  2. The Budget Crisis: In massive industrial systems, you don't have the time to test every single class exhaustively. Current tools usually split their time budget equally across all parts of the software. This is like a detective spending exactly 60 seconds in every room of a mansion, regardless of whether a room has a broken window or a pristine lock.

Methods

The authors introduce SBST-DPG (Defect Prediction Guided SBST), which consists of three main modules:

  1. The Predictor (Schwa): Instead of starting blind, the system uses a tool called Schwa to analyze the project's history (Git logs). It looks at how often a class was changed, how many bug fixes it recently had, and whether new authors have touched it. It then assigns a "defect score" to every class.
  2. The Budget Manager (BADS): This is the core innovation. The Budget Allocation Based on Defect Scores (BADS) algorithm uses an exponential function to distribute time. High-risk classes get a massive lion's share of the testing time, while low-risk classes get a small "minimum" budget to ensure they aren't totally ignored. They also use a 2-Tier approach, separating the "likely buggy" top half of classes from the "likely clean" bottom half.
  3. The Searcher (EvoSuite/DynaMOSA): The system plugs these custom time budgets into EvoSuite, a state-of-the-art test generator. Specifically, they use the DynaMOSA algorithm, which is highly efficient at navigating complex code structures.

Datasets

The researchers evaluated their approach using Defects4J, the gold-standard benchmark for Java research. It contains 434 real-world bugs harvested from six major open-source projects:

  • JFreeChart (Chart)
  • Closure Compiler (Closure)
  • Apache Commons-Lang (Lang)
  • Apache Commons-Math (Math)
  • Mockito
  • Joda-Time (Time)

Key Insights and Ideas

  • Bugs are Clumpy: The authors observed that bugs aren't evenly distributed; they cluster. By correctly ranking buggy classes in the top 10% of the project, the predictor allowed the search tool to spend over 66 seconds on those classes versus just 2 seconds on "cleaner" ones.
  • The "Tight Budget" Advantage: The benefits of guided testing are most dramatic when time is scarce. When researchers gave the tool only 15 seconds per class, the guided approach crushed the baseline.
  • Finding the "Unfindable": Perhaps the most interesting insight is that SBST-DPG found 35 unique bugs that the standard approach couldn't find at all. This suggests that some bugs require deep, exhaustive searching that you only get when you stop wasting time on healthy code.
  • Negligible Overhead: You might think analyzing Git history takes too long, but the authors found the prediction phase added only about 0.68 seconds of overhead per class—a tiny price to pay for a 13% boost in bug detection.

Key Results

  • Efficiency Boost: Under a tight budget (15s/class), SBST-DPG found 151.45 bugs on average, compared to 133.95 for the baseline—a 13.1% improvement.
  • Statistical Significance: The results were backed by a Mann-Whitney U-Test with a p-value < 0.0001 and a very high effect size ($A_{12} = 0.94$), meaning the improvement isn't just a fluke of the genetic algorithm's randomness.
  • Robustness: SBST-DPG was more "reliable," finding bugs in every single run (100% success rate) for a higher number of cases than the baseline.

Limitations and Future Work

  • Test Suite Bloat: To maximize bug finding, the authors disabled "test suite minimization." This means the resulting test suites are larger and might be harder for human developers to read and maintain.
  • Oracle Problem: While the tool finds the bugs, a human still has to write the "assertions" (the code that checks if the output is correct) or manually verify the failures.
  • Language Constraints: The study was limited to Java. While the concept is language-agnostic, the implementation relies on Java-specific tools like EvoSuite.
  • Future Directions: The authors plan to experiment with different defect predictors (perhaps deep learning-based) and develop smarter ways to shrink the resulting test suites without losing their bug-hunting power.

Summary updated

BibTeX
@inproceedings{perera2020defect,
  author = {Anjana Perera and Aldeida Aleti and Marcel Böhme and Burak Turhan},
  title = {{Defect Prediction Guided Search-Based Software Testing}},
  booktitle = {ASE},
  year = {2020},
  doi = {10.1145/3324884.3416612},
}
Figure