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故障定位中比Grace多定位20%的故障,并将平均首次排名(MFR)和平均平均排名(MAR)改善超过50%,同时GPU内存使用减少44%,训练/推理时间减少85%。此外,在跨项目设置中,DepGraph超越了最先进的基线,Top-1准确率提高42%,MFR和MAR分别改善68%和65%。我们的研究展示了DepGraph的鲁棒性,实现了最先进的准确性和可扩展性,为未来的扩展和应用奠定了基础。