将缺失的方法调用检测为对多数规则的违反
Detecting Missing Method Calls as Violations of the Majority Rule
AI总结:
针对面向对象框架使用中易遗漏必要方法调用的问题,提出基于多数规则的检测系统,通过相似代码段的调用情况判断缺失调用,可发现更多缺失调用及多种代码坏味道。
摘要:
在使用面向对象框架时,人们很容易忽略代码中特定位置所需的某些重要方法调用。本文从缺陷仓库中缺失方法调用的踪迹入手,针对这一问题提供了一套全面的实证事实。我们提出了一种新系统,该系统基于可观测到的其他方法调用,在软件中搜索缺失的方法调用。我们的核心洞见是,投票理论中的多数规则概念适用于方法调用:如果在大多数相似代码段中都存在某一调用,那么(缺少该调用的代码中)该调用很可能是缺失的。评估结果表明,该系统的预测能进一步发现缺失的方法调用,还往往能揭示不同类型的代码坏味道(例如违反API最佳实践的情况)。
英文摘要:
When using object-oriented frameworks it is easy to overlook certain important method calls that are required at particular places in code. In this paper, we provide a comprehensive set of empirical facts on this problem, starting from traces of missing method calls in a bug repository. We propose a new system that searches for missing method calls in software based on the other method calls that are observable. Our key insight is that the voting theory concept of majority rule holds for method calls: a call is likely to be missing if there is a majority of similar pieces of code where this call is present. The evaluation shows that the system predictions go further missing method calls and often reveal different kinds of code smells (e.g. violations of API best practices).
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。