7

Possible Duplicate:
TDD negative experience

I would like to read about negative experience related to developing in the TDD style. Looks like it is very difficult to find this kind of article since Google is filled by positive views. Are there any good articles that reflect the negatives of TDD?

SiberianGuy
  • 4,753
  • 6
  • 34
  • 46
  • 4
    When there's no buy-in. – Anthony Pegram Aug 03 '11 at 18:02
  • 5
    Whenever you have to develop a very small piece of software very quickly. Also, whenever you are writing throw-away code (like when you just want to compute something once). – davidhaskins Aug 03 '11 at 18:09
  • 3
    When it was written by those who failed FizzBuzz but were hired anyway? ;) – Job Aug 03 '11 at 18:35
  • 3
    In my experience about 1 month after it is implemented or whenever the next crunch happens, whichever comes first. The developers just revert to their old habits unless you continually force the issue. – JohnFx Aug 03 '11 at 18:52
  • 5
    TDD is like Communism, it looks like paradise when you read about it but then inevitably some power hungry dictator always ends up ruining it. – maple_shaft Aug 03 '11 at 19:56
  • 1
    We want Stack Exchange to be the repository of knowledge, not a collection of pointers to other sites. Why not just ask about downsides of TDD? If there are relevant articles worth reading out there, they'll emerge in the answers naturally. – Adam Lear Aug 04 '11 at 04:39
  • @Anna Lear, my fault - sorry – SiberianGuy Aug 04 '11 at 06:38

1 Answers1

2

I recently read TDD Is Not An Algorithm Generator! and it reinforced my opinion that TDD doesn't work well when you don't know how to solve the problem. Sometimes you just need to get in and hack around until you get the result you want.

After you know how to solve the problem, you can start fresh with TDD to build the well-tested version you'll eventually commit.

  • Pretty sure you just described the prototype stage (http://en.wikipedia.org/wiki/Prototype) :) (and I agree that TDD doesn't really belong in prototyping) – Demian Brecht Aug 03 '11 at 20:28
  • Lol, it is not enough to put 100 million code monkeys behind typewriters before you end up with the next OS; you also need one QA person to figure out when they should stop re-typing. – Job Aug 03 '11 at 20:49
  • 6
    TDD tells you when the problem is solved, not how to solve it. This is *not* a failure of TDD, anymore than it is the fault of the hammer that it cannot turn a screw. – Steven A. Lowe Aug 03 '11 at 21:01
  • @Steven: Nobody's saying that this is somehow a failure of TDD. This entire question is simply asking when TDD might be the wrong tool for the job. That being said, TDD isn't a "hammer", it's an entire set of assembly instructions; it absolutely *does* try to tell you how to solve the problem ("Red, Green, Refactor") and very often that's not appropriate to the problem at hand. – Aaronaught Aug 03 '11 at 23:29
  • I use TDD during algorithm development. No, it doesn't help with the research. It does help me verify that the algorithm has been written correctly. It helps verify that individual steps of the algorithm have been written correctly. It helps verify that performance improvements haven't introduced bugs. TDD is perhaps most valuable for algorithm development. – kevin cline Aug 03 '11 at 23:50
  • @Aaronaught analogies and metaphors are also hammers – Steven A. Lowe Aug 04 '11 at 01:37
  • @kevin: All of that is true for tests, period. You don't have to follow TDD, you could create your algorithm and write the tests after (which would probably be a lot easier since you don't know at first what the steps or overall design will be). "TDD" does not mean "have tests" it means "tests as tech specs". – Aaronaught Aug 04 '11 at 02:09
  • 1
    @Steven: *Hammers* are hammers. – Aaronaught Aug 04 '11 at 02:11
  • @Aaronaught and people say _I_ take things too literally! – Steven A. Lowe Aug 04 '11 at 03:56
  • @Aaronaught: I won't refactor without tests. – kevin cline Aug 04 '11 at 06:58
  • @kevin: Algorithm development generally does not include refactoring. – Aaronaught Aug 04 '11 at 11:07
  • @Aaronaught - When I develop, every activity includes refactoring. I don't have the magic fingers that can type in perfect working code in the first go. – kevin cline Aug 04 '11 at 15:21
  • @kevin: If the code doesn't already work then you're not "refactoring", you're changing the design. Refactoring means that you are changing the structure but not the behaviour, and in the case of algorithm development, you haven't even established *what the behaviour is* yet. If you want to write a test against a naïve algorithm and use that to verify that your improved one works, that's great, but it is hardly "TDD". – Aaronaught Aug 04 '11 at 15:25