Channels ▼

Mike Riley

Dr. Dobb's Bloggers

Scripting GUI Testing with Ruby Book Review

August 25, 2008

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.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.