arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2206.12927cs.SE
收藏

基于源代码度量与静态分析的缺陷严重程度估计实证研究

An Empirical Study on Bug Severity Estimation using Source Code Metrics and Static Analysis

Ehsan Mashhadi, Shaiful Chowdhury, Somayeh Modaberi, Hadi Hemmati, Gias Uddin

AI总结:

本文基于Defects4J和Bugs.jar数据集,实证评估10种源代码度量与SpotBugs、Infer静态分析工具在缺陷及其严重程度预测上的能力,发现两者均难以估计严重程度,并分析了原因与未来方向。

摘要:

在过去二十年间,大量研究工作致力于软件缺陷(即 bug)的预测。总体而言,这些工作利用多样化的度量指标、工具和技术来预测哪些类、方法、代码行或提交存在缺陷。然而,该领域现有的大部分工作将所有缺陷一视同仁,而这在实际中并非如此。缺陷越严重,其后果越大。因此,缺陷预测方法有必要估计所识别缺陷的严重程度,以便严重程度较高的缺陷能够得到即时关注。本文基于两个常用数据集(Defects4J 和 Bugs.jar),使用 10 种常见源代码度量指标以及两个常用静态分析工具(SpotBugs 和 Infer),对它们预测缺陷及其严重程度的能力进行了定量和定性研究。我们研究了来自 19 个 Java 开源项目中带有不同严重程度标签的 3,358 个有缺陷方法。结果表明,尽管代码度量指标在预测有缺陷代码方面是有用的(代码行数、可维护性指数、扇出和 Effort 度量表现最佳),但它们无法估计缺陷的严重程度级别。此外,我们观察到静态分析工具在预测缺陷(F1 分数范围为 3.1%–7.1%)及其严重程度标签(F1 分数低于 2%)方面表现均较弱。我们还人工研究了严重缺陷的特征,以找出代码度量指标和静态分析工具在估计其严重程度方面表现不佳的可能原因。同时,我们的分类显示,安全类缺陷在大多数情况下具有高严重程度,而边界/边缘故障具有低严重程度。最后,我们讨论了这些结果的实际意义,并为未来研究提出了新的方向。

英文摘要:

In the past couple of decades, significant research efforts have been devoted to the prediction of software bugs (i.e., defects). In general, these works leverage a diverse set of metrics, tools, and techniques to predict which classes, methods, lines, or commits are buggy. However, most existing work in this domain treats all bugs the same, which is not the case in practice. The more severe the bugs the higher their consequences. Therefore, it is important for a defect prediction method to estimate the severity of the identified bugs, so that the higher severity ones get immediate attention. In this paper, we provide a quantitative and qualitative study on two popular datasets (Defects4J and Bugs.jar), using 10 common source code metrics, and two popular static analysis tools (SpotBugs and Infer) for analyzing their capability to predict defects and their severity. We studied 3,358 buggy methods with different severity labels from 19 Java open-source projects. Results show that although code metrics are useful in predicting buggy code (Lines of the Code, Maintainable Index, FanOut, and Effort metrics are the best), they cannot estimate the severity level of the bugs. In addition, we observed that static analysis tools have weak performance in both predicting bugs (F1 score range of 3.1%-7.1%) and their severity label (F1 score under 2%). We also manually studied the characteristics of the severe bugs to identify possible reasons behind the weak performance of code metrics and static analysis tools in estimating their severity. Also, our categorization shows that Security bugs have high severity in most cases while Edge/Boundary faults have low severity. Finally, we discuss the practical implications of the results and propose new directions for future research.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑