发表机构
Sharif University of Technology(谢里夫理工大学)
机构由 AI 辅助整理,请以论文原文为准。AI 中文总结
针对在线即时缺陷预测忽略项目上下文的问题,提出动态知识图谱KG-Commit,增量维护仓库与代码结构,在11个Apache项目上以CPU推理取得最优Macro-F1、G-Mean和AUC,且延迟稳定。
AI 中文摘要
即时软件缺陷预测(JIT-SDP)旨在当风险提交到达时识别它们,并向开发人员提供及时的反馈。这种对低延迟的需求导致大多数方法依赖提交级别的信息,而忽略了变更发生的更广泛项目上下文。纳入这一上下文具有挑战性,因为它既需要对传入提交进行高效检索,又需要随着代码库的演进进行持续维护。我们引入了KG-Commit,这是一个动态知识图谱,它随着项目的演进增量维护仓库历史、文件内代码结构和提交语义。它还使用AST增量机制来跟踪文件编辑之间的结构变化,并依赖完全在CPU上运行的轻量级图推理。我们在11个Apache软件项目上对六个基线进行的评估表明,使用我们选择的推理流水线,KG-Commit实现了最高的聚合Macro-F1(0.704)、G-Mean(0.706)和AUC(0.809)。在现实的在线协议下,它在所有11个项目上优于LR、HGB、RF和DeepJIT,在10个项目上优于LApredict,在9个项目上优于JITLine(以Macro-F1衡量),且每种情况下的聚合配对差异均显著。KG-Commit处理每个提交大约需要1.33秒,其成本随着图的增长保持稳定,并且与真实世界项目中观察到的提交率兼容。这些发现表明,丰富的项目上下文可以被高效地维护并用于在线JIT-SDP。
英文摘要
Just-in-time software defect prediction (JIT-SDP) aims to identify risky commits as they arrive and provide developers with timely feedback. This need for low latency has led most approaches to rely on commit-level information and overlook the broader project context in which a change occurs. Incorporating this context is challenging because it requires both efficient retrieval for incoming commits and continual maintenance as the repository evolves. We introduce KG-Commit, a dynamic knowledge graph that incrementally maintains repository history, within-file code structure, and commit semantics as the project evolves. It also uses an AST-delta mechanism to track structural changes between file edits and relies on lightweight graph inference running entirely on CPU. Our evaluation on 11 Apache software projects against six baselines shows that KG-Commit achieves the highest aggregate Macro-F1 (0.704), G-Mean (0.706), and AUC (0.809) using our selected inference pipeline. Under a realistic online protocol, it outperforms LR, HGB, RF, and DeepJIT on all 11 projects, LApredict on 10, and JITLine on 9 projects in Macro-F1, with the aggregate paired difference significant in every case. KG-Commit processes each commit in approximately 1.33~s, with a cost that remains stable as the graph grows and is compatible with commit rates observed in real-world projects. These findings show that rich project context can be efficiently maintained and exploited for online JIT-SDP.