4 ms·
>If your code is well-structure You've alluded to the real benefit of end to end tests here, IMHO. They make very few demands about how your code is structured
by pydry 6y ago
>If your code is well-structure
You've alluded to the real benefit of end to end tests here, IMHO. They make very few demands about how your code is structured. This is fantastic if you've just been handed a big ball of mud.
There is a definite trade off between faster running tests and tests which don't need to be rewritten every time you change some code.
- contravariant 6y agoIs that a benefit of end-to-end tests? Seems more like encouraging more unit tests would discourage bad coding habits if anything.
- pydry 6y agoI don't find it does discourage bad coding habits. It just amplifies the problems they cause.
- contravariant 6y agoWell I suppose any form of discouragement is pointless if it is not recognised and acted upon.
- nullsense 6y agoAs always in these discussions I like to remind everyone that you can have good and bad implementations of everything, and just doing unit testing doesn't make your engineers suddenly understand how to write testable code. So, you can well end up in a situation with a reasonable amount of code coverage, but not quite as high as you might like and when someone invariably digs into why they find while parts of the system are testable, parts of the system aren't. Now you're left with a large test suite that provides marginal value because it doesn't give you confidence your code can be deployed if just because it's passing, but the shite engineering practices heavily test implementation details which make maintenance slow to a crawl. Good engineering is what creates good engineering. What you actually do, I suspect matters a lot less.
- contravariant 6y agoYeah there's no silver bullet for any of these problems probably. That said an end-to-end test seems just as likely to merely test implementation details. You could have all kinds of changes in behaviour without necessarily doing anything incorrect. I suppose the point is that you need to test where you can define what correct behaviour is. And if this is only possible for end-to-end tests then something is screwy.