Skip to content

re: It’s Okay to Test Private Methods VIEW POST

re: If you have properly architectured your code you wont need to test private methods. For example if I have a class which is responsible for creatin...

This is another argument I hear a lot, and I don’t think it’s always that simple. Busting out a new class every time you want to test something feels like an anti-pattern. At least from a Java perspective, that could generate a lot of files which forces you to maintain some sort of mental record of what they all do.

That said, I agree with the sentiment. I just don’t think it’s always the best course of action.

code of conduct - report abuse