AgentSZZ: 教授LLM代理通过引发缺陷的提交进行调查
AgentSZZ: Teaching the LLM Agent to Play Detective with Bug-Inducing Commits
AI总结:
AgentSZZ通过LLM代理探索仓库并识别缺陷引发提交,结合专用工具、领域知识和ReAct循环,提升跨文件和幽灵提交的召回率,实现F1分数提升27.2%。
摘要:
SZZ算法是识别缺陷引发提交的主要技术,支撑了缺陷预测和漏洞分析等软件工程任务。尽管有众多变体,包括近期基于LLM的方法,其性能在开发者标注数据集上仍有限(例如在Linux内核上召回率为0.552)。关键限制是依赖git blame,它追踪同一文件内的行级更改,在常见场景如幽灵和跨文件情况中失效,使近四分之一的缺陷引发提交本质上不可追踪。此外,当前方法遵循固定流程,限制了迭代推理和探索,不同于开发者通过交互式多工具过程调查缺陷。为解决这些挑战,我们提出AgentSZZ,一个基于代理的框架,利用LLM驱动的代理探索仓库并识别缺陷引发提交。与先前方法不同,AgentSZZ整合了任务专用工具、领域知识和ReAct风格循环,以实现适应性和因果追踪。结构压缩模块进一步提高效率,通过减少冗余上下文同时保留关键证据。在三个广泛使用的数据集上进行的大量实验表明,AgentSZZ在所有设置中均优于最先进的SZZ算法,实现F1分数提升最高达27.2%。改进在跨文件和幽灵提交等挑战性场景中尤为显著,召回率提升最高达300%和60%。消融研究显示,任务专用工具和领域知识是关键,而压缩工具输出将令牌消耗减少超过30%,影响极小。复制包已提供。
英文摘要:
The SZZ algorithm is the dominant technique for identifying bug-inducing commits and underpins many software engineering tasks, such as defect prediction and vulnerability analysis. Despite numerous variants, including recent LLM-based approaches, performance remains limited on developer-annotated datasets (e.g., recall of 0.552 on the Linux kernel). A key limitation is the reliance on git blame, which traces line-level changes within the same file, failing in common scenarios such as ghost and cross-file cases-making nearly one-quarter of bug-inducing commits inherently untraceable. Moreover, current approaches follow fixed pipelines that restrict iterative reasoning and exploration, unlike developers who investigate bugs through an interactive, multi-tool process. To address these challenges, we propose AgentSZZ, an agent-based framework that leverages LLM-driven agents to explore repositories and identify bug-inducing commits. Unlike prior methods, AgentSZZ integrates task-specific tools, domain knowledge, and a ReAct-style loop to enable adaptive and causal tracing of bugs. A structured compression module further improves efficiency by reducing redundant context while preserving key evidence. Extensive experiments on three widely used datasets show that AgentSZZ consistently outperforms state-of-the-art SZZ algorithms across all settings, achieving F1-score gains of up to 27.2% over prior LLM-based approaches. The improvements are especially pronounced in challenging scenarios such as cross-file and ghost commits, with recall gains of up to 300% and 60%, respectively. Ablation studies show that task-specific tools and domain knowledge are critical, while compression tool outputs reduce token consumption by over 30% with negligible impact. The replication package is available.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。