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

I disagree, the right place is in the code where the functionality is defined. And the comment you replied to i didn't read as "assertions instead of tests". That's absurd. You should have tests that exercise the code that contains the assertions. It's the best of both worlds. You get code automatically tested and you get inline documentation that can't lie to you.


I say code the happy path, and then have assertions.

Saves writing 12 unit tests that show passing null breaks the code. No one cares about that.




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

Search: