> I really dislike this idea of testing in go: only ever use an interface, never the real implementation + mockgen the mocks based on this interface + use the mocks to assert that a function is called, with exactly this parameters and in this exact order.
Same I have zero confidence in these tests and the article even states that the tests will fail if a contract for a external service/system changes
I see this kind of testing as more for regression prevention than anything. The tests pass if the code handles all possible return values of the dependencies correctly, so if someone goes and changes your code such that the tests fail they have to either fix the errors they've introduced or go change the tests if the desired code functionality has really changed.
These tests won't detect if a dependency has changed, but that's not what they're meant for. You want infrastructure to monitor that as well.
Same I have zero confidence in these tests and the article even states that the tests will fail if a contract for a external service/system changes