News for hackers. Stuff that matters.
Re:Prefer Fakes over Mocks by hackerfromthefu on Wednesday October 14, 2020 @05:16AM (#24774693)
>> .. fully functional fake of the original class.

So they are coupled to the implementation of the object in any case!

Re:Prefer Fakes over Mocks by tyrrrz on Wednesday October 14, 2020 @08:06AM (#24775592)
Quoting the article:

> It may also appear that the details we have to take into account here are not that different from the implementation-aware assumptions we were making when using mocks, as neither are actually governed by the interface of the component. However, the major distinction is that the coupling we institute here is between the test double and the real implementation of the component, rather than between the test double and the internal specifics of its consumer.

Re:Prefer Fakes over Mocks by doubletgl on Thursday October 15, 2020 @03:34AM (#24785899)
Ok, so the implementation-awareness lies in the fake itself, not the code setting up mocks. But creating the fake is part of testing, if you follow this approach. So you're still doing implementation-aware testing in the end. Don't get me wrong, fakes are a cool idea. But the article is overselling their advantages a bit I think.
Re:Prefer Fakes over Mocks by silveroriole on Wednesday October 14, 2020 @06:36AM (#24775115)
I’d say rather that they’re coupled to the behaviour of the object.
Re:Prefer Fakes over Mocks by bluGill on Wednesday October 14, 2020 @10:30AM (#24776917)
Not exactly - they are coupled to the interface contract. The behavior can be very different.
Re:Prefer Fakes over Mocks by srtjstjsj on Thursday October 15, 2020 @01:07AM (#24785127)
Contracted behavior is same.