I conceptually divided my testing into two categories (as many practicing TDD do): integration tests and unit tests. A unit test has to check one thing, and I have to be disciplined in testing the only contract that I write at any time - in general, one method requires one test. This makes me write small, tried and tested methods in which I am very confident. This, in turn, leads me to write small test classes.
Integration tests are higher-level tests that prove that interaction problems between components that are otherwise proven will work as expected in isolation through unit tests. I write less, and they need to be applied reasonably, since there can never be full coverage of the integration level. They seek to identify more risky areas of interaction between the various components and may use written acceptance tests as a guide.
Identifying areas that require integration testing is most likely a βfeelingβ. If you have been disciplined regarding unit tests, you should have a good idea where integration tests are needed, i.e. These are areas with deeper call stacks or interprocess communication or the like, where you know there is a higher risk. Or, you may decide that integration tests are a good way to prove high-level behavioral expectations that compare with the written requirements of the product owner. This is also helpful.
source share