4 ms·
That's what I was about to say too! But you said it better. :) Unit tests are for standalone modules. Integration tests are for apps. It's definitely good to f
by iainmerrick 9y ago
That's what I was about to say too! But you said it better. :)
Unit tests are for standalone modules. Integration tests are for apps. It's definitely good to factor stuff out into modules where you can, but ultimately you'll still want to check that everything works when it's all hooked up together.
I guess the alternate approach would be writing "mocks" for the submodules, so the higher-level app can be treated as a module itself, and unit tested rather than integration tested. I've found that to be difficult and error-prone compared to integration testing (or normal unit testing for that matter) -- as you say, unexpected interactions between modules can easily fall through the cracks.