3 ms·
For the same number of lines of test code, an integration test case traverses through much more source code than a unit test case. Not only that, but it also ch
by cryptica 7y ago
For the same number of lines of test code, an integration test case traverses through much more source code than a unit test case. Not only that, but it also checks that the units are interacting properly and passing each other the right data and returning the right data. Good integration tests can also fee us from static typing because the integration tests implicitly check that the interface contracts between all the different units are met internally. It also verifies many other factors which affect the robustness of the software. For example, they can identify race conditions and prevent them in the future.
- ptx 7y agoTrue, but they're also slower, so you'll have to either test fewer cases or run the tests less often.
- cryptica 7y agoThey are usually slower but they can still be pretty fast. Also, with integration tests, you can choose the granularity of your test. You don't need to test end-to-end (of course this is the slowest), you can just test a single module with all its dependencies. If you don't mock out dependencies, then it's still technically called an integration test.