Wednesday, June 10, 2009

Being a practicing Ruby developer and avid TDDer, there are two things I like at my side when learning something new: an interactive shell and a testing framework.

JS Test Driver may suit my needs for testing (still working on that one). And lo and behold, an interactive shell does exist for JS: Mozilla's Javascript Shell. Despite not being exceptionally convenient to install (as it requires a full build of SpiderMonkey), the shell looks promising so far, particularly to someone who is still exploring the nuances of javascript.

Javascript, Anyone?

In what is now a couple of years of Ruby programming, I'm a little embarrassed to admit how little I know about javascript. The fact is I've used it extremely little in my current work - that is, until now. My team has inherited a project full of js - tangly, untested, js that inhabits every corner of the application.

So I'm doing what I can to get up to speed. I'm starting way back in the beginning with a Head First Javascript book. Most of the first 100 pages have been relatively useful, if extremely fundamental. These books assume you know almost nothing about programming, but they've still managed to get across some of the principals I've been lacking.

In doing the rudimentary exercises described in the book I've found myself craving some sort of testing framework. Javascript is a real language with real, testable code, and a storied history of nightmarish debugging when things go haywire. So why not test drive this code? Until now I've always believed that Selenium would be the answer to any javascript testing needs. But I'm curious to see what incrementally developing with JS unit tests will get me.

I've heard of JS Test Driver and I've spent some time playing around with the framework. I like what I see so far, but I'm coming up short on documentation or other blogs and helpful information beyond the "Getting Started" stage. I'll be on the lookout for these over the next few days, and in the mean time I'll try to post what I learn so maybe others will benefit.