Can we refactor conditional compilation into aspects?

  • Authors:
  • Bram Adams;Wolfgang De Meuter;Herman Tromp;Ahmed E. Hassan

  • Affiliations:
  • Queen's University, Kingston, ON, Canada;Vrije Universiteit Brussel, Brussels, Belgium;Ghent University, Ghent, Belgium;Queen's University, Kingston, ON, Canada

  • Venue:
  • Proceedings of the 8th ACM international conference on Aspect-oriented software development
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Systems software uses conditional compilation to manage crosscutting concerns in a very fine-grained and efficient way, but at the expense of tangled and scattered conditional code. Refactoring of conditional compilation into aspects gets rid of these issues, but it is not clear yet for which patterns of conditional compilation aspects make sense and whether or not current aspect technology is able to express these patterns. To investigate these two problems, this paper presents a graphical ``preprocessor blueprint'' model which offers a queryable representation of the syntactical interaction of conditional compilation and the source code. A case study on the Parrot VM shows that preprocessor blueprints are able to express and query for the four commonly known patterns of conditional compilation usage, and that they allow to discover seven additional important patterns. By correlating each pattern's potential for refactoring into advice and each pattern's evolution of the number of occurrences, we show that refactoring into advice in the Parrot VM is a good alternative for three of the eleven patterns, whereas for the other patterns trade-offs have to be considered between robustness and fine-grainedness of the advice.