by Bokanovsky · 6y ago · 0 comments
I've called this developers out and they often seem to be anti-unit test or against unit tests as they think it slows them down, when in reality the cost of cleaning up afterwards costs more.
When you start writing code with unit tests in mind, you generally follow best practices, and start to realise if a "unit" is too big and needs to be split up into smaller units. That and mocking I've found that the anti-unit test developers I've worked with commonly aren't keen on mocking stuff out either (but again, that's all anecdotally).
Generally I find Fowler's guidance on the test pyramid is always worth considering.
https://martinfowler.com/articles/practical-test-pyramid.htm...
I try and short-cut that steep learning curve by mentoring other developers, but there isn't enough people who have that experience around. I've met lots of programmers, and less than 10% of them have ever even tried TDD, let alone done it enough to gain insight and mentor others.
Plus, if no one ever gets fired for shipping buggy code, why bother working so hard on bug-free code? It's a tradeoff.
You frame this as integration vs unit test, but from the sounds of:
> this has caused severe bugs
and
> aren't keen on mocking stuff out either
My question would be: were the integration tests any good either?