Hacker News new | ask | show | jobs
by Aeolun 846 days ago
If I change something at the lowest level in my well abstracted system, only the unit tests for that component will fail, as the tests that ‘use’ that component mock the dependency. As long as the interface between components doesn’t change, you can refactor as much as you want.
1 comments

I prefer having the freedom to change the interface between my components without then having to update large numbers of mocked tests.
Sure, that's a tradeoff that you make. Personally I update my implementations more often than I update the interfaces, so I'm happy to take that hit when modifying the interface in trade for knowing exactly where my implementations break.