Avoiding mocks, Part I

Mocks often result in brittle tests that simulate unrealistic scenarios, replacing too much of the actual system and providing a false sense of safety.

Luís Soares
CodeX
Published in
7 min readJan 3, 2024

--

The solution combines testing vertical slices, relying on dogfooding, and using fakes. Let’s see why and how.

Photo by Sam Moghadam Khamseh on Unsplash

--

--

Luís Soares
CodeX
Writer for

I write about automated testing, Lean, TDD, CI/CD, trunk-based dev., user-centric dev, DDD, coding good practices,