Reverse engineering code dependencies: converting integer-based variability to propositional logic

A number of SAT-based analysis concepts and tools for software product lines exist, that extract code dependencies in propositional logic from the source code assets of the product line. On these extracted conditions, SAT-solvers are used to reason about the variability. However, in practice, a lot of software product lines use integer-based variability. The variability variables hold integer values, and integer operators are used in the conditions. Most existing analysis tools can not handle this kind of variability; they expect pure Boolean conditions. This paper introduces an approach to convert integer-based variability conditions to propositional logic. Running this approach as a preparation on an integer-based product line allows the existing SAT-based analyses to work without any modifications. The pure Boolean formulas, that our approach builds as a replacement for the integer-based conditions, are mostly equivalent to the original conditions with respect to satisfiability. Our approach was motivated by and implemented in the context of a real-world industrial case-study, where such a preparation was necessary to analyze the variability. Our contribution is an approach to convert conditions, that use integer variables, into propositional formulas, to enable easy usage of SAT-solvers on the result. It works well on restricted variables (i.e. variables with a small range of allowed values); unrestricted integer variables are handled less exact, but still retain useful variability information.

[1]  Krzysztof Czarnecki,et al.  A study of non-Boolean constraints in variability models of an embedded operating system , 2011, SPLC '11.

[2]  Krzysztof Czarnecki,et al.  A Study of Variability Models and Languages in the Systems Software Domain , 2013, IEEE Transactions on Software Engineering.

[3]  Sven Apel,et al.  Preprocessor-based variability in open-source and industrial software systems: An empirical study , 2016, Empirical Software Engineering.

[4]  Gunter Saake,et al.  A Classification and Survey of Analysis Strategies for Software Product Lines , 2014, ACM Comput. Surv..

[5]  Krzysztof Czarnecki,et al.  Range Fixes: Interactive Error Resolution for Software Configuration , 2015, IEEE Transactions on Software Engineering.

[6]  Sascha El-Sharkawy,et al.  Reverse engineering variability in an industrial product line: observations and lessons learned , 2018, SPLC.

[7]  Sebastian Erdweg,et al.  Variability-aware parsing in the presence of lexical macros and conditional compilation , 2011, OOPSLA '11.

[8]  L Chappell Undertaker. , 1983, British medical journal.

[9]  David L. Dill,et al.  Checking Satisfiability of First-Order Formulas by Incremental Translation to SAT , 2002, CAV.

[10]  Sven Apel,et al.  An analysis of the variability in forty preprocessor-based software product lines , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[11]  ApelSven,et al.  A Classification and Survey of Analysis Strategies for Software Product Lines , 2014 .

[12]  Sascha El-Sharkawy,et al.  An Empirical Study of Configuration Mismatches in Linux , 2017, SPLC.

[13]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[14]  Sascha El-Sharkawy,et al.  KernelHaven: an open infrastructure for product line analysis , 2018, SPLC.

[15]  Marsha Chechik,et al.  Tools and Algorithms for the Construction and Analysis of Systems , 2016, Lecture Notes in Computer Science.

[16]  Sascha El-Sharkawy,et al.  KernelHaven – An Experimentation Workbench for Analyzing Software Product Lines , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering: Companion (ICSE-Companion).

[17]  Wolfgang Schröder-Preikschat,et al.  Feature consistency in compile-time-configurable system software: facing the linux 10,000 feature problem , 2011, EuroSys '11.

[18]  Krzysztof Czarnecki,et al.  Where Do Configuration Constraints Stem From? An Extraction Approach and an Empirical Study , 2015, IEEE Transactions on Software Engineering.