Book review - JavaScript Testing

Reviewing Packt's latest offering on JavaScript testing. Ninja lore or newbie lark? Find out here!

Book-jstesting

Before we start off, I must admit to my purchase being a badly researched one. I saw the title of this book glancing by in a Packt ("Since you bought X you might be interested in Y") email, and clicked the Purchase button before realising that this book has absolutely nothing to do with Test-driven JavaScript Development that I was really setting out to buy. However, aspiring to be well versed in JavaScript literature in general because of the JavaScript course I hold at Linnaeus University, I didn't cancel my order. Had I bothered to read through the Table of Contents more throroughly, I would have.

JavaScript Testing - A Beginner's Guide, by Liang Yuxian Eugene, is a very strange beast. It assumes no prior knowledge whatsoever, and so sets out to explaining everything from basic JavaScript syntax and programming paradigms (without separating the two) to how JavaScript fits together with HTML and CSS. All this is done with a focus on testing, but taking care to explain everything as it goes along. This makes for a very peculiar read for newbie and ninja alike.

Mundane content aside, the book is very verbose, to the point of the forest being lost among the trees. For example, the author spends an entire page (chapter 3, page 95) explaining how to fix the "error" of JSLint complaining about "unexpected use of ++". Not with a discussion about the pros and cons, but by repeating a huge chunk of code, the first using ++, then changed to +1. There are definitely times when being verbose helps getting the point across, especially when trying to communicate the basics of a paradigm new to the receiver. What's going on here, however, is pure page bloat. Considering that the book is only 250 pages total, that does not paint a flattering picture of the weight of the actual content.

The book is also suffering from the usual Packt flaws;

  • The typesetting is really strange. I realise that smarter people than me has considered the made choices, but I'll never get used to the strangely fat, seriff-lacking font used for the basic text.
  • Since they often have several headlines on each page, the bloated Table of Contents is rather useless, providing no overview. I really miss Apress' "Contents at a Glance" concept, which is sorely needed here.

In all fairness, the book does has some merits. The testing focus equips the reader with a good set of best practices, building up a good workflow which makes for less headaches during development. I gave the book flak for being too verbose, but I guess you could also argue that it is rigorous.

There is, however, nothing in there for the more advanced reader (which the subtitle "Beginner's Guide" partly excuses, but nevertheless). Unit testing gets a brief mention, but in a context that makes it seems rather periferal. Debugging with alert, if you judge by the number of devoted pages, is much more important according to this book.

I feel the basic problem with the book is the premise - it targets a complete novice, aiming to teach him JavaScript, programming and development planning, all done with a focus on "testing". But, if you don't know some or any of these field, the content in this book is nowhere near enough. And if you DO know them, and just want to hone your testing skills and mindset, the avalanche of superfluous information will keep you from doing so.

To conclude: there are some good advice in there, but they would come more to their right as a (much) shorter tutorial article.

Posted by David Waller 

0 comments

Leave a comment...