published fresh until

My team's AI-written tests fill half of every PR: how to review?

Summary When reviewing a PR with a large AI-generated test suite, treat tests as code: remove tests that mirror implementation details, give the agent a hand-written example, and judge assertions rather than coverage targets; advice comes from a December 2025 thread.

Not for finding tests that never fail, mocking too much

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

The agent writes tests fast, so pull requests now carry hundreds of lines of tests per small change. Reviewers skim them, coverage creeps toward 100%, and nobody knows which tests matter.

What the source says (r/ExperiencedDevs, 16 December 2025)

The post (author uniquesnowflake8) describes teammates generating enormous test suites, aiming for 100% coverage, and a reviewer who has started skimming test logic because tests feel cheap. The thread is locked, so the comments below are the final set I read.

Answers that got the most agreement:

  • Do not skim. A top comment says bloated test code still has to be maintained, and that a lot of AI test code checks implementation details, which is wrong in most cases. Another commenter adds that a bad test can be worse than none because it gives false confidence.
  • Half the diff being tests is normal in teams with a good testing culture (replies in the thread). The problem is quality, not volume: one commenter in a financial-systems team says 100% coverage is expected, bad or duplicated tests are flagged in review, and the PR does not merge until they are fixed.
  • Give the agent a reference. One commenter suggests a hand-written "ground zero" test the agent must imitate for style, plus descriptive test names so a reviewer can scan a PR and sanity-check structure.
  • Write advice into the repo. A team that tackled this wrote guidance into the codebase to be judicious with tests and to reuse test helpers, and told the team tests are now a main review target.
  • Spec-first. One commenter proposes BDD-style scenarios as acceptance criteria, tests derived from them with the steps as comments, then a fresh agent session judging whether tests and code match the criteria.
  • Smells named by commenters: a 200-line test class for a method that returns null, tests that only check a constructor sets fields, several tests for the same initial state, tests that validate mocked data.

A review checklist built from those comments (my summary, not tried)

1. Does each test fail if the behaviour it names breaks? (A reviewer can flip one condition in the code and rerun.) 2. Does it assert on behaviour a user or caller sees, not on private calls or mock interactions? 3. Is it a duplicate of an existing test with different data? 4. Is the name a sentence that says what is promised?

Prompt wording you can try (untested)

"Before writing tests, read tests/<example>.test.ts and copy its structure. One behaviour per test, named as a sentence. No tests for getters, constructors or framework behaviour. Fewer than N tests per function unless I ask. Do not mock anything inside this repo."

What this does not settle

Commenters disagree on whether cheap, disposable tests are acceptable ("regenerate if it gets hard to maintain"). The source is a discussion, not a measurement, and I did not run any of this.

Sources

  • The primary source for this thread's claims could be opened: the r/ExperiencedDevs thread (author uniquesnowflake8, December 2025; checked 2026-11-17). The post, locked status, comments summarised, financial-systems 100 percent coverage practice and BDD-style proposal are readable as source reports.
  • One general principle was also checked: the Google Testing Blog post "Testing on the Toilet: Test Behavior, Not Implementation" (<https://testing.googleblog.com/2013/08/testing-on-toilet-test-behavior-not.html>). The article text was read (checked 2026-11-17): test setup may change with the implementation, but the test itself typically should not need to change if user-facing behaviour does not, so it confirms the "assert behaviour, not implementation" checklist item and nothing more.
  • Not checked: whether AI-written tests really check implementation details more often than human ones, whether half a diff being tests is normal, and the effect of the prompt wording. The checklist and prompt are my summary and were not tried.

Started from a post by @uniquesnowflake8, packaged by the editor. Original post

Subjects

More in code review

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# My team's AI-written tests fill half of every PR: how to review?
Summary: When reviewing a PR with a large AI-generated test suite, treat tests as code: remove tests that mirror implementation details, give the agent a hand-written example, and judge assertions rather than coverage targets; advice comes from a December 2025 thread.
Copy for agent
get the whatworks thread ai-generated-tests-half-of-every-pr-how-to-review-them and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ai-generated-tests-half-of-every-pr-how-to-review-them
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks