Monday, September 28, 2009

Exclusive interview with Mark Crowther

I spoke to Mark Crowther a few months ago about his book An Introduction to Web Test Automation with Selenium & Ruby and agreed to do a review of the first few chapters. When I followed up with comments and feedback we chatted about the project and what follows is some of the main questions and answers that came up during that conversation. I really appreciate Mark's kind behavior and quite encouraging response he responded to all my questions quite patiently.

How long have you been in software testing and what’s your current role?
Just over ten years in software testing and about five in manufacturing QA and testing. My first Test Manager job was with AOL (UK) in London and I was there about 5 years or so. Since then I’ve worked at Electronic Arts and lastminute.com as their Head of QA. My current role is with NMQA a test solutions provider based in London where I’m Head of Testing Practice. That means I’m responsible for anyone in the business who does, thinks, talks or breaths testing.

What’s your testing philosophy?
A take a very context driven, holistic approach to the way I do testing. I rarely deliver a testing engagement or testing to a project in quite the same way. My perspective is that Waterfall, V-Model, Agile, Scrum, etc, and even artefacts such as Test Strategy’s or Bug Reports along with practices such as bug advocacy and reporting are all useful and have a place in the testing world. The way I see it a test professional has to understand all of these so they can participate fully in the test community and respond to project needs in a way that is appropriate and correct. Just saying you’re agile or only manual tester isn’t professional. You face a testing problem you need to pick the right tools.

Who are the testing professionals you admire and why?
Well, James Bach is obviously one because he was the earliest influence on me in terms of challenging me to think about what I was thinking about. Michael Bolton partly because he’s been around forever and partly because I learn something off this guy every single time I read something he’s written. James Lyndsay who teaches Rapid Testing with Michael Bolton, the material he teaches can transform a tester if they’re willing to take the material on board. Elizabeth Hendrickson as she’s a deeply technical, talks constant sense and really seems to contribute a lot to the testing community. Matt Heusser, Bret Pettichord,

What are you currently reading?

I have time for reading? Just kidding! Book wise I’m reading ‘The RSpec Book’ to learn more about that and related items such as BDD and Cucumber. Most of the time I do my reading on the forums to be honest.

In a few sentences how would you describe the book and who is the book written for?
The book is very much a hands-on user’s guide to getting set-up and working with the Selenium tools and using Ruby as the language of choice. The idea is that in a week of sitting with the book at your computer you’ve got a fully open source Selenium-Ruby based automation framework, with a set of template test examples, some neat ideas on how to manage your automation effort and you’re off using it.

The book is a kind of idiots guide or a Selenium-Ruby for Dummies?
Right, think of the book as a manual you’d expect to get if Selenium-Ruby was some kind of software package you bought off a vendor and are now sitting down to install and configure. It’s meant to be step by step with some insights and techniques that’ll help you learn to use the framework. The book assumes you know what testing is but doesn’t assume knowledge of Selenium tools or Ruby.

Can you give me some detail about the book structure and specific examples of what’s covered?
Sure, the book is currently ten chapters and just two chapters are about setting up the Selenium tools of IDE, Remote Control and Grid. We’ve got a chapter dedicated to installing the Ruby language and Ruby Gems we need, getting SciTE and EasyEclipse set-up and making sure Ant and Java are on the system correctly.

There’s a walkthrough of how to use the IDE for rapid prototyping of tests and over two chapters a detailed look at using Grid in various ways. In another chapter we do a code walkthrough of a Selenium-Ruby template script looking at each piece of the script and why it’s there. The book also has a chapter dedicated to creating ten template scripts that cover common testing challenges such as doing cross browser and data driven tests, testing Flash, dynamic content, handling pop-ups and Ajax and also capturing screen shots.

OK, so what would you say the book isn’t? What will a reader not find in there?
It’s not a file by file technical dissection of the tools themselves, I don’t go through scripts and files parsing out the lines of code and looking at how and why it’s programmed in a certain way. There are small amounts of this where relevant to setting up the framework, for example where we look at configurations appearing in the Grid Hub page, but I’m not cracking open jar files just for the technical fun of it.

What new things are in the book that I can’t find elsewhere?
There are three sections within various chapters that are about practices I’ve either developed or employed. They’re related to Test Case Trees, Environment Management and using Pivotal Tracker. I’ve added these to give readers some extra support around their new automation framework. Given there’s no book focused on Selenium-Ruby the whole book is kind of unique and add in it contains ‘fixes’ for common configuration issues there’s a lot there for the tester trying to quickly get the framework in place and move on to doing testing.

Why did you choose to combine Selenium with Ruby? Why not choose Java for example?
I wanted to create a framework based entirely on open source technology and with components that are easy to learn and use. As a tester I don’t consider Java that easy to use, Ruby is easy to read, learn and use and it’s far prettier and efficient, at least in my view!

How much Ruby is there in the book? Does a reader need to be a Ruby guru?
In terms of complexity of coding and use of the language there’s not that much. There’s just enough to complete the templates plus a few neat tricks to show how Ruby can help us in our testing. This isn’t a Ruby programming book, remember the book is a intended to get all the components in place and the reader delivering testing it’s not a Selenium architecture or Ruby course.

Isn’t there already a book or website about Selenium automation?
You’d think so wouldn’t you? In fact there’s not the expected raft of Selenium books out there that you’d expect. If you look over Barnes & Noble, Amazon, etc. there appears to be exactly one about Selenium with Twill. There’s nothing like the book I’ve written as far as I can tell.

What’s been the most difficult for you when writing and researching the book material?
Writing’s been fairly easy, sure it takes forever, but it’s not hard. I’ve also implemented everything I’ve written on a number of client sites and in my test team at NMQA which while sometimes tricky was the real fun part. It helped prove out everything I’ve written too. I’d say the hard or tiring bit has been the research and the disappointment of not getting answers to questions I’ve asked on forums, etc. It just disappointing to put the effort in to work bits out yourself, search for answers online or with colleagues and post questions thinking it’ll be fun to get talking to folks and end up with no replies.

Final question, when can we get a copy and from where?
I’m hunting for a publisher now, the manuscript is ready subject to review and no doubt some rewrites that will be required. I’ll have to ask folks to wait a few months for the publisher to give the book the nod and start making it available. If I get enough knock-backs, as in no interest, I’ll just self-publish via Lulu ready for November or December latest.

Final thoughts before we finish?

You know, this book is really about helping other testers like myself avoid the issues I encountered that might stop them adopting Selenium tools, that might mean they never get to learn about them and use them. I hope folks will enjoy the book and get excited about Selenium and Ruby, I also hope that the Java, C#, Python, etc. Selenium community out there will ‘translate’ the book into examples that apply to their chosen languages.


This interview is reproduced with permission of the author and is copyright Kashif Ali (C) 2009. It is prohibited to reproduce this interview in any form without written permission from the copyright holder. All rights reserved.

3 comments:

  1. Nice ;)

    I've a question, though I'm not sure if Mark can answer this one, but I will take my chances ;)

    1- What's the most difficulty scenario you've come across while automating software using Selenium thus far? Also, how did you handle it?

    2- What Selenium is good at and what Selenium is not good at in your experience?

    3- Did you've to write multi-threaded automated tests using Selenium? Is this discussed in the book? Also, did Ruby play nice in multi-threaded automated tests? Any limitations you came across?

    I will appreciate any insights. Thanks.

    ReplyDelete
  2. Hiya Waqas,

    Thanks for the questions.

    1) The most difficult thing to date was probably dealing with pop-up windows of various kinds. The book addresses these in some detail as they're an absolute killer for the smooth running of an automated test suite.

    It is possible to handle them with some exeception code and essentially 'ignore' them but unexpected pop-ups are a goldmine of information. The basic strategy is to have a seperate script provides ways to manage the the different pop-ups your site may see.

    2) The Selenium tools are great for cross browser, cross platform testing but the Selenium IDE is next to useless except for rapid prototyping of the tests. The Selenese commands are useful for basic browser content checking but for dynamic elements or more dynamic testing you have to use a language such as Ruby.

    3) Essentially no, however now you've asked I see scope for looking at this more closely. There is an example script in the book which is used to show how to test concurrency of a web application. The example rapidly re-runs the same script to test events that are meant to be deterministic and so could encounter race conditions.

    This touches on multi-threaded testing but wasn't specifically geared towards it. It's an area to consider more and think about how the scripts could 'report' to tools that are designed for this. Thanks for the question!

    Issues wise I only saw problems with IE where multiple individual browsers were spawned for each test and never closed when the session was terminated. Could be a nice race condition with IE and/or Vista there!

    Mark.

    ReplyDelete