TL;DR
TAILOR is a novel framework that automatically customizes static analysis tools for specific codebases and time constraints by framing configuration as an optimization problem. By searching through millions of possible analysis settings, it nearly doubles the number of verified program properties compared to expert-tuned defaults. Crucially, these tailored configurations remain highly effective across dozens of subsequent code commits, minimizing re-tuning overhead.
What Problem Does This Paper Address?
Static analyzers—specifically abstract interpreters—are powerful tools for finding bugs and proving software properties without running the code. However, they are notoriously difficult to configure. They present users with a massive state space of options: choosing different mathematical abstractions (abstract domains), setting widening thresholds, and deciding whether to run backward or forward analyses.
Because finding the sweet spot between analysis precision and computational speed requires deep expertise, most users stick to the tool's default settings. But defaults are a compromise. A setting optimized for an overnight continuous integration (CI) pipeline is useless for a developer wanting instant feedback in their IDE. Conversely, simply turning on the "most precise" settings often causes the analyzer to run out of time or memory. This paper addresses the challenge of automatically finding the optimal analysis configuration for a specific piece of code under explicit resource constraints.
Methods
The authors introduce TAILOR, a framework that automates configuration by treating it as an optimization problem.
TAILOR searches for a "recipe"—a sequential combination of analysis "ingredients" (abstract domains and their parameters)—using a two-phase optimization engine:
- Phase 1 (Domain Optimization): Identifies the best sequence of abstract domains to use.
- Phase 2 (Settings Optimization): Fine-tunes parameters like widening thresholds, array handling, and backward analysis.
The search is guided by a custom cost function that penalizes configurations that fail to verify assertions or exceed the user-specified time limit. To navigate the massive search space (over 6 million combinations), the authors instantiated TAILOR with four search algorithms: Random Sampling (RS), Hill Climbing (HC), Simulated Annealing (SA), and a novel Domain-Aware Random Sampling (DARS). DARS uses a partially ordered set (poset) of domain precision to avoid wasting time on redundant or mathematically incomparable domain combinations.
Datasets
The authors evaluated TAILOR using 120 LLVM-bitcode files sampled uniformly from six popular open-source C projects on GitHub:
- CURL (networking tool)
- DARKNET (neural network framework)
- FFMPEG (multimedia tool)
- GIT (version control)
- PHP-SRC (PHP interpreter)
- REDIS (in-memory database)
To evaluate precision, the files were instrumented with assertions checking for four common runtime errors: division by zero, integer overflow, buffer overflow, and use-after-free. In total, the benchmark suite contained 1,346 functions and 5,557 assertions.
Key Insights and Ideas
- More precise isn't always better: Counter-intuitively, TAILOR's tailored configurations proved more properties than the theoretically "most precise" configuration. Highly precise domains (like Polyhedra) can suffer from integer overflows in their internal coefficients or trigger aggressive widening operators that ultimately destroy precision.
- No "One Size Fits All": The optimal configurations found by TAILOR were incredibly diverse. No single abstract domain dominated the results; instead, different files required entirely different combinations of domains and settings, proving that static defaults are inherently suboptimal.
- Amortized Tuning Costs: A major concern with optimization-based tuning is the upfront time cost. However, the authors discovered that a configuration tailored for an older version of a file remains optimal for up to 50 subsequent commits. This resilience means tuning can happen infrequently and offline (e.g., overnight).
Key Results
TAILOR was tested under two scenarios: a 1-second timeout (simulating an IDE editor) and a 5-minute timeout (simulating a CI pipeline), and compared against CRAB’s expert-tuned default configuration (DEF).
- Double the Precision: Across both timeouts, TAILOR verified nearly twice as many assertions as the default configuration. For instance, in the 5-minute CI scenario, the DARS algorithm verified 953 assertions compared to just 457 by the default settings.
- Near-Optimality: To check if TAILOR's recipes could be easily improved, the authors systematically mutated individual parts of the generated recipes. At least 93% of the mutated recipes performed worse or equal to TAILOR's selection, confirming its high efficacy.
Limitations and Future Work
- Intra-procedural Focus: TAILOR currently configures the analyzer for intra-procedural analysis (analyzing functions in isolation). Scaling this to inter-procedural analysis is a noted challenge for future work, as it requires managing complex function summaries across different calling contexts.
- Soundness is Fixed: The framework only tunes parameters within a sound analysis space. It does not currently explore trading off soundness (allowing false negatives) for performance, though the authors note this could be integrated if supported by the underlying analyzer.
Summary updated