TL;DR
This paper introduces SPLif, a novel technique for efficiently detecting bugs in software product lines (SPLs) even when their feature models are incomplete or non-existent. By analyzing test execution profiles, SPLif intelligently prioritizes which tests and configurations to inspect, significantly reducing the manual effort required to find real faults.
What Problem Does This Paper Address?
Software Product Lines (SPLs) are families of software that share common functionality but differ in specific features. Testing SPLs is notoriously challenging because the number of possible product configurations can be astronomical. Feature models are designed to help by defining which combinations of features are valid, thereby reducing the testing space. However, in real-world scenarios, these feature models are often incomplete or entirely missing. This makes it difficult to distinguish between bugs in the software, bugs in the tests themselves, or failures caused by simply running an invalid feature combination. The paper tackles this problem by developing a method to find bugs in legal configurations, even without a complete feature model.
Methods
The core of SPLif is a three-part automated process:
- Test Exploration: SPLif leverages an existing tool called SPLat, which dynamically analyzes test executions. For each test, SPLat explores configurations that are "dynamically reachable" (i.e., configurations that the test's execution path actually encounters). Crucially, SPLif modifies SPLat to treat unknown configurations as potentially valid, allowing it to explore a wider range of possibilities than if it strictly adhered to a known (but incomplete) model. It also incorporates time limits to handle potentially problematic configurations.
- Test Ranking: SPLif ranks tests based on their likelihood of containing legal failing configurations. This ranking uses a "suspiciousness score" (Sᵢ), which is the ratio of failing to passing configurations for a given test. Tests with a higher suspiciousness score, especially those with a non-zero number of failures on legal configurations (FLᵢ), are prioritized.
- Configuration Ranking: For a selected failing test, SPLif ranks the configurations that caused the failure. This ranking can be done using several strategies:
- Random: A baseline for comparison.
- UpdateFM: Memoizes previously labeled configurations to avoid redundant inspections.
- Weighted: Ranks configurations based on criteria like the number of undefined features, the number of failing tests that use the configuration, and similarity to previously identified legal configurations.
- Adaptive: Dynamically re-ranks tests after each configuration inspection, leveraging updated information about feature model legality.
The overall approach involves iteratively selecting the highest-ranked test, then the highest-ranked failing configuration for that test, and asking the user to label it as legal or illegal. This feedback is used to incrementally build a more complete feature model.
Datasets
The paper evaluates SPLif on five small, publicly available software product line subjects: Companies, GPL, Notepad, DesktopSearcher, and ZipMe. Additionally, it uses the GNU Compiler Collection (GCC), a large, real-world configurable system, as a case study. For GCC, the authors used an existing feature model as ground truth and augmented it with manually extracted constraints.
Key Insights and Ideas
- The value of "unknown" configurations: By treating unknown configurations as potentially valid during exploration, SPLif can uncover failures that might be missed if it strictly adhered to an incomplete model.
- Prioritization is key: The core insight is that not all failing tests or configurations are equally important. SPLif's ranking mechanisms intelligently guide the user to the most promising areas for bug detection, saving significant manual effort.
- Incremental learning: The feedback loop where users label configurations as legal or illegal allows SPLif to incrementally build a more accurate feature model, which in turn improves the accuracy of subsequent rankings.
- Real-world impact: The successful discovery of new bugs in GCC, a mature and heavily tested system, demonstrates the practical applicability of SPLif even on large, complex software.
Key Results
- SPLif successfully identified new bugs in GCC, with three of the five reported bugs being fixed by the development team.
- For the Notepad example, SPLif reduced the number of inspections needed to find a legal failing configuration from an average of 37 (random) to just 10.
- In the GCC case study, using Weighted or Adaptive modes, only 45 configurations needed inspection to find a legal failing configuration for all 43 crash-revealing tests, out of 268 failing configurations.
- The paper found that the "UpdateFM" and "Weighted/Adaptive" ranking strategies were particularly effective depending on the nature of the failures (common illegal vs. common legal configurations).
Limitations and Future Work
- Generalization: The authors acknowledge that the selection of subjects and tests could be a threat to generalization. While they used a mix of small SPLs and a large real-world system (GCC), further evaluation on a wider range of systems is needed.
- User Labeling Accuracy: The accuracy of SPLif relies on the user correctly labeling configurations as legal or illegal. The paper notes that users can skip uncertain labels, and future work could involve automatically checking label legality against the evolving feature model.
- Optimization of Execution: While SPLif optimizes inspection, it relies on SPLat for test execution. Future work could explore further optimizations for test execution itself, potentially by leveraging similarities across configurations.
- Feature Model Extraction: The paper mentions that existing techniques for feature model extraction could complement SPLif by providing better initial models, suggesting future integration.
Summary updated