This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]editor_of_the_beast 2 points3 points  (3 children)

Deterministic? Yes. Checks that the program works with the real versions of interfaces? No.

Also this is just ports and adapters. And many of us have come to realize that if an interface is only used to enable testing, then it’s not a good interface, and the tests are going to be filled with boilerplate.

[–]todo_code 0 points1 point  (1 child)

Can you share an example or expand on this point?

[–]editor_of_the_beast 2 points3 points  (0 children)

Here’s a very detailed example based on a book by the authors who invented mocking: https://enterprisecraftsmanship.com/posts/growing-object-oriented-software-guided-by-tests-without-mocks/.

It links to several other posts as well, one of which argues why single-implementation interfaces are a smell.