arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2201.10137cs.SEcs.LG
收藏

利用Source Code图的结构特性进行即时错误预测

Leveraging Structural Properties of Source Code Graphs for Just-In-Time Bug Prediction

University of Saskatchewan(萨斯喀彻温大学)

Md Nadim, Debajyoti Mondal, Chanchal K. Roy

摘要:

数据可视化最常见的用途是最大限度地减少正确理解的复杂性。图是理解关系数据最常用的表示之一。它产生了一种简化的数据表示,如果以文本格式保存,则很难理解。在这项研究中,我们提出了一种方法来利用源代码的关系属性的形式的图形,以确定在不同版本的软件演化和维护的软件系统中的即时(JIT)错误预测。提出了一种将提交补丁的源代码转换为等价图表示的方法,并将其命名为源代码图(SCG)。为了理解和比较多个源代码图,我们提取了这些图的几个结构属性,如密度,周期数,节点,边缘等,然后我们利用这些SCG的属性值来可视化和检测错误的软件提交。我们处理超过246K的软件提交从12个主题系统在本次调查中。我们对这12个用C++和Java程序设计语言编写的开源软件项目的调查表明,如果我们将SCG的特征与类似研究中使用的传统特征相结合,我们将获得基于机器学习(ML)的错误提交检测模型的性能提高。使用Wilcoxon符号秩检验,我们还发现在预测有缺陷和无缺陷提交时F1分数的增加具有统计学显著性。由于基于SCG的特征值代表了软件系统中源代码更新或更改的风格或结构属性,因此它表明了仔细维护源代码风格或结构以保持软件系统无错误的重要性。

英文摘要:

The most common use of data visualization is to minimize the complexity for proper understanding. A graph is one of the most commonly used representations for understanding relational data. It produces a simplified representation of data that is challenging to comprehend if kept in a textual format. In this study, we propose a methodology to utilize the relational properties of source code in the form of a graph to identify Just-in-Time (JIT) bug prediction in software systems during different revisions of software evolution and maintenance. We presented a method to convert the source codes of commit patches to equivalent graph representations and named it Source Code Graph (SCG). To understand and compare multiple source code graphs, we extracted several structural properties of these graphs, such as the density, number of cycles, nodes, edges, etc. We then utilized the attribute values of those SCGs to visualize and detect buggy software commits. We process more than 246K software commits from 12 subject systems in this investigation. Our investigation on these 12 open-source software projects written in C++ and Java programming languages shows that if we combine the features from SCG with conventional features used in similar studies, we will get the increased performance of Machine Learning (ML) based buggy commit detection models. We also find the increase of F1~Scores in predicting buggy and non-buggy commits statistically significant using the Wilcoxon Signed Rank Test. Since SCG-based feature values represent the style or structural properties of source code updates or changes in the software system, it suggests the importance of careful maintenance of source code style or structure for keeping a software system bug-free.

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

↑