Does the discipline of preprocessor annotations matter?: a controlled experiment

  • Authors:
  • Sandro Schulze;Jörg Liebig;Janet Siegmund;Sven Apel

  • Affiliations:
  • Technische Universität Braunschweig, Braunschweig, Germany;Universität Passau, Passau, Germany;Universität Passau, Passau, Germany;Universität Passau, Passau, Germany

  • Venue:
  • Proceedings of the 12th international conference on Generative programming: concepts & experiences
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

The C preprocessor (CPP) is a simple and language-independent tool, widely used to implement variable software systems using conditional compilation (i.e., by including or excluding annotated code). Although CPP provides powerful means to express variability, it has been criticized for allowing arbitrary annotations that break the underlying structure of the source code. We distinguish between disciplined annotations, which align with the structure of the source code, and undisciplined annotations, which do not. Several studies suggest that especially the latter type of annotations makes it hard to (automatically) analyze the code. However, little is known about whether the type of annotations has an effect on program comprehension. We address this issue by means of a controlled experiment with human subjects. We designed similar tasks for both, disciplined and undisciplined annotations, to measure program comprehension. Then, we measured the performance of the subjects regarding correctness and response time for solving the tasks. Our results suggest that there are no differences between disciplined and undisciplined annotations from a program-comprehension perspective. Nevertheless, we observed that finding and correcting errors is a time-consuming and tedious task in the presence of preprocessor annotations.