3 ms·
It is of course super common. Unit tests should be stubbing out as much as possible/reasonable. The presumption is that we're talking about a well rounded test
by JohnBooty 5y ago
It is of course super common. Unit tests should be stubbing out as much as possible/reasonable.
The presumption is that we're talking about a well rounded test suite with both unit tests and integration tests, and the integration tests would indeed be catching the fact that A is passing entirely the wrong thing to B.
Of course, this does mean we're leaning heavily on the test suite here. But, in any nontrivial application I hope that we would have a robust test suite, right? Otherwise we're going to have some problems whether we're statically or dynamically typed.
- emodendroket 5y agoOver time I have come to view mock- and stub-heavy tests as next to worthless.