Thursday, November 29, 2007

Frankenstein - Swing Testing Tool

I am a committer on the open source project Frankenstein. Its a swing testing tool. You can go through this presentation by Vivek Prahalad. You can also watch this talk at GTAC to see more about the tool.

The tool came into existence as a necessity on one of the projects at ThoughtWorks. Vivek had done the crux of getting the tool ready. Some cool features:

1) Testing mutli-threaded Swing App without a need for explicit waits due to threading.
2) Identifying all basic components present in AWT, both for playback and recording.,
3) Ability to record and playback both in Ruby as well as Java.
4) Ability to test applets.
5) A fall back naming strategy to identify controls which aren't named appropriately.
6) Assertion API in the driver interface for Thread Safe assertions.

The most important among these which makes tests from being flaky is the implicit waits. One needs to follow a naming convention, which can be obtained from the doc, when naming their Worker Threads which carry out some operation in the background and Frankenstein monitors these threads and waits till they are done. This means there is no need for explicitly adding sleeps in your Swing test code which otherwise makes test very flaky.

One thing to keep in mind is that Frankenstein uses AWT Robot. So, one has to keep the application in focus for the components to be identified.

Currently, I am working on the ability to remotely drive Frankenstein through Java. Frankenstein takes care of bootstrapping your Swing application which means both the testing tool and the application under test will be in the same process. Sometimes, for various reasons you may want the test itself to run in a different process. This is how the Ruby Driver works by default.

If you are interested to know more about this, leave a comment here. Do visit the OpenQA forum. Vivek or I will indeed answer any queries you may have.

3 comments:

Swaroop Murthy said...

1. why is it called Frankenstein?

2. Aren't you somewhat,, betraying TIDE?

Pavan said...

1) Something to do with the name of the project from which this evolved.

2) No. This is just for swing. This is a testing tool. That is a platform.

Anonymous said...

Pavan, please add a link to Vivek's GTAC '07 talk on the project page. The reader is likely to get much better understanding of Frankenstein from the video than from the slideshare presentation.