Read my BDD article in this month’s JS Magazine
June 10, 2009 7 Comments
I have an article on Behaviour Driven Development for JavaScript in June’s edition of the excellent JavaScript Magazine.
If you haven’t seen or read the magazine before (it’s quite new), it’s well worth the few dollars charged. The magazine format allows for in-depth articles that require more space, time and effort to write than a typical blog post, and which therefore often go unwritten.
The thrust of my article is that too much of our JavaScript goes untested, but that nowadays it’s easy to fix that. I go through an example of a client side shopping cart, using the JSpec BDD library. Even if you don’t buy/read the magazine, I highly recommend checking out JSpec and other libraries like it. As JavaScript powered applications become the norm, BDD will only become more important in ensuring our applications work properly, so now is a good time to start.
Also in this month’s issue is a guide to using the Canvas tag, tips on how to use build scripts to optimise your JavaScript for each environment, AJAX security pointers and a roundup of community news.
I bought it just to check out the JSpec portion π very cool
pfft, pay? bah… send me a copy π – Dom
EdI have just ordered the magazine to find out more on you articleI know you do a lot of work on ExtJS. Would this testing library fit well with ExtJS?ThanksAndy
Hi Andy,Yes it fits in well with the more 'model-oriented' bits of ExtJS – i.e. not so much for testing view code.That said, if you had an Ext.Window subclass for example, and some logic that decides what title to use, that logic could be placed into a function in your subclass and tested on its own using this approach.Because so much of out-of-the-box Ext is view-oriented most people have to write their own control code anyway, which is usually the best candidate for testing this way. Ideally, it would all be tested with Selenium or similar too π
Thanks EdExcellent articleI am just exploring what kind of quality processes to introduce to any ExtJs widgets that I build.I was expecting to see a folder with your name on it in the JSMag download. Is there meant to be example code as there is none there?I meant to say I hve read a lot of your ExtJs posts and have learned a lot from your posts. Thanks for these.Andy
I think when you download the issue you can decide to download the full package (.zip file including all the source code), or just the pdf on its own. You can download the issue as often as you like so the option should still be available to you.I have been using JSpec a lot more in my own work since the article was published, largely successfully. I intend to write up a blog post in the near future going through the process of using BDD to create ExtJS components.
ThanksLook forward to the Ext JS and JSpec post