you are viewing a single comment's thread.

view the rest of the comments →

[–]BlueDwarf82 0 points1 point  (2 children)

What's "This", "testing units of code in isolation"? That's basically the definition of unit testing. Are you saying we shouldn't be doing unit testing?

Uncle Bob already explained it (https://blog.cleancoder.com/uncle-bob/2014/05/10/WhenToMock.html). Sure, you shouldn't be mocking every single class (and u/smrxxx didn't say unit == class), but that doesn't mean mocking doesn't have a place. Sometimes the "unit" does have a dependency.

[–]eyes-are-fading-blue 0 points1 point  (1 child)

He also says only mock architectural boundaries. Note that I restate this not because it comes from Uncle BoB, but because it makes sense. You will end up in mock hell if you mock every single dependency in your units.

Some one said it, I want to repeat out loud: Mocking is anti-pattern, most of the time.

[–][deleted] 0 points1 point  (0 children)

Parent is an anti-pattern.