Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1109/ICPC.2017.41acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

The discipline of preprocessor-based annotations does #ifdef TAG n't #endif matter

Published: 20 May 2017 Publication History

Abstract

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.

References

[1]
H. Spencer and G. Collyer, "Ifdef considered harmful, or portability experience with C news," in Proceedings of the USENIX Annual Technical Conference. USENIX Association, 1992, pp. 185--197.
[2]
I. Baxter, "Design maintenance systems," Communication of the ACM, vol. 35, no. 4, pp. 73--89, 1992.
[3]
F. Medeiros, C. Kästner, M. Ribeiro, S. Nadi, and R. Gheyi, "The love/hate relationship with the C preprocessor: An interview study," in Proceedings of the 29th European Conference on Object-Oriented Programming (ECOOP). Schloss Dagstuhl, 2015, pp. 999--1022.
[4]
J. Liebig, C. Kästner, and S. Apel, "Analyzing the discipline of preprocessor annotations in 30 million lines of C code," in Proceedings of the 10th International Conference on Aspect-Oriented Software Development (AOSD). ACM, 2011, pp. 191--202.
[5]
S. Schulze, J. Liebig, J. Siegmund, and S. Apel, "Does the discipline of preprocessor annotations matter?: A controlled experiment," in Proceedings of 12th International Conference on Generative Programming: Concepts and Experiences (GPCE), 2013, pp. 65--74.
[6]
I. Baxter and M. Mehlich, "Preprocessor conditional removal by simple partial evaluation," in Proceedings of the 8th Working Conference on Reverse Engineering (WCRE). IEEE, 2001, pp. 281--290.
[7]
M. Ernst, G. Badros, and D. Notkin, "An empirical analysis of C preprocessor use," IEEE Transactions on Software Engineering, vol. 28, no. 12, pp. 1146--1170, 2002.
[8]
K. Narasimhan and C. Reichenbach, "Copy and paste redeemed (T)," in International Conference on Automated Software Engineering. IEEE/ACM, 2015, pp. 630--640.
[9]
F. Medeiros, M. Ribeiro, R. Gheyi, S. Apel, C. Kästner, B. Ferreira, L. Carvalho, and B. Fonseca, "Discipline matters: Refactoring of preprocessor directives in the #ifdef hell," IEEE Transactions on Software Engineering, 2017, To appear.
[10]
J. Antony, Design of experiments for engineers and scientists. Elsevier, 2014.
[11]
F. Medeiros, M. Ribeiro, and R. Gheyi, "Investigating preprocessor-based syntax errors," in Proceedings of the 12th International Conference on Generative Programming: Concepts & Experiences (GPCE). ACM, 2013, pp. 75--84.
[12]
C. Kästner and S. Apel, "Virtual separation of concerns - a second chance for preprocessors," Journal of Object Technology (JOT), vol. 8, no. 6, 2009.
[13]
M. Ribeiro, P. Borba, and C. Kästner, "Feature maintenance with emergent interfaces," in Proceedings of the 36th International Conference on Software Engineering (ICSE), 2014, pp. 989--1000.
[14]
F. Medeiros, I. Rodrigues, M. Ribeiro, L. Teixeira, and R. Gheyi, "An empirical study on configuration-related issues: Investigating undeclared and unused identifiers," in Proceedings of the 14th International Conference on Generative Programming: Concepts & Experiences (GPCE). ACM, 2015, pp. 35--44.
[15]
L. Braz, R. Gheyi, M. Mongiovi, M. Ribeiro, F. Medeiros, and L. Teixeira, "a change-centric approach to compile configurable systems with #ifdefs," in Proceedings of 15th International Conference on Generative Programming: Concepts and Experiences (GPCE). ACM, 2016, pp. 109--119.
[16]
J. Liebig, S. Apel, C. Lengauer, C. Kästner, and M. Schulze, "An analysis of the variability in forty preprocessor-based software product lines," in Proceedings of the 32nd International Conference on Software Engineering (ICSE). ACM, 2010, pp. 105--114.
[17]
A. Garrido and R. Johnson, "Analyzing multiple configurations of a C program," in Proceedings of the 21st International Conference on Software Maintenance (ICSM). IEEE, 2005, pp. 379--388.
[18]
A. Garrido and R. E. Johnson, "Embracing the C preprocessor during refactoring," Journal of Software: Evolution and Process, vol. 25, no. 12, pp. 1285--1304, 2013.
[19]
F. Medeiros, M. Ribeiro, R. Gheyi, and B. Fonseca, "A catalogue of refactorings to remove incomplete annotations," Journal of Universal Computer Science, vol. 20, no. 5, pp. 746--771, 2014.
[20]
G. E. P. Box, J. S. Hunter, and W. G. Hunter, Statistics for Experimenters: Design, innovation, and discovery. Wiley-Interscience, 2005.
[21]
D. C. Montgomery, Design and Analysis of Experiments. John Wiley & Sons, 2006.
[22]
E. A. Pena and E. H. Slate, "Global validation of linear model assumptions," Journal of the American Statistical Association, vol. 101, no. 473, pp. 341--354, 2006.
[23]
C. Wohlin, P. Runeson, M. Höst, M. C. Ohlsson, B. Regnell, and A. Wesslén, Experimentation in software engineering. Springer Science & Business Media, 2012.
[24]
J. Siegmund, N. Siegmund, and S. Apel, "Views on internal and external validity in empirical software engineering," in Proceedings of the 37th International Conference on Software Engineering (ICSE). IEEE Press, 2015, pp. 9--19.
[25]
D. I. Sjoberg, B. Anda, E. Arisholm, T. Dyba, M. Jorgensen, A. Kara-hasanovic, E. F. Koren, and M. Vokác, "Conducting realistic experiments in software engineering," in Proceedings of the 1st International Symposium on Empirical Software Engineering (ISESE). IEEE, 2002, pp. 17--26.
[26]
M. Höst, B. Regnell, and C. Wohlin, "Using students as subjectsa comparative study of students and professionals in lead-time impact assessment," Empirical Software Engineering, vol. 5, no. 3, pp. 201-- 214, 2000.
[27]
A. Garrido and R. Johnson, "Refactoring C with conditional compilation," in Proceedings of the 18th International Conference on Automated Software Engineering (ASE). IEEE, 2003, pp. 323--326.
[28]
C. Kästner, P. Giarrusso, T. Rendel, S. Erdweg, K. Ostermann, and T. Berger, "Variability-aware parsing in the presence of lexical macros and conditional compilation," in Proceedings of the Object-Oriented Programming Systems Languages and Applications (OOPSLA). ACM, 2011, pp. 805--824.
[29]
A. Garrido and R. Johnson, "Challenges of refactoring C programs," in Proceedings of International Workshop on Principles of Software Evolution. ACM, 2002, pp. 6--14.
[30]
Y. Padioleau, "Parsing C/C++ code without pre-processing," in Compiler Construction. Springer, 2009, pp. 109--125.
[31]
M. Platoff, M. Wagner, and J. Camaratta, "An integrated program representation and toolkit for the maintenance of C programs," in Proceedings of the International Conference on Software Maintenance (ICSM). IEEE, 1991, pp. 129--137.
[32]
I. Abal, C. Brabrand, and A. Wasowski, "42 variability bugs in the linux kernel: A qualitative analysis," in Proceedings of 29th International Conference on Automated Software Engineering (ASE). IEEE/ACM, 2014, pp. 421--432.
[33]
B. J. Garvin and M. B. Cohen, "Feature interaction faults revisited: An exploratory study," in Proceeding of the 22nd International Symposium on Software Reliability Engineering (ISSRE). IEEE, 2011, pp. 90--99.
[34]
D. R. Kuhn, D. R. Wallace, and A. M. Gallo, Jr., "Software fault interactions and implications for software testing," IEEE Transactions on Software Engineering, vol. 30, no. 6, 2004.
[35]
R. Tartler, C. Dietrich, J. Sincero, W. Schröder-Preikschat, and D. Lohmann, "Static analysis of variability in system software: The 90,000 #ifdefs issue," in Proceedings of the 2014 USENIX Conference on USENIX Annual Technical Conference. USENIX Association, 2014, pp. 421--432.

Cited By

View all
  • (2023)An Experiment on How Feature Dependent Variables Affect Configurable System ComprehensibilityProceedings of the 17th Brazilian Symposium on Software Components, Architectures, and Reuse10.1145/3622748.3622755(61-70)Online publication date: 25-Sep-2023
  • (2021)Feature trace recordingProceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3468264.3468531(1007-1020)Online publication date: 20-Aug-2021
  • (2020)Atoms of ConfusionProceedings of the XXXIV Brazilian Symposium on Software Engineering10.1145/3422392.3422437(243-252)Online publication date: 21-Oct-2020
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICPC '17: Proceedings of the 25th International Conference on Program Comprehension
May 2017
399 pages
ISBN:9781538605356

Sponsors

Publisher

IEEE Press

Publication History

Published: 20 May 2017

Check for updates

Qualifiers

  • Research-article

Conference

ICSE '17
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)1
Reflects downloads up to 13 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2023)An Experiment on How Feature Dependent Variables Affect Configurable System ComprehensibilityProceedings of the 17th Brazilian Symposium on Software Components, Architectures, and Reuse10.1145/3622748.3622755(61-70)Online publication date: 25-Sep-2023
  • (2021)Feature trace recordingProceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3468264.3468531(1007-1020)Online publication date: 20-Aug-2021
  • (2020)Atoms of ConfusionProceedings of the XXXIV Brazilian Symposium on Software Engineering10.1145/3422392.3422437(243-252)Online publication date: 21-Oct-2020
  • (2019)On the Evolution of Feature DependenciesProceedings of the 13th International Workshop on Variability Modelling of Software-Intensive Systems10.1145/3302333.3302342(1-9)Online publication date: 6-Feb-2019
  • (2019)An investigation of misunderstanding code patterns in C open-source software projectsEmpirical Software Engineering10.1007/s10664-018-9666-x24:4(1693-1726)Online publication date: 1-Aug-2019
  • (2019)Comparing the influence of using feature-oriented programming and conditional compilation on comprehending feature-oriented softwareEmpirical Software Engineering10.1007/s10664-018-9658-x24:3(1226-1258)Online publication date: 1-Jun-2019
  • (2018)Using code quality features to predict bugs in procedural software systemsProceedings of the XXXII Brazilian Symposium on Software Engineering10.1145/3266237.3266271(122-131)Online publication date: 17-Sep-2018
  • (2018)"I know it when I see it" Perceptions of Code QualityProceedings of the 2017 ITiCSE Conference on Working Group Reports10.1145/3174781.3174785(70-85)Online publication date: 30-Jan-2018
  • (2017)How preprocessor annotations (do not) affect maintainability: a case study on change-pronenessACM SIGPLAN Notices10.1145/3170492.313605952:12(77-90)Online publication date: 23-Oct-2017
  • (2017)How preprocessor annotations (do not) affect maintainability: a case study on change-pronenessProceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/3136040.3136059(77-90)Online publication date: 23-Oct-2017
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media