Search code examples
unit-testingtestingintegration-testingfunctional-testing

What value would I get from integration tests when I already write unit tests and functional tests


We have a web application (using Grails/Groovy) and we write unit tests and functional tests.

However, we are not writing integration tests.

With unit tests, we can catch some small issues and also, it helps us writing our codebase in modular, short and readable fashion.

Functional tests obviously helps us to know when a feature is broken.

What would be get from writing integration tests? What would be the benefits of the extra time spent writing these tests?


Solution

  • The question is "What would be get from writing integration tests? What would be the benefits of the extra time spent writing these tests?"

    Your integration tests will ensure that your components work together with cross cutting concerns such as web services, db, session etc. You only need only few integration tests - As @bagheera's comment on TestPyramid. Be aware how you write integration tests because if you go overboard, it can really slow to run all of them, and harder to work with. When you compare them to Unit Tests, you don't get much benefit of writing them.

    Addtional : You need lot of Unit Tests - you already have this and it is a good sign. You don't want tests in between this, which is called "dirty hybrids" http://blog.stevensanderson.com/2009/08/24/writing-great-unit-tests-best-and-worst-practises/