TL;DR
Modern software is highly configurable, but testing every possible combination of settings is computationally impossible. This paper introduces GenTree, a dynamic analysis tool that uses decision trees and iterative refinement to automatically learn "interactions"—precise logical formulas that dictate which configuration settings trigger specific code coverage—while exploring only a tiny fraction of the total configuration space.
What Problem Does This Paper Address?
Software systems today come with a massive number of configuration options. This creates a "configuration space explosion." For example, a program with just 47 boolean options has over $3.5 \times 10^{14}$ possible configurations. This makes testing, debugging, and static analysis incredibly difficult, as certain bugs or behaviors only manifest under highly specific combinations of settings.
Previous attempts to map out these configurations (called "interactions") have fallen short. Static analysis and symbolic execution struggle to scale and often require manual mock-ups for external libraries. Existing dynamic approaches (like iGen or iTree) scale better but are limited in their expressiveness—they can typically only discover simple, purely conjunctive (AND) or purely disjunctive (OR) rules, missing the complex, mixed boolean logic that governs real-world software behavior.
Methods
GenTree treats the problem of finding interactions as a machine learning classification task, supercharged by an iterative refinement loop:
- Initial Sampling: GenTree starts by running the program against a small, mathematically structured sample of configurations (a 1-way covering array) and records which lines of code are covered.
- Custom Decision Trees (C5i): For every covered location, GenTree builds a decision tree to classify the configurations into "hits" (covered) and "misses" (not covered). Standard ML decision trees (like C5.0) aggressively prune branches to avoid overfitting, which destroys the precise logical rules needed for software analysis. To fix this, the authors built C5i, a custom algorithm that skips pruning to perfectly fit the training data.
- Iterative Refinement (Counterexample Generation): Because C5i overfits the small initial sample, the resulting trees are likely imprecise. GenTree analyzes the tree to find "weak" paths (rules supported by very few configurations). It then generates new configurations that satisfy these weak rules and runs the program. If the new configurations don't behave as the tree predicted, they become "counterexamples."
- Loop: These counterexamples are fed back into the C5i algorithm to build a smarter, more accurate tree. This loop continues until the trees stabilize.
Datasets
The authors evaluated GenTree on 17 configurable open-source programs spanning four languages (C, Python, Perl, and OCaml). The datasets include:
- GNU
coreutils: 9 programs includingls,sort,cat, anddate. - Assorted Tools:
grin,pylint,unison,bibtex2html,cloc, andack. - Servers:
vsftpd(FTP server) andngircd(IRC daemon).
The configuration spaces of these programs range from a modest 1,024 combinations up to a staggering $3.5 \times 10^{14}$ combinations.
Key Insights and Ideas
- Complex interactions matter: Prior tools assumed configuration rules were mostly simple AND/OR statements. GenTree revealed that "mixed" interactions (complex combinations of ANDs and ORs) are actually quite common, especially in larger programs like
sortandls. - Interactions are surprisingly short: Even in a program with trillions of configurations, the rules governing specific lines of code rarely involve more than a handful of variables. The median interaction length across most tested programs was less than 10 options.
- The prevalence of "Enabling Options": Many programs have gatekeeper options (e.g.,
--helpor--version) that immediately terminate the program. GenTree naturally identifies these as "enabling options" that must be set to specific values (e.g.,False) to reach the vast majority of the codebase. - Overfitting is a feature, not a bug (if you have an oracle): By intentionally overfitting a decision tree and then actively generating adversarial counterexamples to break it, GenTree efficiently converges on exact logical truths without needing to explore the whole space.
Key Results
- High Accuracy: For programs small enough to be exhaustively tested (where the absolute "ground truth" of all configurations is known), GenTree's inferred interactions matched the exact ground truth for the vast majority of code locations.
- Massive Efficiency: GenTree scales remarkably well. For the
lscommand ($3.5 \times 10^{14}$ possible configurations), GenTree successfully mapped out 193 distinct interactions by generating and analyzing only 112,566 configurations—a microscopic fraction of the total space. - Outperforming State-of-the-Art: Compared to the existing dynamic tool iGen, GenTree explored slightly more configurations but discovered vastly more expressive interactions. For instance, in the
sortprogram, iGen failed to generate 122 out of 132 mixed interactions, whereas GenTree successfully captured them.
Limitations and Future Work
- Test Suite Dependency: Because GenTree is a dynamic analysis tool, it relies on existing test suites to execute the code. If a test suite doesn't exercise a specific feature, GenTree cannot learn the interactions for that feature's code.
- Non-Finite Variables: GenTree's decision tree approach works beautifully for boolean flags and options with small, finite sets of values. It cannot currently infer interactions for options that take arbitrary numerical values or unbounded strings.
- Future Work: The authors suggest that GenTree's output could be used to automatically generate minimal, high-coverage test suites for configurable software, drastically reducing CI/CD pipeline times for complex systems.
Summary updated