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.
翻译:自动软件故障定位通过精确定位故障位置以便于调试,在软件质量保障中扮演重要角色。基于覆盖率的故障定位是一种广泛使用的技术,它利用覆盖谱的统计信息根据可疑度分数对代码进行排序。然而,统计方法的刻板性催生了基于学习的技术。其中,基于图神经网络(GNN)的Grace方法因其能够保留覆盖谱(即测试到源代码的覆盖关系)作为精确的抽象语法增强图表示,缓解了其他基于学习技术压缩特征表示的局限性,从而达到了最先进水平。然而,随着软件及其相关覆盖谱和抽象语法树图的复杂性增加,这种表示在可扩展性方面面临挑战。本文提出了一种新的图表示——DepGraph,通过在代码的图表示中集成过程间调用图,将图表示的节点和边复杂度降低了70%。此外,我们将代码变更信息等额外特征作为属性集成到图中,使模型能够利用丰富的历史项目数据。我们使用Defects4j 2.0.0评估了DepGraph,它在Top-1定位中多发现20%的故障,并将平均首次排名(MFR)和平均平均排名(MAR)提升了超过50%,同时GPU内存使用减少了44%,训练/推理时间减少了85%。此外,在跨项目设置中,DepGraph以Top-1准确率高出42%、MFR和MAR分别提升68%和65%的优势超越了最先进的基线方法。我们的研究证明了DepGraph的鲁棒性,实现了最先进的准确性和可扩展性,为未来的扩展和应用奠定了基础。