TL;DR
This paper introduces iGen, a novel dynamic analysis technique that automatically discovers "interactions" – logical relationships between configuration options and code coverage – in highly configurable software. iGen significantly improves upon prior methods by being more scalable, language-agnostic, and capable of inferring a richer set of interactions, making it easier for developers to understand and manage complex software systems.
What Problem Does This Paper Address?
Modern software systems are increasingly configurable, offering immense flexibility but also creating significant challenges for developers. Understanding how different combinations of configuration options affect program behavior, especially code coverage, is crucial for tasks like testing, debugging, and impact analysis. However, manually acquiring this detailed information is a daunting, time-consuming, and error-prone process due to the combinatorial explosion of possible configurations. Existing automated methods, like symbolic execution, struggle with scalability and language support, while others focus on finding configurations for maximum coverage rather than inferring precise interaction rules. This paper aims to bridge this gap by providing a practical and scalable dynamic analysis tool to automatically discover these configuration-coverage interactions.
Methods
iGen employs an iterative, dynamic analysis approach. The core of the method involves:
- Configuration Generation: Starting with a basic set of configurations (e.g., a one-way covering array and a default configuration), iGen generates new configurations in each iteration.
- Dynamic Analysis & Coverage Collection: The subject program is run with the generated configurations, and code coverage data is collected for each run.
- Interaction Inference: Based on the collected coverage data, iGen infers potential interactions. It supports four interaction templates: purely conjunctive, purely disjunctive, conjunctive with a disjunctive last conjunct, and disjunctive with a conjunctive last disjunct. This inference is done efficiently by leveraging pointwise unions of covering and non-covering configurations.
- Iterative Refinement: The inferred interactions are used to guide the generation of new configurations in the next iteration, aiming to refine and improve the precision of the discovered interactions. This process continues until a fix-point is reached (i.e., no new coverage is achieved or no new interactions are inferred).
A key novelty is iGen's iterative refinement loop, which intelligently selects new configurations to explore, allowing it to converge to precise interactions with a small fraction of the total possible configurations.
Datasets
The paper evaluates iGen on 29 subject programs. These programs span five languages (C, Perl, Python, Haskell, and OCaml) and vary significantly in size, from tens to hundreds of thousands of lines of code. The programs include:
- GNU Coreutils: A widely used set of command-line utilities.
- Perl Power Tools (PPT): Reimplementations of coreutils in Perl.
- Assorted Programs: Including
cloc(line counter),ack/grin(grep-like),pylint/hlint(static checkers),pandoc(document converter),unison(file synchronizer),bibtex2html(BibTeX to HTML converter),gzip(compression tool),httpd(Apache web server),vsftpd(FTP server), andngircd(IRC daemon).
For most programs, iGen uses run-time configuration options. For httpd, compile-time options were studied. The paper notes that for some programs, test suites were manually created or augmented to cover basic functionality.
Key Insights and Ideas
- Rich Interaction Templates: iGen's ability to infer not just conjunctive but also disjunctive and mixed interactions is a significant advancement, as these are shown to occur in real-world software and were not well-supported by prior work.
- Efficient Convergence: The iterative refinement strategy allows iGen to discover precise interactions using a remarkably small fraction of the total possible configurations, making it practical for large systems.
- Language Agnosticism: By relying on code coverage (a widely available tool) and a general-purpose SMT solver (Z3), iGen is largely language-agnostic, a major advantage over language-specific tools like symbolic executors.
- "Enabling Options" are Common: The study highlights the prevalence of "enabling options" – configuration settings that must be in a specific state (often disabled) to achieve significant code coverage. This provides valuable insights into software design.
- Interaction Length vs. Coverage: While longer interactions (more conjuncts/disjuncts) can be more precise, the majority of code coverage is often achieved by relatively short interactions (length < 3).
Key Results
- Correctness: For a subset of programs, iGen's inferred interactions achieved coverage very similar to exhaustive runs, with only minor differences in a few cases. The f-score, measuring accuracy against exhaustive runs, was high for most programs.
- Efficiency: iGen explored a small fraction of the total configuration space. For example, for
lswith over 3.5 x 10^14 possible configurations, iGen explored only 2175. The running time was dominated by test suite execution, making it efficient for large systems. - Precision: iGen generated significantly more precise interactions compared to prior tools like iTree, while still being much faster than older symbolic execution-based methods.
- Analysis: iGen confirmed prior observations about the sparsity of interactions and the importance of few, long interactions for full coverage. It also revealed that disjunctive and mixed interactions, though less common than conjunctive ones, cover a non-trivial portion of code.
- Minimal Configurations: iGen's inferred interactions were used to compute minimal sets of configurations that achieve full coverage, demonstrating a dramatic reduction in the number of configurations needed for testing.
Limitations and Future Work
- Interaction Templates: iGen's current interaction templates are limited. While they cover common cases, more complex nested structures are not directly supported. The authors suggest extending the algorithm to handle more complex formulae.
- Test Suite Dependence: The accuracy and completeness of inferred interactions are dependent on the quality and coverage of the input test suite.
- Randomness: iGen incorporates randomness in configuration generation and interaction selection, meaning results can vary slightly between runs. While the variance was shown to be reasonable, it means results are not deterministic.
- Completeness of Coverage: The paper acknowledges that the test suites used, while reasonable, may not achieve full code coverage.
- Future Work: The authors suggest exploring SMT-based techniques for verifying the correctness of iGen's inferred interactions and investigating more complex interaction forms. They also plan to explore how to handle systems with unbounded configuration option values.
Summary updated