Re:Prefer Fakes over Mocks
by throw_m239339 on Thursday October 15, 2020 @07:03AM
(#24787183)
> Anyway, why do you claim any of that is specific to OOP?
There is no need for Mocks or Fakes with pure functions.
Re:Prefer Fakes over Mocks
by marcosdumay on Thursday October 15, 2020 @08:52AM
(#24788058)
And in what paradigm do your programs consist of only pure functions? Certainly not on FP, where IO is explicitly added to a lot of code.
Anyway, there isn't much difference between mocking a unity and passing some static data into your functions and comparing the results with the expected ones.
On the best scenario, your mocks are just data that doesn't have timing characteristics, don't react to the system being tested, and are short enough to not need any kind of compression (in loops or gzip). On those cases, they don't need tests. But if you are doing anything weirder, they pretty much do.
I honestly don't see any sense in separating them in categories like if they had discreete non-overlapping mono-dimensional properties.
Anyway, why do you claim any of that is specific to OOP?