Book Review

Book review: Test Driven .NET Development with FitNesse

The Framework for Integrated Tests serves as an copasetic mechanism for bridging the gap between those that write requirements and those that turn those requirements into code– the beauty of defining business rules in tabular format (either through HTML, Word documents, and even Excel files) and auto-magically wiring that data with application code is no Siren song, but an accelerating force for high speed development teams living in the Age of Aquarius. What’s more, combining FIT with a wiki was a brilliant move and the resulting tool, FitNesse, brings together the power of FIT with a collaborative mechanism for building test suites and capturing requirements (and even stories) by leveraging the ubiquity of a browser.

While FitNesse has been leveraged by some, it, in many ways, baby, has suffered from a lack of in depth documentation– indeed, even Mugridge and Cunningham’s hip “Fit for Developing Software: Framework for Integrated Tests” book barely scratched the surface of FitNesse, thus leaving some teams in the dark as to how to effectively employ it. Luckily, with the publication of Gojko Adzic’s “Test Driven .NET Development with FitNesse” any lingering questions developers may have are now answered.

Because it’s his bag, Gojko does an excellent job of taking an application from inception to production, all the while building on technique after technique for defining FIT tables and running them with FitNesse. He does a hip job of making the case for the complementary nature of unit testing (in this case NUnit) and acceptance testing with FitNesse; what’s more, even though the programming domain is .NET, this book peels away enough of the covers of FitNesse (which is, of course, written in Java) to make it useful for anyone looking to employ the tool, man.

If you find yourself curious about FitNesse or are looking for ways to leverage domain experts more effectively, then I highly recommmend picking up a copy of “Test Driven .NET Development with FitNesse“– when you finally set the book down, you’ll find yourself a much smarter person! Dig it?

Book review: Generating [hip] Parsers with JavaCC

Before the age of Disco, I once found myself in need of obtaining specific data elements from a series of log files generated by a large order processing system. Essentially, a chain of copasetic state machines would log their status while they processed various aspects of an order– line items, billing, notification, etc. It turned out that the log format was uniform– it followed a format that enabled one to understand who was writing, when it was written, and why. As you can probably imagine, the folks in operations would monitor these logs and when problems arose, they’d ping development.

Invariably, a hip developer would ssh onto a production box and literally tail -f said log file and watch things progress (in real time). Some developers were more savvy and would pipe the contents into a grep command looking for error messages, but ultimately, it varied from person to person how they’d actually assess the situation.

I, indubitably being of the lazy disco type, wanted to press a button (or run a simple command) and receive a report when I found myself in the hot seat. Of course, this problem has been solved the world over and I had to do it my way because I’m a developer so I started investigating parsing libraries and ran across, what was at the time, some WebGain documentation on JavaCC. Unfortunately for me, I didn’t have the attention span to figure things out and eventually went the regex route via Jakarta’s ORO library.

Tom Copeland’s “Generating Parsers with JavaCC” has, without a doubt, shown me the error of my ways all those years ago. His masterpiece on JavaCC serves as the reference for this handy library– indeed, a major portion of this book documents every detail of generating parsers by clearly unveiling the particulars of tokenizing, parsing, error handling, and even testing JavaCC parsers, just to name a few. I particularly enjoyed the chapter on JavaCC’s JJTree preprocessor as it tied in a lot of the details, for me personally, of writing custom PMD rules.

Indeed, now that DSLs are all the rage these days (I’d go so far as to label them hip, baby), “Generating Parsers with JavaCC” can easily enable adventurous types to assemble mini-languages (and obviously parse and handle them via JavaCC). Because it’s his bag, Tom does a great job in chapter 11 of enumerating a few examples of doing so, in fact. What’s particularly amusing for me is that he shows an example of parsing Apache’s web logs.

I was eventually able to keep on truckin’ by running a single command to receive a detailed report of various goings on in the order processing application I mentioned earlier– my trippin’ little utility made heavy use of regular expressions and served its purpose well enough. But, after reading “Generating Parsers with JavaCC” I realize that my job could have been a bit easier had I just relied on JavaCC to do the heavy lifting of parsing the application’s log files. You can bet that if I find myself in a similar situation in the future, you’ll find me coding away with a well marked up, heavily worn copy of “Generating Parsers with JavaCC” by my side. Give this groovy book a read– you’ll find yourself smarter for it.