Archive

Test-Driven JavaScript Development book review

I have picked up a new book in Barnes & Noble today called Test-Driven JavaScript Development by Christian Johansen. Until a few years ago, most of the JavaScript books used to be really poor, but it looks like lately, as JS is coming to popularity, we are starting to see some good JavaScript books, and this is definitely one of them.

TDD (test driven development) is usually a technique used by seasoned developers. And this seems to be the case here also. First time I have seen TDD done in JavaScript was from the YUI guys. Since several TDD framework have appeared on the JS scene. (http://docs.jquery.com/QUnit).

Apart from simple to advanced TDD examples, Christian also digs in some complicated JS issues, so this reading becomes inspiring in other ways also. In fact, it almost seems like he likes to talk about really advanced JavaScript issues, and TDD is was just an way to get a book contract, so he wraps his examples into "tests" so that the book would still hold the topic. When I think about this, there is not really much to talk about in TDD, you have to use the right framework, and the just write tests, which are really too specific to talk about in a generic book, so instead the author sidetracks into advanced JavaScript programming issues like cross-browser JavaScript strategies and inheritance patters. Either way, this is great reading if you are still foggy on things like prototypal vs classical inheritance.

I consider doing unit testing in JavaScript a sing of seniority, so TDD is something a guru UI developer should get involved if have not done so.

Comments: