Rethinking the Value of Agent-Generated Tests for LLM-Based Software Engineering Agents

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Chen, Zhi, Sun, Zhensu, Shi, Yuling, Peng, Chao, Gu, Xiaodong, Lo, David, Jiang, Lingxiao
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866911577864667136
author Chen, Zhi
Sun, Zhensu
Shi, Yuling
Peng, Chao
Gu, Xiaodong
Lo, David
Jiang, Lingxiao
author_facet Chen, Zhi
Sun, Zhensu
Shi, Yuling
Peng, Chao
Gu, Xiaodong
Lo, David
Jiang, Lingxiao
contents 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, but the value of this behavior remains unclear. For example, GPT-5.2 writes almost no new tests yet achieves performance comparable to top-ranking agents.This raises a central question: do such tests meaningfully improve issue resolution, or do they mainly mimic a familiar software-development practice while consuming interaction budget? To better understand the role of agent-written tests, we analyze trajectories produced by six strong LLMs on SWE-bench Verified. Our results show that test writing is common, but resolved and unresolved tasks within the same model exhibit similar test-writing frequencies. When tests are written, they mainly serve as observational feedback channels, with value-revealing print statements appearing much more often than assertion-based checks. Based on these insights, we perform a prompt-intervention study by revising the prompts used with four models to either increase or reduce test writing. The results suggest that prompt-induced changes in the volume of agent-written tests do not significantly change final outcomes in this setting. Taken together, these results suggest that current agent-written testing practices reshape process and cost more than final task outcomes.
format Preprint
id arxiv_https___arxiv_org_abs_2602_07900
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Rethinking the Value of Agent-Generated Tests for LLM-Based Software Engineering Agents
Chen, Zhi
Sun, Zhensu
Shi, Yuling
Peng, Chao
Gu, Xiaodong
Lo, David
Jiang, Lingxiao
Software Engineering
Artificial Intelligence
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, but the value of this behavior remains unclear. For example, GPT-5.2 writes almost no new tests yet achieves performance comparable to top-ranking agents.This raises a central question: do such tests meaningfully improve issue resolution, or do they mainly mimic a familiar software-development practice while consuming interaction budget? To better understand the role of agent-written tests, we analyze trajectories produced by six strong LLMs on SWE-bench Verified. Our results show that test writing is common, but resolved and unresolved tasks within the same model exhibit similar test-writing frequencies. When tests are written, they mainly serve as observational feedback channels, with value-revealing print statements appearing much more often than assertion-based checks. Based on these insights, we perform a prompt-intervention study by revising the prompts used with four models to either increase or reduce test writing. The results suggest that prompt-induced changes in the volume of agent-written tests do not significantly change final outcomes in this setting. Taken together, these results suggest that current agent-written testing practices reshape process and cost more than final task outcomes.
title Rethinking the Value of Agent-Generated Tests for LLM-Based Software Engineering Agents
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2602.07900