Mobile // Mobile Applications
12:00 AM

Scripting GUI Testing with Ruby Book Review

After listening to a Pragmatic Podcast featuring the book's author, Ian Dees, I had high expectations to learn from his experiences.

After listening to a Pragmatic Podcast featuring the book's author, Ian Dees, I had high expectations to learn from his experiences.

Unfortunately, I wish Ian would have disclosed a bit more in his podcast interview, such as the fact that a majority of the book is focused on testing GUI-based applications for the Windows platform, with only one chapter discussing testing browser-based applications, a few pages on testing Mac OSX GUI apps and not a word about Linux or even fellow Pragmatic Bookshelf's fxRuby GUI toolkit for Ruby itself.  Additionally, I have used a number of commercial testing tools over the years and served as a Jolt judge for the last three years and have seen a number of approaches to address this important and challenging testing requirement.  There was little additional insight I learned reading Ian's book.

 The book begins with the author's advocacy of RSpec, a pure Ruby implementation of the Behavior Driven Development (BDD) methodology.  Using the Ruby COM bridge and the Windows API to hook into Windows handles (as well as a custom Java application hooking into JRuby), Ian demonstrates over the next four chapters how to leverage the RSpec syntax to control and test an open source Windows GUI-based text editor called LockNote. Over the course of 70+ pages, syntax is mixed with teaching the fundamentals of effective GUI application testing.  For readers unfamiliar with the topic, these hints can be revealing, though for anyone who has performed such testing in the past, there's not much new here.

The second half of the book contains six chapters ranging from testing the application by applying random events, applying matrix tables and such.  The chapter on web application testing was one I wished the author had dedicated much more space to, exploring not only the open source Ruby-based proxy testing tool he advocates using called Selenium ("gem install Selenium"), but also using the various Javascript and AJAX frameworks from Dojo to Scriptaculous.  Alas, only 4 pages of brief examples are partitioned to this topic.  The book concludes with the discussion of a recent RSpec addition called Story Runner designed primarily for user acceptance testing scenarios.  There are a couple of attractive features that Story Runner brings to the GUI testing world, the most powerful being its very easy to follow English sentence-like  syntax that invites participation from problem domain experts who lack copious Ruby coding experience.  Finally, the book's last chapter briefly touches on testing GUI applications on the OSX platform by enabling the operating system's "assistive devices" option in OSX's System Preferences and driving GUI events via AppleScript.  Two appendixes on "Other Windows Techniques" and "Resources" round out the book.

Overall, Scripted GUI Testing with Ruby was a bit of a letdown.  What Pragmatic Bookshelf is asking $34.95US for what could essentially qualify as an appendix in the next revision of the Pick Axe book is unfortunate.  Perhaps if there is a 2nd edition, the author can explore deeper GUI testing opportunities beyond the Windows desktop.

Comment  | 
Print  | 
More Insights
Building A Mobile Business Mindset
Building A Mobile Business Mindset
Among 688 respondents, 46% have deployed mobile apps, with an additional 24% planning to in the next year. Soon all apps will look like mobile apps and it's past time for those with no plans to get cracking.
Register for InformationWeek Newsletters
White Papers
Current Issue
InformationWeek Tech Digest, Dec. 9, 2014
Apps will make or break the tablet as a work device, but don't shortchange critical factors related to hardware, security, peripherals, and integration.
Twitter Feed
InformationWeek Radio
Archived InformationWeek Radio
Join us for a roundup of the top stories on for the week of January 18, 2015.
Sponsored Live Streaming Video
Everything You've Been Told About Mobility Is Wrong
Attend this video symposium with Sean Wisdom, Global Director of Mobility Solutions, and learn about how you can harness powerful new products to mobilize your business potential.