Agents wrote terrible unit tests in every OO language I have used, with excessive use of mocks…
Summary
José Valim argues AI agents produce poor unit tests in object-oriented languages by over-relying on mocks to manage implicit environments.
OO languages carry implicit environments.
Valim cites Joe Armstrong to explain that object-oriented structures force testers to manage complex, hidden dependencies.
a gorilla holding the banana and the entire jungle
Unit tests become integration tests.
Testing objects requires either high-quality design or excessive mocking; otherwise, the tests function as integration tests.
otherwise they cosplay as integration tests
AI automates bad design habits.
Valim claims the decline of unit testing results from poor design and AI scaling existing human errors.
Model tests inflate code size.
Nate Berkopec observes that tests written by models are often terrible and serve only to double lines of code.
just doubling total LOC
Black box testing works better.
Berkopec suggests inverting the approach toward heavy end-to-end or golden master testing, using lower levels only when necessary.
Read the original ↗Save to your Sponge
Summarized with Sponge. Quotes are the author’s own words.