Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I said this on Reddit but I think it's pretty clear that the "test private methods sometimes" view is correct. Some public APIs make it infeasible to test the code using just the public API, but if you can do that then it's clearly preferable because you won't have to rewrite tests when the implementation changes.

This is a nice overview of the viewpoints anyway.



It's equally clear to some of us that the "don't test private methods" view is correct. But clarity is not consensus.


I think the people that think that just haven't come across a situation where that doesn't work yet. I'd guess there are entire fields where it does work, e.g. crypto or compression.




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

Search: