论文标题
对涉及动态语言特征的单个语句错误的研究
A Study of Single Statement Bugs Involving Dynamic Language Features
论文作者
论文摘要
动态语言功能在编程语言中广泛使用,以实现可以适应多个用法上下文的功能,从而可以重用。诸如数据绑定,对象关联映射和用户界面构建器之类的功能可以在很大程度上取决于这些功能。但是,它们的使用具有风险和缺点,因为它们会影响依赖此类分析的静态分析和技术的健全性(例如错误检测和自动化程序维修)。由于可能在理解反射代码,编译时安全性丢失和不正确的API使用方面存在潜在的困难,因此它们还可以使软件更容易出错。在本文中,我们着手量化Java程序中使用动态语言功能的某些效果,也就是说,使用这些功能相对于特定类型的错误称为单个语句错误的错误 - 主持性。通过挖掘2,024个GitHub项目,我们发现了139个单语句错误实例(落在10个不同的错误模式下),其中最多的错误属于三个特定模式:错误的函数名称,相同的功能更多的ARGS和使用的更改标识符。这些结果可以帮助从业人员量化使用动态技术而不是替代方案(例如代码生成)的风险。我们希望这种分类能够注意选择可能容易出错的动态API,并为开发人员在为此类功能设计错误检测工具时提供更好的理解。
Dynamic language features are widely available in programming languages to implement functionality that can adapt to multiple usage contexts, enabling reuse. Functionality such as data binding , object-relational mapping and user interface builders can be heavily dependent on these features. However, their use has risks and downsides as they affect the soundness of static analyses and techniques that rely on such analyses (such as bug detection and automated program repair). They can also make software more error-prone due to potential difficulties in understanding reflective code, loss of compile-time safety and incorrect API usage. In this paper, we set out to quantify some of the effects of using dynamic language features in Java programs-that is, the error-proneness of using those features with respect to a particular type of bug known as single statement bugs. By mining 2,024 GitHub projects, we found 139 single statement bug instances (falling under 10 different bug patterns), with the highest number of bugs belonging to three specific patterns: Wrong Function Name, Same Function More Args and Change Identifier Used. These results can help practitioners to quantify the risk of using dynamic techniques over alternatives (such as code generation). We hope this classification raises attention on choosing dynamic APIs that are likely to be error-prone, and provides developers a better understanding when designing bug detection tools for such feature.