The last talk I went to at PyCon on Friday (March 27), I went to Michael Foord’s talk, Functional Testing of Desktop Applications. He used IronPython examples in his demos from his book, IronPython in Action. His primary topic was on testing GUIs and the problems inherently involved thereof. Foord gave lots of good reasons for testing GUIs, such as making sure that new code doesn’t break functionality, it’s massively helpful when refactoring, individual tests act as a spec for the application, it lets you know when a feature is done and tests can drive development.
One of the big issues with working with GUI frameworks is that when you test them, you cannot block the main loop. This can be a pain. Foord’s solution was using the toolkit’s timer objects to pull in and run tests. He also mentioned creating hooks in your application that allow you to instrument it yourself. His slides list various packages that can help with GUI testing, such as WATSUP and guitest, as well as several others. I’m not sure if he has the entire list on his website yet or not, but drop him a line and he’ll probably give it to you.
In the end, I found this to be one of the more informative talks that I went to on Friday. It gave me some ideas on how to implement tests in my own applications. Hopefully these will bear fruit.