Re:From dependency injection to dependency rejection
by nkohari on Sunday February 05, 2017 @11:04AM
(#13572926)
Best case, you should build both integration tests (the entire system tested together) and unit tests (tests for individual pieces of the system isolated from others). The two types of tests will reveal different flaws in your code. Also, since it's difficult to write unit tests for tightly-coupled code, having a battery of unit tests can also help guide you towards a better overall architecture.
If you're going to write just one kind of tests, you should write integration tests. But, if you have the time to write both, they will pay dividends.
If you're going to write just one kind of tests, you should write integration tests. But, if you have the time to write both, they will pay dividends.