This question already has an answer here:
- When should I use mock objects? 4 answers
at company we're developing quite a big project and we're arguing at the testing strategy. The question is: should all of the tests be executed in isolation of external services like database or APIs (facebook etc) or just part of them? Of course what I have in mind is using mockups. We discussed following strategies:
- Write all of the tests in isolation of external services - mock externals everywhere
- Write part of the tests in isolation and create single bigger functional test for every feature that tests it using externals (without mocking anything) - using fixtures
- Run all tests communicating with externals (of course that's never appliable to unit tests so they're out of scope in that case)
I know it can start quite a discussion but I think that's what it is all about, I'd like to find pros and cons that I didn't think of already.