Michael Feathers addresses the question “How do you test private methods?” in The Deep Synergy Between Testability and Good Design. (If you’re stuck in a language with a fetish for compile-time access control on the part of the library writer, you have my sympathy.)

The answer is more interesting than the question. As Michael points out, the desire to test private methods extensively often indicates that he has too much behavior in the class. Other comments suggest that the barrier to creating new classes is too high–we don’t do it often enough.

I’ve often suggested that a major benefit of TDD is that it encourages better design, not only because of YAGNI but because you immediately have to use the API you’re designing. If that’s painful, or awkward, you may need to refactor. Testability is one part of the aesthetic necessary to write good code.