From: David Masover Date: 2008-08-17T02:48:37+09:00 Subject: Re: BDD and TDD - What are they for? On Saturday 16 August 2008 08:54:28 Eleanor McHugh wrote: > But tests are only as good as the analysis which goes into them > and can very quickly become redundant when working on greenfield > projects with very loose requirements. I would say that such a project is very much in need of some requirements, even informal ones. > They're also as prone to error > as any other code so beyond a certain level of complexity it's not > entirely obvious that they improve code quality rather than hindering > it. Well, I don't really see how they could hinder it... And you're right -- they are prone to error. But the point of a test is to make error noisy -- generally, when you have a bug in your test, you'll know about it very quickly. In fact, TDD suggests that you write the failing test first. That implies that your test has to be at least half-right, when written -- it has to fail. It also implies that by the time a test and its corresponding code has been accepted, the test has failed on at least one case where there was a problem with the code, and succeeded on at least one case where the code is believed to be correct. It's not infallible, no, but it is much better than nothing. And as I said in my other post, certainly by the time you get to integration testing, either you're going to be doing it by hand, or you're going to have it automated. Which would you prefer? > That said, everyone seems to love them so they must have some value. Wrong attitude, and, frankly, Godwinbait. (Everyone seemed to love the Nazis! Did they have some value?) Certainly, if everyone loves them, you should take a second look. But if you really can't find any value in them, it might not be you. It might be that there really is no value in them. I think tests are good and useful, but I don't want you or anyone to be so easily led. The truth is what it is, no matter what other people believe.