Skip to content

Where an AI-Written Test Begins

When an AI turns a requirement into a software test, the test's starting state deserves review as an interpretation of the requested behavior, not just preparation for checking an answer.

In python-docx, a library for Word documents, a naming test opens a prepared document and retrieves a style-settings entry, then checks its name against Normal. The written scenario requests a known name without requiring that document-loading route.

Constructing the entry directly would bypass document loading. That could suit an isolated property but not a requirement about retrieving an entry from a document. The needed behavior decides which construction belongs.

The setup supplies a particular interpretation of the request. For someone asking AI to write a test before the corresponding behavior exists, deciding what the test must construct is part of specifying the job.

An October 27 preprint introduces Req2Test-Bench, which removes target implementation bodies and scenario test code while retaining other project context. In the October 29 update, which lets agents run retained code, Codex running DeepSeek-V4.1-Flash at high reasoning effort, with surrounding implementation visible, passed 93.2%; 36.4% both passed and detected every scored artificial fault caught by the reference test.

These are equal-weight means across 8 projects, with 2,037 instances counted. Passing excludes infrastructure failures. Artificial faults are not real bugs, and a narrower test may validly interpret a requirement.

What developers want to keep

Uber’s AutoCover study documents another setting: developers generating tests within an existing codebase. In August and September 2025, developers explicitly accepted about 44% of AutoCover’s editor tests that passed and increased code or scenario coverage. That workflow could inspect implementation code, build and check tests, and offer them for developer review. It is not a replication of hidden-target requirement-to-test generation.

Its survey had 29 respondents, including 6 who had substantially reduced use; responses covered AI-assisted testing more broadly. 6 comments requested existing project conventions, including assertion patterns and established mock libraries. 4 mentioned project-specific guidelines, including mock choice and discoverability. Responses overlapped; active users were more positive.

A mock substitutes for a dependency during testing. Its choice can affect how another developer understands and changes the test. Familiar construction can have value beyond whether today’s assertion runs. That is a reason to consider local conventions, not proof that every convention preserves necessary behavior.

For the naming check, clarifying whether the name must come through a document would give the AI a reason to retain—or omit—the setup.

Sources