3 ms·
Integration tests are much more brittle in my experience. A simple test for doing frontend/backend integrations tests with web driver can easily break due to ra
by hmottestad 9y ago
Integration tests are much more brittle in my experience. A simple test for doing frontend/backend integrations tests with web driver can easily break due to race conditions or changes in other parts of the system. Such tests are great for detecting that something is wrong, but it can be very hard to figure out what's wrong and where things went wrong.
Had a lot of "fun" rewriting a bunch of integration tests for angular, because the framework used a lot of Promises which caused race conditions. Those tests were much harder to write than unit tests and were much easier to mess up.
- jondubois 9y agoThey're not necessarily brittle but I know what you mean. When the integration tests reach across multiple services then things tend to get brittle but this can be fixed by stubbing out the external services. Stubs are not just useful for unit tests. Service stubs are often much easier to write than module stubs because services often communicate via string based protocols which are easy to simulate.
- crdoconnor 9y ago>Integration tests are much more brittle in my experience. In my experience brittleness in tests is caused by bugs in tests or bugs in code. Most of these things can be fixed, e.g. * Add an order by to select statements that otherwise returns data in an indeterminate order. * Fix the interpreter/database version you are using to run your code rather than relying upon the version the package manager has installed. * Stub out code that gets date/time/random numbers. * Stubbing out external APIs which go down on Tuesdays. * Fixing the bugs in your code. * Abandoning the code you rely upon which is buggy (I'm just sayin', angular might not be the ideal framework). Avoiding writing these tests because you know that "they'll be too buggy" doesn't exactly send out a great signal. >Such tests are great for detecting that something is wrong, but it can be very hard to figure out what's wrong and where things went wrong. This is alleviated by integrating debugging tools into your test environments.