Re:Write tests. Not too many. Mostly integration
by growse on Friday October 27, 2017 @04:22AM
(#15566590)
Ah, I think I see. If I break the functionality by changing the implementation of a private class, that should be reflected in the public API unit tests.
Re:Write tests. Not too many. Mostly integration
by Marazan on Friday October 27, 2017 @04:34AM
(#15566644)
That's how I see it (in Java at least), unit tests are for guaranteeing that your classes API does what it says it does.
In Python I am more loosely goosey about my unit tests and unit tests there are more for helping me write/think about tricky code.
But people who use your class don't care. They input something in your public methods and expect something in return. The details of what happen inside should not matter. Adding tests there only help to slow you down and make the dev team resist needed changes. And when you add tests you increase the chances you make them useless or wrong.