[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-82196-en":3,"doc-seo-82196-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},82196,2336464648746,"Skyler","https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c",8,"Research & Report","Multi-Agent LLM Collaboration for Unit Test Generation via Human-Testing-Inspired Workflows","Large Language Models (LLMs) have accelerated automated unit test generation, yet LLM-based workflows remain limited by rigid procedural pipelines and non-specialized, rule-based context extraction. This paper introduces TESTAGENT, an LLM-driven approach that emulates human testing via multi-agent collaboration, using a requirement planner, test generator, and test reviewer. Adaptive tool APIs enable on-demand reasoning, while a test-specialized knowledge graph built by static analysis supports repository-level dependency understanding and persistent test artifacts.","Multi-Agent LLM Collaboration for Unit Test Generation via Human-Testing-Inspired Workflows  \nQuanjun Zhang, Ye Shang, Siqi Gu, Jianyi Zhou, Chunrong Fang, Zhenyu Chen, Liang Xiao  \narXiv :2607 .09 10 1v 1 [ cs . SE] 10 Jul 2026  \nAbstract—Recently, the emergence of Large Language Models (LLMs) has spurred a surge of research into automated unit test generation, yielding impressive performance and reducing manual effort. However, existing LLM-based approaches still suffer from two major limitations: (1) they follow rigid, procedural workflows that underutilize the autonomous reasoning potential of LLMs, making it difficult to dynamically adapt testing strategies based on real-time feedback; and (2) they rely on rule-based context extraction that is not tailored to test generation, failing to capture fine-grained code dependencies and test-specific knowledge required for deriving test requirements. In this paper, we propose TESTAGENT, an LLM-based test generation approach that addresses the above limitations by emulating human testing practices via a multi-agent collaboration mechanism. Particularly, TESTAGENT designs three specialized agents, namely a requirement planner, a test generator, and a test reviewer, to simulate how developers understand, construct, and validate unit tests. To unleash the autonomous capabilities of LLMs, we equip TESTAGENT with a set of tool APIs that can be invoked dynamically in an on-demand and adaptive manner. To further support repository-level reasoning, TESTAGENT constructs a test-specialized knowledge graph via static analysis, which captures code entities and their dependencies across the project and persistently stores testing artifacts (e.g., test reports and failure analyses) produced during generation. Experimental results show that TESTAGENT achieves 97.46% execution rate, 92.34% line coverage, 90.24% branch coverage, and 83.69% mutation score on six Java projects, outperforming LLM-based baselines across all metrics and achieving substantially higher mutation scores than search-based tools. We also adapt TESTAGENT to Python projects with 88.85% line coverage and 78.89% branch coverage, demonstrating its generalizability beyond the Java ecosystem. Moreover, experiments on industrial projects anda controlled user study confirm the practical applicability of TESTAGENT in real-world development scenarios. In addition, TESTAGENT detects 154 real-world bugs via non-regression tests with a precision of 92.22% . Overall, our study highlights the promising potential of human-testing-inspired multi-agent workflows in producing more reliable, scalable, and practical test cases.  \nIndex Terms—Software Testing, Test Generation, Large Language Model, AI for SE  \nI. INTRODUCTION  \nSoftware testing is a cornerstone of modern software quality assurance [1] . Among the various stages of testing (e.g., integration and system testing), unit testing plays a particularly  \nQuanjun Zhang and Liang Xiao are with Nanjing University of Science and Technology, China. E-mail: [quanjunzhang@njust.edu.cn](quanjunzhang@njust.edu.cn); xiao[liang@mail.njust.edu.cn](liang@mail.njust.edu.cn).  \nYe Shang, Siqi Gu, Chunrong Fang, and Zhenyu Chen are with Nanjing University, China. E-mail: {yeshang, [siqi.gu](siqi.gu}@smail.nju.edu.cn)[}](siqi.gu}@smail.nju.edu.cn)[@smail.nju.edu.cn](siqi.gu}@smail.nju.edu.cn);{fangchunrong, [zychen](zychen}@nju.edu.cn)[}](zychen}@nju.edu.cn)[@nju.edu.cn](zychen}@nju.edu.cn).  \nJianyi Zhou is with Huawei Cloud Computing Technologies Co., Ltd. Email: [zhoujianyi2@huawei.com](zhoujianyi2@huawei.com).  \ncritical role by verifying the correctness of individual software components early in the development lifecycle [2], [3] . As the cost of fixing software bugs increases significantly over time, early detection through unit testing substantially reduces maintenance overhead and improves development efficiency. Thus, unit testing has become a standardized and often mandatory practice as software","cbCaisj36mfaSPYl","https://ap.wps.com/l/cbCaisj36mfaSPYl","pdf",1153948,3,1,14,"English","en",105,"# Introduction\n## Background and Motivation\n## Challenges in Existing Approaches\n## Proposed Solution Overview\n# Methodology\n## Multi-Agent Collaboration Design\n## Adaptive Tool-Driven Reasoning\n## Test-Specialized Knowledge Graph","[{\"question\":\"What problem do existing LLM-based unit test generation approaches face?\",\"answer\":\"They rely on rigid procedural workflows that cannot adapt dynamically to feedback, and they use rule-based context extraction that fails to capture fine-grained code dependencies and test-specific knowledge.\"},{\"question\":\"How does TESTAGENT generate unit tests using human-testing-inspired workflows?\",\"answer\":\"TESTAGENT uses three specialized agents—a requirement planner, a test generator, and a test reviewer—to simulate how developers understand, construct, and validate unit tests.\"},{\"question\":\"What mechanisms help TESTAGENT perform repository-level reasoning?\",\"answer\":\"TESTAGENT provides dynamic tool APIs for adaptive invocation and builds a test-specialized knowledge graph via static analysis to represent code entities and dependencies while storing testing artifacts.\"}]",1784178751,35,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"multi-agent-llm-collaboration-for-unit-test-generation-via-human-testing-inspired-workflows","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,50],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":20},"https://docshare.wps.com/document/research-report/",{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/multi-agent-llm-collaboration-for-unit-test-generation-via-human-testing-inspired-workflows/82196/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-21","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What problem do existing LLM-based unit test generation approaches face?","Question",{"text":75,"@type":76},"They rely on rigid procedural workflows that cannot adapt dynamically to feedback, and they use rule-based context extraction that fails to capture fine-grained code dependencies and test-specific knowledge.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How does TESTAGENT generate unit tests using human-testing-inspired workflows?",{"text":80,"@type":76},"TESTAGENT uses three specialized agents—a requirement planner, a test generator, and a test reviewer—to simulate how developers understand, construct, and validate unit tests.",{"name":82,"@type":73,"acceptedAnswer":83},"What mechanisms help TESTAGENT perform repository-level reasoning?",{"text":84,"@type":76},"TESTAGENT provides dynamic tool APIs for adaptive invocation and builds a test-specialized knowledge graph via static analysis to represent code entities and dependencies while storing testing artifacts.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]