Your Test Strategy Assumes Humans Write Code

A state government app

13

months

0

lines of code
written by hand

Our project

E2E 215 integration 1,134 component 372 unit 7,137 tests over half our C# 5,631 unit tests · 4 in 5

Our project, 4 Sep 2026. Test share of C# lines

Should I even have unit tests?

What were 7,137 tests actually buying us?

20,000

lines added, 10,000 deleted

a median week, tests included

Our project. Lines changed, median week, Mar–Sep 2026

>2/3

of test files changed

In a typical month, March to August 2026.

Our project. Test files touched by any commit, monthly average, Mar–Aug 2026

Keeping the tests in step: about half its effort.

Our project. Team estimate

1,258

fix: commits

with our test suite in place the whole time

Our project. Commits labelled fix:, 1 Mar–4 Sep 2026

Three things we found.

  1. Anchor: tied to structure
  2. Author: written by the agent
  3. Intent: split across stories

Our project

Think of a pizza delivery.

  1. Driver = the agent
  2. Route = the code it writes
  3. House = where it has to end up
Shop Customer

Our tests were anchored to the structure of the code.

Shop Customer ✓ Pass Rewritten

Refactor commits that changed tests: 57% · feature commits: 55%

Our project. Commit types, Mar–Sep 2026Google, SWE at Google ch. 12

The same agent wrote the code and the tests.

Shop Customer Wrong house ✓ Pass driver = the agent

Our reading of the researchKonstantinou et al. 2026

var x = new Document(
    "report.pdf", read, write);

x.Name.ShouldBe("report.pdf");
x.Reader.ShouldBeSameAs(read);
x.Writer.ShouldBeSameAs(write);

It can only fail if someone breaks the constructor.

Our project, names changed

Our app formatted dates three different ways.

2026-05-21T14:30:00.000         ✓ pass
2026-05-21T14:30:00.000+01:00   ✓ pass
2026-05-21T13:30:00Z            ✓ pass

Our project, values changed

What we want StoryStoryStoryStoryStoryStory Agent 1Test A Agent 2Test B Already built

No agent could see what the others were testing.

Neither agent saw the rules behind what was already built.

Our project

Our test strategy assumed three things.

Stories add up to the rules→Missing intentsplit across stories
Code structure is stable→Wrong anchortied to structure
Coders test their own code→Wrong authorwritten by the agent

Our reading of the researchKonstantinou et al. 2026

The agent’s tests help it build. We call that scaffolding.

If the agent misunderstands the requirement,
its tests can repeat the same mistake.

Keep the tests, and add a separate check before you ship.

Our reading of the researchSion & April 2026

How we verify.

Let the agent test as it builds. Verify before you ship.

Our reading of the researchSion & April 2026

The intent fix

Turn the stories into one set of rules.

Split across stories→one set, in the repo
Vague or contradictory→an owner settles it
Each agent saw a slice→every agent reads it all
New stories keep coming→rules change first
checkOrder at 6:00. Hot at the door, 6:30.proves: hot-in-30
testNo rule behind it.scaffolding
Shop Customer
Order

Every order:

Right pizza.

Hot within 30 minutes.

Right door.

Counts as proof if it’s: traceable to a rule someone owns

GargFactory Missions

The anchor fix

Test at the doorstep.

The smallest boundary that holds the whole rule.

What a customer sees→journey test, end to end
What our API promises→contract test
Data we send others→test against their format
A calculation or decision→unit test, from the rule

They cost more to run: slower, need test data, can be flaky.

Shop Customer
Counts as proof if it’s: traceable to a rule someone owns anchored at the boundary

FarleyHuang et al. (DeepSWE)Kuefler, SWE at Google (2020)Beck, Test DesiderataFowler, TestPyramid 2012Burns, SE Daily 2026

The author fix

Someone who isn’t the driver.

A fresh agent, from the rules and the interface, never the code
Or a person

A person approves each check.

Checks the coding agent can’t edit.

A check only proves its rule.
New work changes the rules first.

Shop Driver Customer Checks
Counts as proof if it’s: traceable to a rule someone owns anchored at the boundary written and kept out of the coding agent’s reach Everything else is scaffolding.

Konstantinou et al.Sion & AprilGoogle, SWE at Google ch. 12

Where the independent check comes from.

Stories and developer tasks go to the coding agent, which writes the code and its own unit tests as scaffolding. Intent: both agents read the current owned rule, deliver hot within 30 minutes. Author: a fresh testing agent writes the independent check. Anchor: order at 6:00 and check the pizza is hot at the door by 6:30.

A person approves the independent check. The coding agent can run it but can’t edit it.

Our proposed workflowSion & April, Who Verifies the Builder?, 16 Oct 2026

Where the effort went.

Where the effort goes.

rules and checks unit tests: the agent’s effort rules and checks: our effort, our trust the agent’s tests: it keeps them, we stop reading

Let the agent churn its own tests.

Width shows effort and trust, not how many tests.

Pyramid: how many tests. Slice: effort and trust.

Our reading of the researchour project

What we've done.

  1. Agents look after all our unit tests, as scaffolding for their work.
  2. Checking our key journeys against the rules found defects our unit tests had missed.
  3. A separate agent writes the tests first, and the coding agent isn't allowed to change them.

Our project

Three actions for you.

  1. 1.Let agents manage their own unit tests.
  2. 2.Put your testing effort at the doorstep.
  3. 3.Verify against rules with named owners, using checks the coding agent can't change.

Your test strategy assumes humans write code.

So did ours.

Ask the customer whether the right pizza arrived.

→ space pgdnnext
← pgupprevious
shift + ←/→skip builds
click or press fastskip animations
12 ⏎go to slide 12
home / endfirst / last
ooverview (click a slide to jump; o or esc to go back)
ioverview: show or hide supporting info (grey notes)
ppresenter view (p or esc there to go back)
nspeaker notes under the slide (or add ?notes to the URL)
?allon the URL: include skipped slides
ffullscreen
b .blackout
⌘Pprint / PDF backup
?this help