Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is TDD overkill for small projects?

I have been reading quite a bit recently about TDD and such and I'm not quite sold on it just yet.. I make a lot of small hobby projects(just me) and I'm concerned if trying to do TDD is overkill for such a thing. Though I have seen small open source projects with like 3 developers that do TDD. (though I have seen a few one-person projects that also do TDD)

So is TDD always a good thing to do or at what threshold does it make sense to use?

like image 290
Earlz Avatar asked Feb 22 '10 22:02

Earlz


People also ask

When should you not use TDD?

When Not to Use Test Driven Development. Test-driven development can backfire when the environment is not suitable or it is used incorrectly. One should consider these topics when planning to use TDD: Cost of implementing functionality.

Is TDD necessary?

Conclusion. In my personal experience, I've seen many organizations and "professionals" claim that TDD is absolutely necessary for software development, but I've never seen it strictly mandated. It is still up to the developer or team to follow through on it.

Why is TDD not good?

TDD is Time Consuming and Costly, in both Short Term and Long Term. In previous section we've already discussed why TDD is time consuming in short term: you have to spend significant time on refactoring and rewriting your code. But in the long term it will cost more time as well. Remember, test cases are code, too.

Are there any cons with TDD?

TDD disadvantagesForget to run tests frequently. Write too many tests at once. Write tests that are too large. Write tests that are overly trivial.


2 Answers

Small Projects can have a habit of turning into big projects without you realizing, then you wish you'd started with TDD :)

like image 183
Fraser Graham Avatar answered Sep 18 '22 18:09

Fraser Graham


TDD shines in small projects. It's often much easier to adhere to TDD in a small project, and it's a great time to practice and get the discipline required to follow TDD.

In my experience larger projects tend to be the ones that abandon TDD at some threshold. (I'm not suggesting this is a good thing).

I think larger projects tend to abandon it for a couple of reasons:

  • Developer inexperience --- either in general or with TDD
  • Time Constraints --- Larger projects are inherently more complex
    • Added complexity leads to deadline overruns and unit tests tend to get ditched first
    • This can be exacerbated by an inexperienced team
like image 36
hobodave Avatar answered Sep 22 '22 18:09

hobodave