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

That's what unit testing is for? True, and do you understand the trade-offs? Unit testing is far more time consuming than assertions. Moreover, you're forced to write artificially short routines, routines of a length that research has shown to have a higher defect ratio. For myself, I've not yet been convinced that the costs/benefits of unit testing surpass the costs/benefits of assertions, at least when you're a small team working on end user software.


"Moreover, you're forced to write artificially short routines, routines of a length that research has shown to have a higher defect ratio" [citation needed] So far I've only seen advice to write shorter routines.


Indeed, I don't see how smaller, more manageable pieces would be more likely to be defective.


Somebody posted a study which showed, IIRC, that ~150 lines was the optimum length for subroutines. I really should bookmark these things...

EDIT: Hooray for searchyc:

http://news.ycombinator.com/item?id=509978


If you upmodded it, it's bookmarked under the "saved" section of your profile.




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

Search: