DEV Community

Discussion on: What are your biggest problems with unit testing?

Collapse
 
primercuervo profile image
Nicolas Cuervo

My biggest challenge has been to get some code that has been untested and which has most methods as private. I've had countless discussion on how to approach this, none of them conclusive.

Collapse
 
miniscruff profile image
miniscruff

Depending on your language you can change them from private to protected and create subclasses for testing.

Or create tests that will invoke the private methods from the public ones. But it could also be other code smells hard to say.