Software is increasingly written by AI agents that produce an implementation from a natural language specification, a practice known as agentic coding. Code is now produced faster than it can be reviewed, and has been shown to exhibit its own characteristic failure patterns. Property-based testing (PBT), a long-standing technique in which invariant properties of a program are checked against many generated inputs, has recently been revisited with LLM agents authoring the properties, thereby removing the high-effort derivation of invariants that has long hindered its adoption. Existing methods, however, derive these properties from the implementation alone (Code-driven PBT). At the same time, a thorough specification such as a product requirements document has become routine within agentic coding, yet its role in testing the resulting code remains underexplored. We study the value of the specification as a source of properties for testing agent-written code. Our key insight is that the specification, unlike the implementation, records what the code was meant to do, and invariants derived from it are not biased by particular implementation choices. We propose Spec-Driven PBT, an agent that first expresses invariants in natural language from the specification and only then inspects the implementation to translate them into concrete tests. Across 25 applications from ViBench, Spec-Driven PBT finds a novel set of bugs that Code-driven PBT misses, while writing 2.4x fewer property tests. Though the two approaches surface a roughly equivalent number of bugs, there is little overlap: nearly 60% of the 169 total bugs are found by only one. Qualitatively, we find that the bugs unique to Spec-Driven PBT tend to violate documented product workflows whereas those to Code-driven PBT instead concentrate on implementation robustness, offering complementary value for bug discovery in agent-written code.


翻译:暂无翻译

0
下载
关闭预览

相关内容

综述 | 终端智能体:命令行环境中的 AI Agents
专知会员服务
12+阅读 · 8月24日
综述 | Self-Evolving Coding Agents:自进化编程智能体
《软件定义网络元素与机器代码的形式化验证》
专知会员服务
14+阅读 · 2025年11月18日
【新书】使用生成式人工智能进行软件测试
专知会员服务
46+阅读 · 2025年1月6日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
NLP-Progress记录NLP最新数据集、论文和代码: 助你紧跟NLP前沿
中国人工智能学会
12+阅读 · 2018年11月15日
《pyramid Attention Network for Semantic Segmentation》
统计学习与视觉计算组
44+阅读 · 2018年8月30日
手把手教 | 深度学习库PyTorch(附代码)
数据派THU
27+阅读 · 2018年3月15日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
47+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
VIP会员
最新内容
《美空军2026条令文件:对海压制作战》
专知会员服务
22+阅读 · 11月9日
人工智能与战争的未来
专知会员服务
9+阅读 · 11月8日
《Agent Mosaic:识别智能体LLM系统中的机密泄露》
专知会员服务
10+阅读 · 11月8日
人工智能在军事教育中的应用:若干视角与经验
专知会员服务
11+阅读 · 11月6日
“星链”减速与不断适应的乌克兰
专知会员服务
9+阅读 · 11月6日
美国中期选举之后:帕兰提尔面临不确定性?
专知会员服务
6+阅读 · 11月6日
相关资讯
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
47+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员