0

Yes, I am aware of QUnit, but with the jQuery Paradigm all about getting things done faster with less code, and is this some how opposed to a TDD Paradigm? Or does it complement it somehow?

leeand00
  • 25,510
  • 39
  • 140
  • 297
  • I probably misunderstanding things, but how can getting done faster go against TDD ? – miensol May 05 '10 at 19:57
  • @miensol I love TDD, don't get me wrong. It's just that I'm trying to explain this to someone who doesn't understand TDD, and their problem is that they don't think that TDD actually makes things easier. They've never tried TDD before and they think that it's just more code to maintain, and they don't understand how TDD speeds things up and lessens the amount of maintenance because the Tests are more code. – leeand00 May 05 '10 at 20:28
  • You might want to define TDD for those who have no clue that that TLA stands for (Assume it's Test Driven Development, but can't be sure) – azatoth Jun 10 '10 at 23:49

1 Answers1

1

JQuery itself has great code coverage and the core dev team uses tools like FireUnit and QUnit. As you extend the library writing your own plugins and methods TDD is even MORE critical. How much time do you spend cross-browser testing and verifying each and every change you make? By creating Unit Tests you can write code in confidence and simply run your test suite and get instant results instead of having to fire up all your browsers and test your changes. By running a test suite every view minutes you at most only lose a few minutes of time if something fails versus losing hours or even days if something breaks. Furthermore, if you have your testing harness set up in a CI build using WatiN or something similar you don't even need to launch browsers it's completely automated. So you are correct, writing tests does take time but it's a "pay now or pay later" scenario, and it's a much cheaper investment to "pay now".

TALLBOY
  • 1,079
  • 1
  • 10
  • 13