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的鲁棒性,为未来扩展与应用提供了当前最优的准确性和可扩展性。