[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-82129-en":3,"doc-seo-82129-105":29,"detail-sidebar-cat-0-en-105":90},{"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":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},82129,1099514067415,"Rowan","https://ap-avatar.wpscdn.com/avatar/100002539d78ffe74a7?x-image-process=image/resize,m_fixed,w_180,h_180&k=1779092875211072502",8,"Research & Report","SCATE: Learning to Supervise Coding Agents for Cost-Effective Test Generation","Autonomous coding agents improve automated test generation but often suffer from lazy generation, where agents prematurely stop and avoid complex program logic, leading to insufficient coverage. Current mitigation depends on continuous human-in-the-loop supervision, which creates a practical bottleneck. SCATE introduces adaptive automated supervision that replaces human intervention during test generation. It models supervision as a contextual bandit problem, selecting high-potential testing actions from coverage and class testability metrics to maximize coverage gains while reducing wasted effort.","SCATE: Learning to Supervise Coding Agents for  \nCost-Effective Test Generation  \nSijia Gu  \nUniversity of British Columbia Vancouver, Canada [sijiagu@ece.ubc.ca](sijiagu@ece.ubc.ca)  \nNoor Nashid  \nUniversity of British Columbia Vancouver, Canada [nashid@ece.ubc.ca](nashid@ece.ubc.ca)  \nAli Mesbah  \nUniversity of British Columbia Vancouver, Canada [amesbah@ece.ubc.ca](amesbah@ece.ubc.ca)  \narXiv :2607 .08983v 1 [ cs . SE] 9 Jul 2026  \nAbstract—While autonomous coding agents have significantly advanced automated test generation, they remain fundamentally limited by lazy generation, a phenomenon where agents prematurely terminate tasks and systematically avoid complex programmatic logic, resulting in inadequate code coverage. Currently, mitigating this premature termination requires continuous human-in-the-loop supervision. This heavy reliance on human intuition creates a bottleneck that negates the efficiency gains of automated generation. We propose SCATE, a framework for adaptive, automated supervision of coding agents that replaces human intervention during test generation. By formulating supervision as a contextual bandit problem, SCATE learns to select the most promising testing actions based on the current coverage and class testability metrics, maximizing coverage gains while minimizing wasted generation effort. Our empirical evaluation demonstrates that SCATE integrates seamlessly with different coding agents. When applied to GEMINI-CLI, it achieves 32.3% higher line coverage and 30.9% higher branch coverage than the agent-only baseline. A comparison with CLAUDE CODE confirms the framework dynamically adapts its policy to optimize each agent’s unique strengths. SCATE also consistently outperforms state-of-the-art non-agentic approaches across all metrics.  \nIndex Terms—Test Generation, Program Analysis, Coding Agents, Contextual Bandit  \nI. INTRODUCTION  \nThe rapid evolution of Large Language Models (LLMs) has led to their widespread adoption in automated test generation tasks [1], [2], [3], [4], [5], [6] . Recent advances have further enabled the emergence of coding agents such as CODEX CLI [7], CLAUDE CODE [8], GEMINI-CLI [9], and QWEN CODE [10] . Coding agents are terminal-based, LLMdriven systems capable of iteratively interacting with software projects through actions such as searching, navigating, editing, building, and testing. Unlike LLM prompting approaches [1],[2], [3], [4], [5], [6], which rely on heuristic, rule-based generation strategies, coding agents operate autonomously over multiple iterations, adapting their behaviour based on intermediate feedback from compilers, test execution outcomes, and the surrounding source code context.  \nDespite this autonomy, state-of-the-art coding agents suffer from critical limitations when applied to comprehensive test generation. A primary challenge is the phenomenon of lazy generation [11] . Even when explicitly instructed to maximize code coverage, agents naturally gravitate toward simple methods and straight-line execution paths, systematically avoiding  \ncomplex logic that requires deep program analysis. To illustrate this, Figure 1 demonstrates a real-world interaction with the GEMINI-CLI agent tasked with generating tests for Apache Commons CLI’s DefaultParser class from Defects4J [12] . Despite the agent’s confident report that tests are “generated and verified\", it prematurely terminates its execution, leaving branch coverage stalled at a mere 31% .  \nGemini CLI Output  \n> Generate tests for class DefaultParser to maximize its code coverage .  \n[Agent Processing . . . ]  \n5 Tests for DefaultParser have been generated and verified [ . . . ] The tests successfully execute and have been integrated into the project’s build system .  \n> What’s the current code coverage?  \n5 The current code coverage for the DefaultParser class is approximately 42% Line Coverage, with 31% Branch Coverage .  \nThis indicates that [ . . . ] further testing is needed to improve coverage","cbCailnUKbzPXzg5","https://ap.wps.com/l/cbCailnUKbzPXzg5","pdf",1111028,1,12,"English","en",105,"# Introduction\n## Lazy generation and premature termination\n## SCATE: adaptive, automated supervision\n## Contributions\n## Empirical evaluation","[{\"question\":\"What limitation do coding agents face in automated test generation?\",\"answer\":\"Coding agents can exhibit lazy generation: they prematurely terminate tasks and systematically avoid complex program logic, resulting in inadequate code coverage.\"},{\"question\":\"How does SCATE replace human-in-the-loop supervision?\",\"answer\":\"SCATE provides adaptive automated supervision during test generation, selecting promising testing actions based on current coverage and class testability metrics.\"},{\"question\":\"How is supervision formulated in SCATE?\",\"answer\":\"SCATE frames supervision as a contextual bandit problem, learning a policy that balances maximizing coverage gains against minimizing wasted generation effort.\"}]",1784178359,30,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":85,"head_meta":87,"extra_data":89,"updated_unix":27},"scate-learning-to-supervise-coding-agents-for-cost-effective-test-generation","",{"@graph":35,"@context":84},[36,53,67],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/scate-learning-to-supervise-coding-agents-for-cost-effective-test-generation/82129/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":61,"encodingFormat":60,"isAccessibleForFree":62,"interactionStatistic":63},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-16",true,{"@type":64,"interactionType":65,"userInteractionCount":4},"InteractionCounter",{"@type":66},"ViewAction",{"@type":68,"mainEntity":69},"FAQPage",[70,76,80],{"name":71,"@type":72,"acceptedAnswer":73},"What limitation do coding agents face in automated test generation?","Question",{"text":74,"@type":75},"Coding agents can exhibit lazy generation: they prematurely terminate tasks and systematically avoid complex program logic, resulting in inadequate code coverage.","Answer",{"name":77,"@type":72,"acceptedAnswer":78},"How does SCATE replace human-in-the-loop supervision?",{"text":79,"@type":75},"SCATE provides adaptive automated supervision during test generation, selecting promising testing actions based on current coverage and class testability metrics.",{"name":81,"@type":72,"acceptedAnswer":82},"How is supervision formulated in SCATE?",{"text":83,"@type":75},"SCATE frames supervision as a contextual bandit problem, learning a policy that balances maximizing coverage gains against minimizing wasted generation effort.","https://schema.org",{"og:url":51,"og:type":86,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":88,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":91},[92,96,100,104,109,114,119,121,126,129,133],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":93,"show_sort_weight":94,"slug":95},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":97,"show_sort_weight":98,"slug":99},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":101,"show_sort_weight":102,"slug":103},"Exam",70,"exam",{"id":105,"doc_module":4,"doc_module_name":45,"category_name":106,"show_sort_weight":107,"slug":108},5,"Comic",60,"comic",{"id":110,"doc_module":4,"doc_module_name":45,"category_name":111,"show_sort_weight":112,"slug":113},6,"Technology",50,"technology",{"id":115,"doc_module":4,"doc_module_name":45,"category_name":116,"show_sort_weight":117,"slug":118},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":28,"slug":120},"research-report",{"id":122,"doc_module":4,"doc_module_name":45,"category_name":123,"show_sort_weight":124,"slug":125},9,"Religion & Spirituality",20,"religion-spirituality",{"id":124,"doc_module":4,"doc_module_name":45,"category_name":127,"show_sort_weight":124,"slug":128},"World Cup","world-cup",{"id":130,"doc_module":4,"doc_module_name":45,"category_name":131,"show_sort_weight":130,"slug":132},10,"Lifestyle","lifestyle",{"id":134,"doc_module":4,"doc_module_name":45,"category_name":135,"show_sort_weight":105,"slug":136},19,"General","general"]