3 ms·
> In order to tests classes in isolation like this, all dependencies must be injected, so they can be stubbed or mocked. This really boils down to which school
by mabbo 6y ago
> In order to tests classes in isolation like this, all dependencies must be injected, so they can be stubbed or mocked.
This really boils down to which school of testing you follow. London (Mockist) vs Detroit/Chicago (Classicist). [0] is a good article on the different views of testing. Made me think more about it.
I find that using fewer mocks, and unit tests that integrate many classes (vs one set of tests for each class) makes Java programming more fun- but it is very much a Detroit school way. And that's okay, but it's good to really think about the differences.
[0]https://medium.com/@adrianbooth/test-driven-development-wars-detroit-vs-london-classicist-vs-mockist-9956c78ae95f https://medium.com/@adrianbooth/test-driven-development-wars...
- flerchin 6y agoGood article/comment. Thanks!