Coding agents copy your worst test files, so cleaning them up matters

A developer argues that the existing tests in a codebase act as a prompt, since coding agents imitate their patterns closely. Simon Willison has observed that agent-written tests tend to match the quality of a project's clean baseline tests. A common flaw he points to is heavily duplicated test setup, which he addresses by asking the agent to refactor with parametrize or shared fixtures. He notes that even a few well-written examples can steer an agent toward a preferred testing style. The author also notes that Anthropic and OpenAI docs recommend keeping instruction files short and letting conventions live in the code itself.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in