4 ms·
My take: private methods are not _designed_ they are _extracted_. Therefore, for the purposes of demonstrating/articulating what I mean - with "Proper TDD™" I
by Jenk 5y ago
My take: private methods are not _designed_ they are _extracted_.
Therefore, for the purposes of demonstrating/articulating what I mean - with "Proper TDD™" I am always at a state during the Red and Green stages, that there is no private method to test. They just don't exist, because I have thus far only done the simplest possible thing to pass the test. (This is the same course of events when I am not using tdd.)
After the Refactor there might be some private methods, but they will already be covered.
As for the API argument, if you don't want implementation exposed, then don't expose the class. This is what Interfaces are for. Need to expose a class? Then make a "contract" class such that the stuff you don't want exposed isn't.