Repensando o Valor dos Testes Gerados por Agentes para Agentes de Engenharia de Software Baseados em LLM
Rethinking the Value of Agent-Generated Tests for LLM-Based Software Engineering Agents
February 8, 2026
Autores: Zhi Chen, Zhensu Sun, Yuling Shi, Chao Peng, Xiaodong Gu, David Lo, Lingxiao Jiang
cs.AI
Resumo
Os agentes de código baseados em Large Language Models (LLMs) estão resolvendo cada vez mais problemas em nível de repositório por meio da edição iterativa de código, invocação de ferramentas e validação de correções candidatas. Nestes fluxos de trabalho, os agentes frequentemente escrevem testes de forma dinâmica, um paradigma adotado por muitos agentes bem posicionados na leaderboard do SWE-bench. No entanto, observamos que o GPT-5.2, que praticamente não escreve novos testes, pode alcançar um desempenho comparável aos agentes de topo. Isto levanta uma questão crítica: se tais testes melhoram significativamente a resolução de problemas ou se apenas imitam as práticas de teste humanas, consumindo um orçamento substancial de interações.
Para revelar o impacto dos testes escritos por agentes, apresentamos um estudo empírico que analisa trajetórias de agentes em seis LLMs state-of-the-art no SWE-bench Verified. Nossos resultados mostram que, embora a escrita de testes seja comumente adotada, tarefas resolvidas e não resolvidas dentro do mesmo modelo exibem frequências similares de escrita de testes. Além disso, estes testes normalmente servem como canais de feedback observacional, onde os agentes preferem declarações de impressão (print statements) que revelam valores significativamente mais do que verificações formais baseadas em asserções. Com base nestes insights, realizamos um experimento controlado revisando os prompts de quatro agentes para aumentar ou reduzir a escrita de testes. Os resultados sugerem que mudanças no volume de testes escritos por agentes não alteram significativamente os resultados finais. Em conjunto, nosso estudo revela que as práticas atuais de escrita de testes podem oferecer uma utilidade marginal em tarefas autônomas de engenharia de software.
English
Large Language Model (LLM) code agents increasingly resolve repository-level issues by iteratively editing code, invoking tools, and validating candidate patches. In these workflows, agents often write tests on the fly, a paradigm adopted by many high-ranking agents on the SWE-bench leaderboard. However, we observe that GPT-5.2, which writes almost no new tests, can even achieve performance comparable to top-ranking agents. This raises the critical question: whether such tests meaningfully improve issue resolution or merely mimic human testing practices while consuming a substantial interaction budget.
To reveal the impact of agent-written tests, we present an empirical study that analyzes agent trajectories across six state-of-the-art LLMs on SWE-bench Verified. Our results show that while test writing is commonly adopted, but resolved and unresolved tasks within the same model exhibit similar test-writing frequencies Furthermore, these tests typically serve as observational feedback channels, where agents prefer value-revealing print statements significantly more than formal assertion-based checks. Based on these insights, we perform a controlled experiment by revising the prompts of four agents to either increase or reduce test writing. The results suggest that changes in the volume of agent-written tests do not significantly change final outcomes. Taken together, our study reveals that current test-writing practices may provide marginal utility in autonomous software engineering tasks.