Title
#ifdef Directives and Program Comprehension: The Dilemma between Correctness and Preference
Abstract
Many organizations and open-source projects use the C preprocessor (CPP) to implement configurability in their software systems. Despite extensive research, existing studies on the effects of CPP use on program comprehension are still limited to experiences, opinions, and empirical studies with narrow scopes. So, it is unclear whether the CPP actually leads to what is sometimes referred to as "#ifdef hell." In this paper, we expand the existing evidence on program comprehension in the presence of CPP directives, but we also highlight a surprising dilemma. We conducted an empirical study, including an experiment and a questionnaire, on the impact of refactoring CPP directives with 521 experienced software developers. The results indicate that, in contrast to previous findings, comprehension performance slightly worsened in terms of correctness when our participants worked on code with refactored CPP directives. However, in alignment with previous findings, they preferred the refactored code, considering it more comprehensible and easier to work with. This dilemma of objective performance versus subjective preference is a surprising outcome that has not been found before. We argue that our work motivates the need for more studies to understand this dilemma-which may significantly impact common beliefs in research and practice.
Year
DOI
Venue
2020
10.1109/ICSME46990.2020.00033
2020 IEEE International Conference on Software Maintenance and Evolution (ICSME)
Keywords
DocType
ISSN
Configurable Systems,Preprocessors,Program Comprehension,Refactoring,Empirical Study
Conference
1063-6773
ISBN
Citations 
PageRank 
978-1-7281-5620-0
0
0.34
References 
Authors
0
4
Name
Order
Citations
PageRank
Wolfram Fenske1618.04
Jacob Krüger200.34
Maria Kanyshkova300.34
Sandro Schulze425923.43