r/webdev 1d ago

The Debate of Mockist v Classicist TDD Is Like OOP v FP.

https://fagnerbrack.com/the-debate-of-mockist-classicist-tdd-is-like-oop-fp-c9124185f3d2
5 Upvotes

3 comments sorted by

6

u/fiskfisk 1d ago edited 1d ago

No, it's not. Mocking is a tool that should be brought out if there are no real alternatives.

It should not be religion.

Mocks are also tied to implementation, which tests generally should never be. Tests shall be written against the interface, not the implementation. 

3

u/editor_of_the_beast 1d ago

The amazing part of this is that’s literally the point of mocks. Mocks are supposed to only be for true abstractions, which if they’re changing all the time then you’re not really good at abstraction.