"Integration Tests are a Scam" Joe Rainsberger
Topalov Alex @sharkzp
- The larger application the larger amount of time you need to test it.
The more integration(end-to-end) test you wrote the more duplication you involve.
When integration test fails who knows what part of code is broken.
Object under test
Object under test diagram, by Sandi Metz
What does it mean?
Goals of unit tests
Thorough: must prove completely that the single object under test is behaving correctly
Stable: must not break with an implementation detail change
Fast: minimize development feedback loop
Few: Each test should prove one unitary behaviour of public interface
If Unit test intend to test only one object, and integration tests does not provide great feedback what we should do?
Solution: Contact test
Goal of contract test:
1. Thorough: you must prove that contract between two objects behaving correctly
2. Stable: should not say how objects should behave, should expect correct answer instead.
3. Fast: minimize development feedback loop
4. Few: Each test should prove one unitary behaviour of public interface
- J. B. (Joe) Rainsberger - Integration Tests Are a Scam
- Ruby Conf 12 - Boundaries by Gary Bernhardt
- Clean code - Robert C. Martin