Tuesday, March 15, 2011

A blogging hiatus

It's been a long time since I've posted to this blog, and a lot has happened since June. When I get a chance I'll try to write down what I've learned about testing. In the meantime, let me say something about what I've been working on: rather than just testing, I've been developing.

Through my company, Mixed Doubles Technology LLC, I've developed the following projects:

  • The tennis-outlook.com web site, which allows both casual tennis fans and serious enthusiasts to visualize the win records of professional tennis champions in the Open Era. The site's companion blog examines current events in professional tennis using data and charts from the site.
  • GoCoord is an Android app that uses GPS to tell you where you are relative to well known locations (waypoints). You can save and organize locations you have visited, enter them manually or import them from a file on your SD card. Then you can see nearby locations as a list sorted by distance, on a map, or on a "scope". The "Distance and Bearing" blog discusses product releases, features and the wider world of location-oriented software and services.

Saturday, June 5, 2010

Introducing VeriPyX: An Integration Testing Framework

For the last couple of months, I've been automating the integration testing of some command line tools, and developing my own framework and philosophy for such testing in tandem. The result is VeriPyX, an open source integration testing framework developed in Python and based on the idea of configuring test definitions as XML documents.


  • It is oriented towards testing free standing executables such as command line tools.

  • It allows for quite complex pre-test setup and post-test validation.

  • It is oriented towards test steps that consume and/or generate files, and need the generated files (including standard output and error) to be validated.

  • Test definitions are expressed in XML, making tests easier to pre-validate allowing you to use standard tools for finding, organizing and transforming tests. This example shows the structure of a test description, divided into setup, body and validate sections.

<test>
<setup>
<copy dir="${root}/data/TestValidate/Store" />
</setup>
<exec
command="Store.py -s Store -f ne > find_result.txt">
<expected status="0" />
</exec>
<validate>
<exec command="sort find_result.txt" >
<expected status="0"
out="TestValidate-expected-out.txt"/>
</exec>
</validate>
</test>
There are lots of things I want to do that VeriPyX doesn't support yet, so please (once again) watch this space ...

Saturday, May 22, 2010

SelAid 1.0.1 Available

I've uploaded SelAid 1.0.1, which adds two new features:
  • Support for option groups in select lists (the HTML OPTGROUP tag): if a select list contains option groups, you can now choose between getting all the options regardless of group, or getting the option groups and then getting the options from within each group.
  • The getElement() accessor: an accessor on most SelAid helper classes that lets you get the underlying WebElement object from the Selenium WebDriver API. For example, you can use SelAid's TableHelper to pull apart a table, and then call getElement() on a TableCellHelper, providing a WebElement to test that cell further.

Saturday, May 15, 2010

Introducing SelAid: Helper Classes for Selenium WebDriver Tests

As I described in an earlier post, I've been exploring WebDriver in the Selenium 2.0 release using the Java bindings. It's turned out to be easy to use, but I found I was repeating a lot of code for testing pretty basic things like tables and forms.

Pretty soon I started to collect the common code into a Java helper library, and it proved so useful to me that I've decided to share it in the form of the SelAid project. There's source code, a JAR and Javadoc with examples, so please try it out.

So far SelAid helps with tables, radio button groups and select lists, but I'll add new features and flesh out existing ones as I need more functionality (or people make suggestions).

Sunday, May 2, 2010

Web site testing: Selenium 2 and WebDriver

One of my new projects (watch this space ...) has a simple web interface. Currently, it's so simple that I can test it by hand after running PyUnit tests on the underlying library, but I have a long list of features I want to add, so I started to think about web testing.

The range of frameworks for web testing is bewildering, but relatively few of them work with AJAX, and AJAX is too important to ignore. It's clear that Selenium is one of the most important of the browser-based frameworks that support AJAX. I tried it over a year ago, and while it's clearly powerful I never bonded with the HTML table based approach to writing tests. The programmatic approach of Selenium RC seemed like an improvement, but I didn't get a chance to work with it.

Recently, I looked at what was happening in the Selenium world, and I found this one year old blog post by Simon Stewart at Google. It described WebDriver, an alternate approach to programmatic web testing, and the fact that WebDriver and Selenium were to be merged into Selenium 2. Indeed, Selenium 2 has been in Alpha since late 2009 and 2.0 Alpha 4 was released on April 22 -- the downloads are here.

While Python bindings don't seem to be available yet, I downloaded the Java bindings and was writing useful tests within an hour. I'll write more about this in the future, but in the meantime here are some links to examples and comments:

Wednesday, April 21, 2010

The nose project

While the PyUnit project was folded into Python 2.1 years ago, there are several active projects that extend that functionality. I'll try to write about the most important ones in the next couple of weeks, but I'll start with what seems to be one of the most active and widely applicable: nose.

Nose extends the basic functionality of the unittest package with improved features for writing, finding and running tests. What's most intriguing is it's plugin architecture, with an ecosystem of third party plugins already built on it.

Michael Foord's Voidspace blog points out a fascinating email thread on the Testing in Python mailing list about the future of the nose framework, where Jason Pellerin points out that nose's LGPL license is keeping some contributors away. I assume that could include plugin developers.

The future of Python unit testing

Michael Foord has an exciting article on unittest2, a free standing release of the replacement for the unittest module in the upcoming Python 2.7 release. You can download it now, and use it with Python 2.4 and later.