3 ms·
Why you should test private methods: To make sure they work correctly. This may be significantly easier than testing the public methods that use them. Why you
by SenAnder 3y ago
Why you should test private methods: To make sure they work correctly. This may be significantly easier than testing the public methods that use them.
Why you shouldn't test private methods: Because the implementation might change, obsoleting the tests. But everything might change (except the end-user requirements, haha), so by this argument you shouldn't test anything except what is in the spec/what the user will see.
The only benefit of not testing private methods, is the same benefit that not testing anything else brings.