arXiv:2605.01264cs.SEcs.LG2026-05

用反馈机制提升LLM生成测试用例的覆盖率和效率

FeedbackLLM: Metadata driven Multi-Agentic Language Agnostic Test Case Generator with Evolving prompt and Coverage Feedback

论文配图:FeedbackLLM: Metadata driven Multi-Agentic Language Agnostic Test Case Generator with Evolving prompt and Coverage Feedback
图 1 · 摘自论文原文
  • 通过两阶段迭代反馈,自动优化测试用例生成
  • 在C/Python基准上实现更高行与分支覆盖率
  • 适合自动化测试团队和持续集成场景使用

传统测试用例生成方法依赖人工且计算开销大,难以扩展。尽管近期已有利用大语言模型(LLMs)进行软件测试的研究,但单次提示工程方法易产生幻觉和冗余用例,导致覆盖不足。本文提出FeedbackLLM,一种基于紧密耦合双阶段架构的自动化、语言无关测试用例生成框架。第一阶段解析源码提取输入约束并生成测试用例;第二阶段由两个专用的LLM反馈代理协同评估:(i) 行反馈代理提取未执行行的元数据,(ii) 分支反馈代理提取未执行分支条件的元数据。该过程循环k步,持续优化生成结果。此外,引入去重缓存以避免重复API请求和无效执行周期。在标准C与Python基准程序上评估显示,FeedbackLLM在保持线性执行时间增长的同时,显著优于基线工具,在行覆盖与分支覆盖上均有提升。

原文摘要 · Abstract (English)

Traditional approaches to test case generation often involve manual effort and incur significant computational overhead. Additionally, these approaches are not scalable, and hence, unsuitable for complex software systems. Recently, Large Language Models (LLMs) have been applied to software testing. However, single-shot prompt engineering-based approaches tend to hallucinate and generate redundant test cases, resulting in fewer branches. To handle the above-mentioned limitations, in this paper, we propose FeedbackLLM, a novel automated language-agnostic test case generation framework based on tightly coupled two-stage approach. In the first stage, FeedbackLLM extracts the input constraints by parsing source code and generates the possible test cases. The quality of the test cases is evaluated in the second stage by the following two specialized LLM feedback agents: (i) Line Feedback Agent: extracts the metadata related to missed line executions and (ii) Branch Feedback Agent: extracts the metadata of the unexecuted branch conditions. The above agents operate in a two-stage process, communicating in tandem, and this procedure is repeated for k-steps. Further, we also introduced a redundancy prevention cache to avoid duplicate API requests and avoid unnecessary execution cycles. The performance of the proposed architecture is evaluated on the standard benchmark programs related to C and Python programs. FeedbackLLM demonstrated more line and branch coverage than baseline tools while scaling linearly in execution time.

测试生成LLM应用自动化测试

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。