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

I think it's easy enough to design code that is easy to test - simple single-purpose functions/methods that are self-contained and don't change any global state, etc, and obviously you need to document what the input/output guarantees are, and I would normally add assertions at time of coding to enforce those.

Where you are going to run into difficulty in testing is if your APIs are so complex that it's all but impossible to exercise all code paths by testing with different parameters, or if functions have global side effects (bad practice).



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

Search: