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

> #2 contradicts itself. It says that unit tests will make sure that code that already works doesn’t break but at the same time it won't help writing good code.

No, the only thing you can say about the quality of code through tests is that if you change some code and it still passes the tests, then you didn't break it. The tests say absolutely nothing else, because their output is binary - pass or fail. They say nothing about the efficiency, readbility, complexity, or style of the tested code.

Tests can help take you from broken code to working code, and not a step further. To make it good code, you have to look at the code, not the tests.



Technically, you only know you didn't break the tests.

But assuming well thought-out tests, that's a good indication that you haven't broken the code.




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

Search: