2 ms·
> the most effective use of developer resources may be to just test your private method. While there is nothing wrong with testing an internal function if it h
by randomdata 3y ago
> the most effective use of developer resources may be to just test your private method.
While there is nothing wrong with testing an internal function if it helps with development, so long as it clearly identifiable as such, you still need the public interface tests to ensure that the documented API is still conformant when the internals are modified. Remember that public tests are not for you, they are for future developers.
This is where Go did a nice job with testing. It provides native language support for "public" and "private" tests, identifying to future developers which can be deleted as implementation evolves and which must remain no matter what happens to the underlying implementation.