Publication | Closed Access
The Discipline of Preprocessor-Based Annotations - Does #ifdef TAG n't #endif Matter
30
Citations
30
References
2017
Year
Unknown Venue
Software MaintenanceEngineeringPreprocessor-based AnnotationsSoftware EngineeringSource Code AnalysisAnnotation ServiceSemanticsSoftware AnalysisFormal VerificationEndif MatterComputational LinguisticsLanguage StudiesFormal SpecificationLinguisticsC PreprocessorComputer ScienceStatic Program AnalysisSoftware DesignCode RefactoringAnnotation ToolProgram AnalysisSoftware TestingProgram ComprehensionFormal MethodsPreprocessor DirectiveSystem SoftwareSoftware Language EngineeringComputational Semantics
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.
| Year | Citations | |
|---|---|---|
Page 1
Page 1