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

Little late to the party, but I wanted to cross-reference another post from earlier this week: https://news.ycombinator.com/item?id=23749676 (Code Only Says What it Does)

I believe unit and integration tests, apart from checking whether code does what you think it says, it serves both as a sort of executable documentation and, most importantly, it highlights development intent. If you TDD your code iteratively, reflecting not only the unit in your code, but the intent in your tests, you get a much more healthy testing base.

Code coverage is not really a good metric. Intent coverage is more interesting, but a whole lot more subjective and elusive. All in all, tests should be written not with your own self in mind, but with whoever might come later to maintain your code.



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

Search: