Hacker News new | past | comments | ask | show | jobs | submit login

Very cool solution! I've also seen claims that the private methods of modules should not be tested, since they don't represent the public interface of the module and refactorings are likely to change the private methods. If the private methods are complicated enough to warrant testing on their own, ideally they should be extracted into their own module. Not sure if I agree but it's something to think about!



"Private methods of modules should not be tested, since they don't represent the public interface of the module and refactorings are likely to change the private methods"

+1 to that.


What if the private methods are complex but also module-specific? For instance, if they deal with a data type that is private to the module?

When you pull out complex code like this into another module, how do you specify that the new module is actually private to the old module?


(They are very good points though! Thanks for sharing them)




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: