Re:Zen and the Art of Unit Testing
by adamkl on Wednesday March 15, 2017 @10:10AM
(#13876186)
Take a look at Gary Bernhardt's talk "Boundaries"[1]. It touches on this very topic and was quite the eye-opener for me (having experienced all the same issues you've described).
[1]https://www.destroyallsoftware.com/talks/boundaries