arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv 2604.03362cs.SE
收藏

ABTest:面向AI编码代理的行为驱动测试

ABTest: Behavior-Driven Testing for AI Coding Agents

York University(约克大学);Polytechnique Montreal(蒙特利尔高等工程学院);Concordia University(康考迪亚大学)

Wuyang Dai, Moses Openja, Hung Viet Pham, Gias Uddin, Jinqiu Yang, Song Wang

AI总结:

本文提出ABTest框架,通过挖掘用户报告的异常生成可执行测试用例,发现AI编码代理在真实场景中的鲁棒性差异及新故障模式。

摘要:

AI编码代理日益融入真实软件开发流程,但其在多样且对抗性场景下的鲁棒性仍缺乏深入理解。本文提出ABTest,一种基于行为的模糊测试框架,通过将真实世界失败报告转化为仓库导向的行为测试。ABTest(1)挖掘用户报告的异常以推导可重用的工作流模式(交互模式)和行为(动作类型);(2)将它们组成分步模糊测试模板;(3)在真实仓库中实例化可执行测试用例;(4)用编码代理执行并记录轨迹和工件;(5)检测并验证异常行为。我们应用ABTest于三个广泛使用的编码代理:Claude Code、OpenAI Codex CLI和Gemini CLI。从400个用户报告的开发者确认的代理失败中,提取出47个交互模式和128种动作类型,生成647个仓库导向的模糊测试用例。执行647个用例一次每种评估配置,ABTest在三个编码代理家族中发现1,573个行为异常,其中642个经人工确认为新的真实异常,检测精度达40.8%。我们的结果表明,ABTest能有效发现真实世界中的失败,揭示模型间的鲁棒性差异,并揭示此前未报告的故障模式。

英文摘要:

AI coding agents are increasingly integrated into real-world software development workflows, yet their robustness under diverse and adversarial scenarios remains poorly understood. We present ABTest, a behavior-driven fuzzing framework that systematically tests coding agents by turning real-world failure reports into repository-grounded behavioral tests. ABTest (1) mines user-reported anomalies to derive reusable workflow patterns (Interaction Patterns) and behaviors (Action types); (2) composes them into stepwise fuzzing templates; (3) instantiates executable test cases in real repositories; (4) executes them with coding agents while recording traces and artifacts; and (5) detects and validates anomalous behaviors. We apply ABTest to three widely used coding agents: Claude Code, OpenAI Codex CLI, and Gemini CLI. From 400 user-reported developer-confirmed agent failures, we extract 47 Interaction Patterns and 128 Action types, generating 647 repository-grounded fuzzing cases. Executing the 647-case bundle once per evaluated configuration, ABTest flags 1,573 behavioral anomalies across the three coding agent families, of which 642 are manually confirmed as new true anomalies, achieving a detection precision of 40.8%. Our results demonstrate that ABTest effectively uncovers real-world failures, exposes robustness differences across models, and reveals previously unreported failure modes.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑