3 ms·
Agreed. A test should care about: input, "do something", output. Then you can refactor the heck out of "do something" and your test (which is ideally document
by stephen 10y ago
Agreed.
A test should care about: input, "do something", output.
Then you can refactor the heck out of "do something" and your test (which is ideally documenting the use cases you need to support) doesn't have to change at all.
For me, preferring stubs (dummy implementations of your external dependencies), when possible/appropriate, is a good way to avoid "your test is just a repetition of which method calls your implementation makes":
http://www.draconianoverlord.com/2010/07/09/why-i-dont-like-mocks.html http://www.draconianoverlord.com/2010/07/09/why-i-dont-like-...