The author advocates for more tests and increasing test coverage but warns against the use of mocks, calling mocking an anti-pattern. They emphasize that mocks can add complexity, introduce bugs, and create a false sense of security. Instead of relying on mocks, the author suggests alternatives such as more unit testing, using in-memory databases, separating logic and services, and investing in end-to-end (E2E) integration testing. The article delves into the drawbacks of mocks, explores different ways to increase testing without using mocks, and provides real-world examples to support their arguments. The author’s voice is informative and opinionated, challenging common practices in software testing.
https://www.amazingcto.com/mocking-is-an-antipattern-how-to-test-without-mocking/