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的鲁棒性,在精确度与可扩展性方面均达到当前最优水平,具备广阔的扩展应用前景。