If you’ve ever tried to refactor some code only to find that your tests broke (even though you retained the same functionality) then the chances are your tests were tightly coupled to your implementation.
A few days ago I wrote an article on how coupling (when left unchecked) can impact your code. We looked at exceptions and considered the impact of throwing them in one part of your code, to catch them somewhere else.
I had some great feedback on that post and one comment in particular regarding the viability of the delegate approach in a more realistic example.
Let’s remind ourselves where we ended up.