Fast static analyses of software product lines: an example with more than 42,000 metrics

Context: Software metrics, as one form of static analyses, is a commonly used approach in software engineering in order to understand the state of a software system, in particular to identify potential areas prone to defects. Family-based techniques extract variability information from code artifacts in Software Product Lines (SPLs) to perform static analysis for all available variants. Many different types of metrics with numerous variants have been defined in literature. When counting all metrics including such variants, easily thousands of metrics can be defined. Computing all of them for large product lines can be an extremely expensive process in terms of performance and resource consumption. Objective: We address these performance and resource challenges while supporting customizable metric suites, which allow running both, single system and variability-aware code metrics. Method: In this paper, we introduce a partial parsing approach used for the efficient measurement of more than 42,000 code metric variations. The approach covers variability information and restricts parsing to the relevant parts of the Abstract Syntax Tree (AST). Conclusions: This partial parsing approach is designed to cover all relevant information to compute a broad variety of variability-aware code metrics on code artifacts containing annotation-based variability, e.g., realized with C-preprocessor statements. It allows for the flexible combination of single system and variability-aware metrics, which is not supported by existing tools. This is achieved by a novel representation of partially parsed product line code artifacts, which is tailored to the computation of the metrics. Our approach consumes considerably less resources, especially when computing many metric variants in parallel.

[1]  Martin Becker,et al.  Code-based variability model extraction for software product line improvement , 2012, SPLC '12.

[2]  Sven Apel,et al.  Scalable analysis of variable software , 2013, ESEC/FSE 2013.

[3]  Ewan D. Tempero,et al.  A systematic review of software maintainability prediction and metrics , 2009, 2009 3rd International Symposium on Empirical Software Engineering and Measurement.

[4]  Dror G. Feitelson,et al.  Characterization and assessment of the linux configuration complexity , 2013, 2013 IEEE 13th International Working Conference on Source Code Analysis and Manipulation (SCAM).

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

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

[7]  H. E. Dunsmore,et al.  Software engineering metrics and models , 1986 .

[8]  Krzysztof Czarnecki,et al.  Cool features and tough decisions: a comparison of variability modeling approaches , 2012, VaMoS.

[9]  José Maria Monteiro,et al.  DyMMer: a measurement-based tool to support quality evaluation of DSPL feature models , 2016, SPLC.

[10]  Sven Apel,et al.  On the relation between internal and external feature interactions in feature-oriented product lines: a case study , 2014, FOSD '14.

[11]  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.

[12]  Donald D. Cowan,et al.  S.P.L.O.T.: software product lines online tools , 2009, OOPSLA Companion.

[13]  Sallie Marie Henry,et al.  Information flow metrics for the evaluation of operating systems' structure. , 1979 .

[14]  RadjenovićDanijel,et al.  Software fault prediction metrics , 2013 .

[15]  Sascha El-Sharkawy,et al.  MetricHaven: More than 23,000 Metrics for Measuring Quality Attributes of Software Product Lines , 2019, SPLC.

[16]  Marco Tulio Valente,et al.  Extracting Software Product Lines: A Case Study Using Conditional Compilation , 2011, 2011 15th European Conference on Software Maintenance and Reengineering.

[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]  Capers Jones,et al.  Programming Productivity , 1986 .

[19]  Thorsten Berger,et al.  Towards system analysis with variability model metrics , 2014, VaMoS.

[20]  Richard Torkar,et al.  Software fault prediction metrics: A systematic literature review , 2013, Inf. Softw. Technol..

[21]  Shari Lawrence Pfleeger,et al.  Software Metrics : A Rigorous and Practical Approach , 1998 .

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

[23]  Silvia Mara Abrahão,et al.  A systematic review of quality attributes and measures for software product lines , 2011, Software Quality Journal.

[24]  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).

[25]  Maurice H. Halstead,et al.  Elements of software science (Operating and programming systems series) , 1977 .

[26]  José Maria Monteiro,et al.  Measures for Quality Evaluation of Feature Models , 2015, ICSR.

[27]  Sascha El-Sharkawy,et al.  Metrics for analyzing variability and its implementation in software product lines: A systematic literature review , 2019, Inf. Softw. Technol..

[28]  Jonathan I. Maletic,et al.  Lightweight Transformation and Fact Extraction with the srcML Toolkit , 2011, 2011 IEEE 11th International Working Conference on Source Code Analysis and Manipulation.

[29]  Sven Apel,et al.  Discipline Matters: Refactoring of Preprocessor Directives in the #ifdef Hell , 2018, IEEE Transactions on Software Engineering.

[30]  Marcelo de Almeida Maia,et al.  A quantitative and qualitative assessment of aspectual feature modules for evolving software product lines , 2014, Sci. Comput. Program..

[31]  Sven Apel,et al.  Do #ifdefs influence the occurrence of vulnerabilities? an empirical study of the linux kernel , 2016, SPLC.

[32]  Sven Apel,et al.  Analyzing the discipline of preprocessor annotations in 30 million lines of C code , 2011, AOSD '11.

[33]  Anas N. Al-Rabadi,et al.  A comparison of modified reconstructability analysis and Ashenhurst‐Curtis decomposition of Boolean functions , 2004 .

[34]  Sven Apel,et al.  A Study of Feature Scattering in the Linux Kernel , 2021, IEEE Transactions on Software Engineering.

[35]  James M. Bieman,et al.  Software Metrics: A Rigorous and Practical Approach, Third Edition , 2014 .

[36]  Wolfgang Schröder-Preikschat,et al.  Efficient extraction and analysis of preprocessor-based variability , 2010, GPCE '10.

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

[38]  Gunter Saake,et al.  When code smells twice as much: Metric-based detection of variability-aware code smells , 2015, 2015 IEEE 15th International Working Conference on Source Code Analysis and Manipulation (SCAM).

[39]  Juha Savolainen,et al.  Variability evolution and erosion in industrial product lines: a case study , 2013, SPLC '13.

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

[41]  Sven Apel,et al.  Feature cohesion in software product lines: an exploratory study , 2011, 2011 33rd International Conference on Software Engineering (ICSE).