Re:Still no consensus on testing private methods
by magicalhippo on Thursday March 10, 2022 @07:17PM
(#30634472)
> private methods are part of an internal API for the class that is used by your future self and coauthors
Indeed. In a good code, one could say it's libraries all the way down.
For example, I've refactored a lot of business code such that it can be easily re-used in different parts of our application. Ta-da, I effectively have created a piece of library code, and I'll want to write tests for it to make sure it doesn't break any consumers, current or future.
Indeed. In a good code, one could say it's libraries all the way down.
For example, I've refactored a lot of business code such that it can be easily re-used in different parts of our application. Ta-da, I effectively have created a piece of library code, and I'll want to write tests for it to make sure it doesn't break any consumers, current or future.