|
|
|
|
|
by magicalhippo
433 days ago
|
|
> Unit tests let you change code fearlessly with instant feedback. Sure they can add confidence in making changes. But I've seen they can also give you false confidence. As I said, I can still assemble your perfect Lego bricks together wrong. And you can still change the public behavior while keeping your unit tests passing fine. I've seen both happen in practice. That's why I think integration tests (or whatever you want to call them) give you more bang for your buck. They give you even greater confidence that your stuff works, and generally you can cover a lot more with far fewer tests so improves ROI. The tradeoff is that it can take a bit longer to run. > If you’re doing a lot of mocking then your design is not good. If my app needs to talk to a database, store things in object store, send some messages in a message queue and so on, I can't not mock those things away if I'm to write unit tests. |
|