Do background colors improve program comprehension in the #ifdef hell?

Research output: Contribution to journalResearch articleContributedpeer-review

Contributors

  • Janet Feigenspan - , Otto von Guericke University Magdeburg (Author)
  • Christian Kästner - , University of Marburg (Author)
  • Sven Apel - , University of Passau (Author)
  • Jörg Liebig - , University of Passau (Author)
  • Michael Schulze - , Pure-systems GmbH (Author)
  • Raimund Dachselt - , Otto von Guericke University Magdeburg (Author)
  • Maria Papendieck - , Otto von Guericke University Magdeburg (Author)
  • Thomas Leich - , METOP Mensch-Technik-Organisation-Planung GmbH (Author)
  • Gunter Saake - , Otto von Guericke University Magdeburg (Author)

Abstract

Software-product-line engineering aims at the development of variable and reusable software systems. In practice, software product lines are often implemented with preprocessors. Preprocessor directives are easy to use, and many mature tools are available for practitioners. However, preprocessor directives have been heavily criticized in academia and even referred to as "#ifdef hell", because they introduce threats to program comprehension and correctness. There are many voices that suggest to use other implementation techniques instead, but these voices ignore the fact that a transition from preprocessors to other languages and tools is tedious, erroneous, and expensive in practice. Instead, we and others propose to increase the readability of preprocessor directives by using background colors to highlight source code annotated with ifdef directives. In three controlled experiments with over 70 subjects in total, we evaluate whether and how background colors improve program comprehension in preprocessor-based implementations. Our results demonstrate that background colors have the potential to improve program comprehension, independently of size and programming language of the underlying product. Additionally, we found that subjects generally favor background colors. We integrate these and other findings in a tool called FeatureCommander, which facilitates program comprehension in practice and which can serve as a basis for further research.

Details

Original languageEnglish
Pages (from-to)699-745
Number of pages47
JournalEmpirical Software Engineering
Volume18
Issue number4
Publication statusPublished - Aug 2013
Peer-reviewedYes
Externally publishedYes

External IDs

ORCID /0000-0002-2176-876X/work/174432344

Keywords

ASJC Scopus subject areas

Keywords

  • Empirical software engineering, FeatureCommander, Preprocessors, Program comprehension, Software product lines, Software visualization