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以42%的Top-1精度提升、68%的MFR与65%的MAR改进超越当前最优基线。本研究证明了DepGraph的鲁棒性,为未来扩展与应用提供了当前最优的精度与可扩展性。