arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2404.04496cs.SE
收藏

通过增强代码表示实现更好的基于图神经网络的故障定位

Towards Better Graph Neural Network-based Fault Localization Through Enhanced Code Representation

Md Nakhla Rafi, Dong Jae Kim, An Ran Chen, Tse-Hsun Chen, Shaowei Wang

AI总结:

本文提出DepGraph图表示,通过集成过程间调用图和代码变更信息降低GNN故障定位的复杂度并提升性能,在Defects4j上显著超越Grace。

摘要:

自动软件故障定位在软件质量保障中发挥着重要作用,它通过精确定位故障位置使调试更加容易。基于覆盖率的故障定位是一种广泛使用的技术,它利用覆盖率谱的统计信息,根据可疑度分数对代码进行排序。然而,统计方法的僵化性促使人们转向基于学习的技术。其中,Grace作为一种基于图神经网络(GNN)的技术,凭借其将覆盖率谱(即测试到源代码的覆盖关系)保留为精确的抽象语法增强图表示的能力,达到了最先进的水平,缓解了其他基于学习的技术压缩特征表示的局限性。然而,由于软件及其相关覆盖率谱和AST图的复杂性不断增加,这种表示在可扩展性方面面临困难。在这项工作中,我们提出了一种新的图表示DepGraph,通过将过程间调用图集成到代码的图表示中,将图表示在节点和边方面的复杂度降低了70%。此外,我们将代码变更信息等额外特征作为属性集成到图中,使模型能够利用丰富的历史项目数据。我们使用Defects4j 2.0.0对DepGraph进行了评估,它在Top-1中多定位了20%的故障,并将平均首次排名(MFR)和平均平均排名(MAR)提高了50%以上,同时将GPU内存使用量降低了44%,训练/推理时间降低了85%。此外,在跨项目设置中,DepGraph以42%更高的Top-1准确率超越了最先进的基线,并在MFR和MAR上分别取得了68%和65%的提升。我们的研究证明了DepGraph的鲁棒性,实现了最先进的准确性和可扩展性,为未来的扩展和采用奠定了基础。

英文摘要:

Automatic software fault localization plays an important role in software quality assurance by pinpointing faulty locations for easier debugging. Coverage-based fault localization, a widely used technique, employs statistics on coverage spectra to rank code based on suspiciousness scores. However, the rigidity of statistical approaches calls for learning-based techniques. Amongst all, Grace, a graph-neural network (GNN) based technique has achieved state-of-the-art due to its capacity to preserve coverage spectra, i.e., test-to-source coverage relationships, as precise abstract syntax-enhanced graph representation, mitigating the limitation of other learning-based technique which compresses the feature representation. However, such representation struggles with scalability due to the increasing complexity of software and associated coverage spectra and AST graphs. In this work, we proposed a new graph representation, DepGraph, that reduces the complexity of the graph representation by 70% in nodes and edges by integrating interprocedural call graph in the graph representation of the code. Moreover, we integrate additional features such as code change information in the graph as attributes so the model can leverage rich historical project data. We evaluate DepGraph using Defects4j 2.0.0, and it outperforms Grace by locating 20% more faults in Top-1 and improving the Mean First Rank (MFR) and the Mean Average Rank (MAR) by over 50% while decreasing GPU memory usage by 44% and training/inference time by 85%. Additionally, in cross-project settings, DepGraph surpasses the state-of-the-art baseline with a 42% higher Top-1 accuracy, and 68% and 65% improvement in MFR and MAR, respectively. Our study demonstrates DepGraph's robustness, achieving state-of-the-art accuracy and scalability for future extension and adoption.

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

↑