Empirical Software Engineering

, Volume 18, Issue 4, pp 699–745

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

  • Janet Feigenspan
  • Christian Kästner
  • Sven Apel
  • Jörg Liebig
  • Michael Schulze
  • Raimund Dachselt
  • Maria Papendieck
  • Thomas Leich
  • Gunter Saake
Article

DOI: 10.1007/s10664-012-9208-x

Cite this article as:
Feigenspan, J., Kästner, C., Apel, S. et al. Empir Software Eng (2013) 18: 699. doi:10.1007/s10664-012-9208-x

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.

Keywords

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

Copyright information

© Springer Science+Business Media, LLC 2012

Authors and Affiliations

  • Janet Feigenspan
    • 1
  • Christian Kästner
    • 2
  • Sven Apel
    • 3
  • Jörg Liebig
    • 3
  • Michael Schulze
    • 4
  • Raimund Dachselt
    • 1
  • Maria Papendieck
    • 1
  • Thomas Leich
    • 5
  • Gunter Saake
    • 1
  1. 1.School of Computer ScienceUniversity of MagdeburgMagdeburgGermany
  2. 2.Philipps University MarburgMarburgGermany
  3. 3.University of PassauPassauGermany
  4. 4.pure-systemsMagdeburgGermany
  5. 5.Metop Research InstituteMagdeburgGermany

Personalised recommendations