I know some people are massive proponents of test driven development. I have used unit tests in the past, but only to test operations that can be tested easily or which I believe will quite possibly be correct. Complete or near complete code coverage sounds like it would take a lot of time.What projects do you use test-driven development for? Do you only use it for projects above a certain size?Should I be using it or not? Convince me!
Test driven development - convince me!
programming practices;unit testing;tdd
Ok, some advantages to TDD:It means you end up with more tests.  Everyone likes having tests, but few people like writing them.  Building test-writing into your development flow means you end up with more tests.Writing to a test forces you to think about the testability of your design, and testable design is almost always better design.  It's not entirely clear to me why this happens to be the case, but my experience and that of most TDD evangelists seems to bear it out.Here's a study saying that although TDD takes a bit longer to write, there's a good return on investment because you get higher quality code, and therefore fewer bugs to fix.It gives you confidence in refactoring.  It's a great feeling to be able to change one system without worrying about breaking everything else because it's pretty well covered by unit tests.You almost never get a repeat bug, since every one you find should get a test before it gets a fix.You asked to be convinced, so these were benefits.  See this question for a more balanced view.