The Community for Technology Leaders
2017 IEEE/ACM 25th International Conference on Program Comprehension (ICPC) (2017)
Buenos Aires, Argentina
May 22, 2017 to May 23, 2017
ISBN: 978-1-5386-0535-6
pp: 297-307
The C preprocessor is a simple, effective, and language-independent tool. Developers use the preprocessor in practice to deal with portability and variability issues. Despite the widespread usage, the C preprocessor suffers from severe criticism, such as negative effects on code understandability and maintainability. In particular, these problems may get worse when using undisciplined annotations, i.e., when a preprocessor directive encompasses only parts of C syntactical units. Nevertheless, despite the criticism and guidelines found in systems like Linux to avoid undisciplined annotations, the results of a previous controlled experiment indicated that the discipline of annotations has no influence on program comprehension and maintenance. To better understand whether developers care about the discipline of preprocessor-based annotations and whether they can really influence on maintenance tasks, in this paper we conduct a mixed-method research involving two studies. In the first one, we identify undisciplined annotations in 110 open-source C/C++ systems of different domains, sizes, and popularity GitHub metrics. We then refactor the identified undisciplined annotations to make them disciplined. Right away, we submit pull requests with our code changes. Our results show that almost two thirds of our pull requests have been accepted and are now merged. In the second study, we conduct a controlled experiment. We have several differences with respect to the aforementioned one, such as blocking of cofounding effects and more replicas. We have evidences that maintaining undisciplined annotations is more time consuming and error prone, representing a different result when compared to the previous experiment. Overall, we conclude that undisciplined annotations should not be neglected.
Romero Malaquias, Marcio Ribeiro, Rodrigo Bonifacio, Eduardo Monteiro, Flavio Medeiros, Alessandro Garcia, Rohit Gheyi, "The Discipline of Preprocessor-Based Annotations - Does #ifdef TAG n't #endif Matter", 2017 IEEE/ACM 25th International Conference on Program Comprehension (ICPC), vol. 00, no. , pp. 297-307, 2017, doi:10.1109/ICPC.2017.41
84 ms
(Ver 3.3 (11022016))