# Replacing Mocks

DevFeed: [Replacing Mocks](<https://devfeed.tech/articles/replacing-mocks-30597.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2020/06/replacing-mocks/>)

Published: 2020-06-09T07:23:09Z

Content type: opinion

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [maintenance](<https://devfeed.tech/topics/maintenance.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [implementation](<https://devfeed.tech/tags/implementation.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>)

## AI overview

The article explains why the author increasingly avoids mock objects in tests. It argues that mocks can encourage testing implementation details, producing brittle tests that require ongoing maintenance, and discusses replacing mocks with fakes while noting that wrapping a mock may not solve the underlying problem.

## Source excerpt

Sam Edwards recently posted his strategy for wrapping mock objects to avoid using verbose syntax and facilitate reuse. After reading the post, my first thought was that this example comes really close to showing my strategy for removing mock objects from tests. Why Remove the Mocks There has been endless discussion about the benefits and drawbacks of Mock objects in testing. As I've become better at testing, and programming in general, I've come to use mock objects less and less, even removing them from my existing projects as I come across them.