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

Well yeah that's the view being taken to its logical conclusion here:

- Private methods are just an implementation detail with respect to the public methods. (You really care about whether the public methods reply correctly.)

- Public methods are just an impdet with respect to the module API. (You really care about whether the module's public surface replies correctly.)

- The module's API is JAID with respect to the user/game API. (You really just care about whether the gamer gets the right responses to controller inputs.)

- The user/game API is JAID wrt to the code/gamer interface. (You really just care about whether the gamer likes what you've written.)

- The code/gamer interface is JAID wrt the company/customer interface. (You really just care whether people still give you money.)

- The company/customer interface is JAID wrt the investor/company interface. (You really just care whether the venture throws off more money than you put in.)

Nevertheless, you'd still like to catch the failures as soon and as narrowly as possible!




Absolutes and exaggerated conclusions are no good. As long as a test ensure we do not introduce old bugs (regression) and help me refactor to the point where the time spend writing and maintaining the test is less than I save, then it's golden. I just never had a need to test a private method - I do have to deliever a working piece of code, and unit- and integration tests help me knowing I have met the spec.


Tests that help you fix failures are great - just be sure they're helping more than they're hurting.

Beyond that I think the key is to test the things you don't expect to change. The user always needs to be able to log in. But I expect developers will rearrange the private method boundaries.




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

Search: