A Study on the Effects of Exception Usage in Open-Source C++ Systems

Kirsten Bradley, Michael W. Godfrey
{"title":"A Study on the Effects of Exception Usage in Open-Source C++ Systems","authors":"Kirsten Bradley, Michael W. Godfrey","doi":"10.1109/SCAM.2019.00010","DOIUrl":null,"url":null,"abstract":"Exception handling (EH) is a feature common to many modern programming languages, including C++, Java, and Python, that allows error handling in client code to be performed in a way that is both systematic and largely detached from the implementation of the main functionality. However, C++ developers sometimes choose not to use EH, as they feel that its use increases complexity of the resulting code: new control flow paths are added to the code, \"stack unwinding\" adds extra responsibilities for the developer to worry about, and EH arguably detracts from the modular design of the system. In this paper, we perform an exploratory empirical study of the effects of exceptions usage in 2721 open source C++ systems taken from GitHub. We observed that the number of edges in an augmented call graph increases, on average, by 22% when edges for exception flow are added to a graph. Additionally, about 8 out of 9 functions that may throw only do so by propagating a throw from another function. These results suggest that, in practice, the use of C++ EH can add complexity to the design of the system that developers must strive to be aware of.","PeriodicalId":431316,"journal":{"name":"2019 19th International Working Conference on Source Code Analysis and Manipulation (SCAM)","volume":"15 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-05-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 19th International Working Conference on Source Code Analysis and Manipulation (SCAM)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SCAM.2019.00010","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

Abstract

Exception handling (EH) is a feature common to many modern programming languages, including C++, Java, and Python, that allows error handling in client code to be performed in a way that is both systematic and largely detached from the implementation of the main functionality. However, C++ developers sometimes choose not to use EH, as they feel that its use increases complexity of the resulting code: new control flow paths are added to the code, "stack unwinding" adds extra responsibilities for the developer to worry about, and EH arguably detracts from the modular design of the system. In this paper, we perform an exploratory empirical study of the effects of exceptions usage in 2721 open source C++ systems taken from GitHub. We observed that the number of edges in an augmented call graph increases, on average, by 22% when edges for exception flow are added to a graph. Additionally, about 8 out of 9 functions that may throw only do so by propagating a throw from another function. These results suggest that, in practice, the use of C++ EH can add complexity to the design of the system that developers must strive to be aware of.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
开源c++系统中异常使用的影响研究
异常处理(EH)是许多现代编程语言(包括c++、Java和Python)的共同特性,它允许以一种既系统又在很大程度上脱离主要功能实现的方式执行客户机代码中的错误处理。然而,c++开发人员有时选择不使用EH,因为他们觉得使用EH会增加结果代码的复杂性:新的控制流路径被添加到代码中,“堆栈展开”增加了开发人员需要担心的额外责任,并且EH可能会损害系统的模块化设计。在本文中,我们对取自GitHub的2721个开源c++系统中异常使用的影响进行了探索性实证研究。我们观察到,当将异常流的边添加到图中时,增强调用图中的边数量平均增加了22%。此外,9个可能抛出的函数中有8个只能通过传播另一个函数的抛出来实现。这些结果表明,在实践中,使用c++ EH会增加系统设计的复杂性,这是开发人员必须努力意识到的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
On the Efficacy of Dynamic Behavior Comparison for Judging Functional Equivalence Permission Issues in Open-Source Android Apps: An Exploratory Study Interactive Refactoring Documentation Bot Software Engineering by Source Transformation – Experience with TXL (Most Influential Paper, SCAM 2001) On the Quality of Identifiers in Test Code
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1