Michael Feathers in his book "Working Effectively with Legacy Code" (Pearson Education, 2005), chapter 10 about code that is difficult to get under test, first subsection ("The Case of the Hidden Method"):
- "If we need to test a private method, we should make it public. If making it public bothers us, in most cases, it means that our class is doing too much and we ought to fix it".
A nice rule of thumb on the same page:
- "Good design is testable, and design that isn’t testable is bad".
Great book about refactoring legacy code. Lots of practical examples.