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

TDD is particularly valuable (I'd even say unavoidable) when writing modules, libraries and so on. It's extremely helpful on some tough program parts that aren't enough defined in behaviour by the spec. Writing tests first in these case will avoid you countless traps, particularly in "the other 90%" as mentioned in the Cargill's law:

    "The first 90 percent of the code accounts for the first
 90 percent of the development time. The remaining 10 percent
 of the code accounts for the other 90 percent of the 
 development time."
    —Tom Cargill, Bell Labs


I can see how TDD could be useful for writing a relatively static piece of code, especially code that is likely to be reused by a lot of people.

But I develop web applications in 1-week sprints for my stakeholders and they're likely to change their mind about what they want at short notice.

In these circumstances it simply doesn't make sense to write tests up front. I don't even have time to write a lot of tests when I'm done :-(




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

Search: