How preprocessor annotations (do not) affect maintainability: a case study on change-proneness

W. Fenske, Sandro Schulze, G. Saake
{"title":"How preprocessor annotations (do not) affect maintainability: a case study on change-proneness","authors":"W. Fenske, Sandro Schulze, G. Saake","doi":"10.1145/3136040.3136059","DOIUrl":null,"url":null,"abstract":"Preprocessor annotations (e.g., #ifdef in C) enable the development of similar, but distinct software variants from a common code base. One particularly popular preprocessor is the C preprocessor, cpp. But the cpp is also widely criticized for impeding software maintenance by making code hard to understand and change. Yet, evidence to support this criticism is scarce. In this paper, we investigate the relation between cpp usage and maintenance effort, which we approximate with the frequency and extent of source code changes. To this end, we mined the version control repositories of eight open- source systems written in C. For each system, we measured if and how individual functions use cpp annotations and how they were changed. We found that functions containing cpp annotations are generally changed more frequently and more profoundly than other functions. However, when accounting for function size, the differences disappear or are greatly diminished. In summary, with respect to the frequency and extent of changes, our findings do not support the criticism of the cpp regarding maintainability.","PeriodicalId":398999,"journal":{"name":"Proceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences","volume":"56 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-10-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"12","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3136040.3136059","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 12

Abstract

Preprocessor annotations (e.g., #ifdef in C) enable the development of similar, but distinct software variants from a common code base. One particularly popular preprocessor is the C preprocessor, cpp. But the cpp is also widely criticized for impeding software maintenance by making code hard to understand and change. Yet, evidence to support this criticism is scarce. In this paper, we investigate the relation between cpp usage and maintenance effort, which we approximate with the frequency and extent of source code changes. To this end, we mined the version control repositories of eight open- source systems written in C. For each system, we measured if and how individual functions use cpp annotations and how they were changed. We found that functions containing cpp annotations are generally changed more frequently and more profoundly than other functions. However, when accounting for function size, the differences disappear or are greatly diminished. In summary, with respect to the frequency and extent of changes, our findings do not support the criticism of the cpp regarding maintainability.
预处理器注释(不)如何影响可维护性:一个关于易变性的案例研究
预处理器注释(例如,C中的#ifdef)允许从通用代码库开发类似但不同的软件变体。一个特别流行的预处理器是C预处理器cpp。但cpp也因其使代码难以理解和更改而阻碍了软件维护而受到广泛批评。然而,支持这种批评的证据很少。在本文中,我们研究了cpp使用和维护工作量之间的关系,我们将其近似为源代码更改的频率和范围。为此,我们挖掘了八个用c语言编写的开源系统的版本控制库。对于每个系统,我们测量了单个函数是否以及如何使用cpp注释,以及它们是如何被更改的。我们发现包含cpp注释的函数通常比其他函数更改得更频繁、更深刻。然而,当考虑函数大小时,差异消失或大大减少。总之,关于变化的频率和程度,我们的发现不支持对cpp关于可维护性的批评。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信