Python Programming, news on the Voidspace Python Projects and all things techie.

Functional Testing of Desktop Applications

emoticon:pencil At PyCon UK I gave a talk on functionally testing GUI applications. Functional testing involves interacting with an application in the same way as the user. After performing actions you assert that the application behaves as expected.

There has been a lot of talk around the testing of websites, and many useful tools including Selenium, Twill, and Windmill. There isn't so much discussion of testing desktop applications - I guess writing desktop applications isn't in fashion.

Since 2006 I've been working at Resolver Systems creating a desktop spreadsheet development environment called Resolver One. My talk is based on my experiences of testing Resolver One, and I've put it online in article form.

You can find the article(s) at:

The article includes a downloadable project with test framework - including example unit tests and functional tests. There is also a two minute video of the Resolver One automated test suite running.

It covers:

  • The why and how of functional testing - including the processes and infrastructure you need around them
  • Basic principles of practical testing
  • Common problems and ways to overcome them

The test framework used is unittest and the example application is written with IronPython and Windows Forms. The principles discussed apply whichever frameworks you are using.

PyCon UK and Metaclasses in Five Minutes

emoticon:test_tubes PyCon UK 2008 is now over. It was exhausting but totally rocked!

On the Saturday I gave a lighting talk: Metaclasses in Five Minutes. I've put it online as an article:

  • Metaclasses in Five Minutes

    Metaclasses have a reputation for being 'deep-black-magic' in Python. The cases where you need them are genuinely rare (unless you program with Zope...), but the basic principles are surprisingly easy to understand.

It was interesting that both Mark Shuttleworth and Ted Leung spoke about the need for Python to adapt to the programming challenges of the future. They both highlighted distributed computing (the cloud) and parallel processing (multi-core) as important. Interestingly Ted Leung also highlighted desktop applications - there are surprisingly few major desktop applications written in Python. (Adobe Lightroom is 40% Lua!)

Another interesting talk was one by Christian Tismer on the work that he and Raymond Hettinger have done recently on Psyco the CPython JIT. The work was sponsored by 'a Los Angeles firm' (probably Fattoc) and is not quite complete - but close enough for a release.

The new work adds newer features (like generators) and more builtin functions to the Python constructs that Psyco is able to speed up. Interestingly, the alternatives for speeding up some of the builtins were to either write custom C versions - or just rewrite in Pure Python and let Psyco JIT as usual...

Oh, and in case you haven't checked out Reddit recently - the Python Sub-Reddit is themed. Smile

Like this post? Digg it or it.

Posted by Fuzzyman on 2008-09-16 16:26:58 | |

Categories: , , Tags: , , ,

On Bad URLs (and a shorter one for this blog)

emoticon:objects The other day I got annoyed with Microsoft's download URLs. For example you download the programmers documentation for Silverlight 2 Beta 2 from:

Bloody awful - and why? How hard would it be to have a sensible and even memorable URL? What's even worse is that the download pages for obsolete components often don't have links to the most up to date version.

I twittered it. To my surprise I had a reply from a Microsoft representative via get satisfaction.

Good feedback for the Download Center team. Thanks.

Impressive. Lots of companies are listening to feedback and providing customer service by Twitter. It is a very good feeling to feel 'listened-to'.

Anyway, it made me realise that the URL to this blog is too long and annoying to say or remember. As a short term solution I've made redirect here. It will certainly fit better onto business cards.

Everytime I use Apache mod_rewrite it makes my head hurt. I have a .htaccess file that adds the www. to requests that omit it (to provide a single canonical URL for every page). It took far too long and all my early attempts worked for but would add an extra to requests for

In the end I settled for a solution that does two redirects for this URL (adding the www. first):

RewriteEngine on
RewriteCond %{HTTP_HOST} ^voidspace\.org\.uk
RewriteRule ^(.*)$$1 [R=permanent,L]

RewriteRule ^blog$ /python/weblog/index.shtml [R=permanent]
RewriteRule ^blog/$ /python/weblog/index.shtml [R=permanent]


I'm now back from PyCon UK. It was great, but I'm knackered. I'll put up the slides from my talks soon - and maybe do a post about the conference if I find time...

Like this post? Digg it or it.

Posted by Fuzzyman on 2008-09-14 22:58:03 | |

Categories: , Tags: , , , , ,

Hosted by Webfaction