Monday, 5 September 2011

Random Ruby

I recently wrote a post on Atomic Spin about how I've been getting back up to speed with Ruby after a (too) long absence from it.

One thing that the resources I've been reading emphasise is practise so I've been looking for ways to try out Ruby.

So thank you Alan Page and his Numberz Challenge. It's a simple windows app that he's using in his blog articles about test design.

This seemed a good exercise so with the help of Scripted GUI Testing with Ruby I had the app automated.

A few more lines of code and I was able to check the data and find that the numbers used were not random ( #3 came out more than it should ) and the calculation of the total was sometimes incorrect.
Alan has now written an update which shows the app was indeed written to favour 3 and to occasionally get the total wrong.

Looking at the source code would have been an easier way to test - though making your source code available to view can lead to problems if you have a poker app. But even if your source code is not available some people will reverse-engineer your app ( the winner of the Numberz challenge did exactly that ! )

So one blog post shows what lengths testers will go to, gives some testers practice in their new language, nicely illustrates the point about recognising when automation can help - and gets Chris McMahon blogging again ( twice ! )

1 comment:

Anonymous said...

It was a fun exercise.