Coverage-guided fuzzing has proven effective for software testing, but targeting library code requires specialized fuzz harnesses that translate fuzzer-generated inputs into valid API invocations. Manual harness creation is time-consuming and requires deep understanding of API semantics, initialization sequences, and exception handling contracts. We present a multi-agent architecture that automates fuzz harness generation for Java libraries through specialized LLM-powered agents. Five ReAct agents decompose the workflow into research, synthesis, compilation repair, coverage analysis, and refinement. Rather than preprocessing entire codebases, agents query documentation, source code, and callgraph information on demand through the Model Context Protocol, maintaining focused context while exploring complex dependencies. To enable effective refinement, we introduce method-targeted coverage that tracks coverage only during target method execution to isolate target behavior, and agent-guided termination that examines uncovered source code to distinguish productive refinement opportunities from diminishing returns. We evaluated our approach on seven target methods from six widely-deployed Java libraries totaling 115,000+ Maven dependents. Our generated harnesses achieve a median 26\% improvement over OSS-Fuzz baselines and outperform Jazzer AutoFuzz by 5\% in package-scope coverage. Generation costs average \$3.20 and 10 minutes per harness, making the approach practical for continuous fuzzing workflows. During a 12-hour fuzzing campaign, our generated harnesses discovered 3 bugs in projects that are already integrated into OSS-Fuzz, demonstrating the effectiveness of the generated harnesses.


翻译:覆盖率引导的模糊测试已被证明对软件测试有效,但针对库代码测试需要专门的模糊测试工具,以将模糊测试生成的输入转换为有效的API调用。手动创建测试工具耗时且需要深入理解API语义、初始化序列和异常处理约定。本文提出一种多智能体架构,通过专门的基于大语言模型的智能体自动生成Java库的模糊测试工具。五个ReAct智能体将工作流分解为研究、综合、编译修复、覆盖率分析和优化阶段。智能体通过模型上下文协议按需查询文档、源代码和调用图信息,而非预处理整个代码库,在探索复杂依赖关系的同时保持聚焦的上下文。为实现有效优化,我们引入了方法定向覆盖率机制——仅在目标方法执行期间跟踪覆盖率以隔离目标行为,以及智能体引导的终止机制——通过检查未覆盖的源代码来区分有效的优化机会与收益递减的情况。我们在六个广泛部署的Java库中的七个目标方法上评估了该方法,这些库总计拥有超过115,000个Maven依赖项。生成的测试工具相比OSS-Fuzz基线实现了26%的中位数覆盖率提升,在包范围覆盖率上优于Jazzer AutoFuzz 5%。每个测试工具的平均生成成本为3.20美元和10分钟,使得该方法适用于持续模糊测试工作流。在12小时的模糊测试活动中,生成的测试工具在已集成至OSS-Fuzz的项目中发现了3个错误,证明了所生成测试工具的有效性。

0
下载
关闭预览

相关内容

智能体工程(Agent Engineering)
专知会员服务
33+阅读 · 2025年12月31日
【新书】使用生成式人工智能进行软件测试
专知会员服务
44+阅读 · 2025年1月6日
谷歌《智能体Agent》白皮书,42页pdf
专知会员服务
108+阅读 · 2025年1月5日
【MIT博士论文】机器学习模型调试的有效工具,149页pdf
专知会员服务
48+阅读 · 2023年3月29日
面向多智能体博弈对抗的对手建模框架
专知
18+阅读 · 2022年9月28日
GitHub超9千星:一个API调用27个NLP预训练模型
新智元
17+阅读 · 2019年7月22日
一个牛逼的 Python 调试工具
机器学习算法与Python学习
15+阅读 · 2019年4月30日
人脸检测库:libfacedetection
Python程序员
15+阅读 · 2019年3月22日
爱奇艺基于AI的移动端自动化测试框架的设计
前端之巅
18+阅读 · 2019年2月27日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
VIP会员
最新内容
(译文)认知战:以士兵为目标,塑造战略
专知会员服务
2+阅读 · 今天3:12
(中文)认知战的本体论基础(2026报告)
专知会员服务
17+阅读 · 今天1:45
美空军条令(2026):外国对内防御
专知会员服务
3+阅读 · 今天1:32
美国与以色列如何在攻击伊朗中使用人工智能
专知会员服务
7+阅读 · 4月16日
《自动化战略情报管控》
专知会员服务
3+阅读 · 4月16日
得失评估:审视对伊朗战争的轨迹(简报)
专知会员服务
3+阅读 · 4月16日
【CMU博士论文】迈向可解释机器学习的理论基础
相关资讯
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员