There Are Only Integration Tests
dimes.github.io
dimes.github.io
* Unit tests should test functional requirements within the code (i.e. for a given input, this code returns this output)
* Integration tests test the boundaries between systems (eg. libraries, code modules or distinct systems), which is why they are called "integration" tests
* Mocks are a only needed in imperfect world, which is our world usually: incidentally, they should be more common in integration tests, since it's harder to maintain perfect decoupling between distinct components, and you should never mock integration logic under test
* Unit and integration tests are both useful as documentation
* You might need system tests, which test the end-user functional requirements
The fact that unit tests needed dropping or changing as part of refactoring is a given: you are changing interfaces and their functional guarantees. Like the rest of the code, they need refactoring as well.
Considering the example given in the article, this seems to be mostly a misunderstanding of terminology and coupling of components in software.