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

Breaking the implementation of CountingStack by changing the implementation of Stack is the kind of stuff that unit tests should pick up. It's easy to write a test case for "CountingStack.pushAll() counts once per given element"



Tests are not bullet proof and subtle errors may go uncatched. If you can completely eliminate a source of errors, why not?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: