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

"The only value of tests, at that point, are to protect against regressions."

Which is still extremely important.



In fact, this the key reason that you need to have automated tests. I don't know anyone that commits a new feature without trying it -- be it (conveniently) at a REPL or via some other UI. But the manual "trying it out" method, REPL or otherwise, has always suffered from the fact that it cannot be easily repeated, so old features eventually get broken, and nobody notices. This is why I automate my tests, because their value over time exceeds the extra cost to write them vs. trying it out.

I think this is an aspect that the original article fails to take into account. Eliding tests can feel very liberating, and it allows you to plow ahead adding new features faster. Particularly in small, or at least new, projects. But over time reality catches up, and the lack of tests becomes a burden. You start avoiding adding new features, and particularly improving existing code, out of fear of breaking something. And so you end up more constrained than if you had added the right balance of tests along the way.

Writing software that is maintainable, with staying power of years or decades, requires the sacrifice of some up-front productivity.


Especially if you go back and refactor and/or add new functionality to the code.


Exactly - and it applies to regressions caused by changes in the system (ie: change of platform, of version of the language, security patches etc), not only to changes to your code.




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

Search: