3 ms·
Writing an article claiming that "it's complex" and "it depends" is the easiest thing in the world; even when these claims are false, few will dare call them ou
by lmm 5y ago
Writing an article claiming that "it's complex" and "it depends" is the easiest thing in the world; even when these claims are false, few will dare call them out as false.
In my experience good testing actually doesn't require wisdom, or at least there's a lot more value in quick easy principles than there is in wisdom (which is very hard to assess whether it's actually achieving anything).
We have plenty of articles that pontificate and cover everything in shades of grey; actually committing to a stance and giving concrete, actionable advice (that may be wrong for occasional edge cases) is far more valuable.
(To answer your questions: have half an hour's worth of tests, start with purely end-to-end UI tests and convert cases to more unitlike tests as necessary to keep that half hour runtime. Don't ever mock, stub if you must but only after you've tried improving the code so that you don't have to. You already know which parts require more testing and which have been adequately tested, give yourself permission to trust your instincts on that one)
- glenjamin 5y agoHalf an hour is 30 times longer than I want to wait for good quality feedback. I’ll settle for under 5 minutes, but I always shoot for 1 minute. 30 minutes is not really compatible with continuous deployment approaches
- lmm 5y agoIMO a deployment that doesn't contain a user-facing feature is meaningless - so rather than being able to deploy literally every second, you only need to be able to deploy fast enough to make each user-facing feature (which is probably, what, 1/week/developer?) its own deployment. So assuming you have the kind of team size that I think is right (which is a whole other discussion), half an hour is good enough. (I'd still call that continuous deployment, because master is continuously deployed - but you only have feature branches landing in master at a rate of one per 30 minutes). Your test-edit cycle should definitely be much shorter than half an hour, but you don't need to run the full test suite for that.