Who You Gonna Call


Petunia has never actually read xUnit Test Patterns.
The 1950 children's book Petunia by Roger Duvoisin tells the tale of a goose who finds a book in a meadow. She clutches the book under her wing and proudly struts around the farm for all the other animals to see how smart she is. Puffed up with false confidence, she doles out terrible advice which her fellow farm animals implement to their own harm.
GenAI is fast but sloppy
Generative AI is like Petunia. When it comes to software quality, it confidently emits bad advice.
The book xUnit Test Patterns 1 was published on January 1, 2007. Thanks to this book and its blessed author Gerard Meszaros, we've had a handy checklist of test smells for nearly twenty years. We know which design choices make software hard to verify and which quality control choices make software resistant to change.
In 2026, these are firmly established principles, yet their use is far from commonplace, and generative AI perpetuates the omission. In many recent pull requests, I encountered Claude-generated code like below. On one of these PRs, I invoked ten review agents, a mix of Claude and Codex. I didn't provide them any extra knowledge of good test practices. None of the agents pointed out the deficiency I am about to reveal to you.
Avoid behavior verification
Take a look at this code.
class FakeCache: ICache { public int FetchCallCount { get; private set; }
public T Fetch ( int id ) { FetchCallCount ++; return default; } }
[ Fact ] public void GetById_DoesNotUseTheCache () { // Arrange var cache = new FakeCache (); var service = new WidgetService(new FakeClient(), cache );
// Act service. GetById ( id: 1 );
// Assert cache. FetchCallCount. ShouldBe ( 0 ); }
What's wrong with this test? It's asserting an interaction where it should be asserting a contract.
cache.FetchCallCount.ShouldBe(0); // asserts an interaction
The public contract of GetById is that it always returns fresh data, but what we've tested here is whether it ca…