Testing GUI applications, part 2
In the first installment of this series, we outlined what it means to test graphical user interface (GUI) applications, and to what ends that testing is done. (See part 1.) Now we'll apply those abstractions to a model situation that illustrates a handful of the best testing techniques specifically applicable to GUIs.
A sample program
The source code for this article is all written in Tcl/Tk. This is the one GUI binding most likely to be installed and already available on your workstation. There's a good chance you can enter the source code below and run it immediately on your desktop.
# Program 0.
set last_push 0
pack [button .b -text "Push me" -command {
set current_push [clock seconds]
if $last_push {
.l configure -text \
"It has been [expr $current_push - $last_push]\
seconds since the last button push."
} else {
.l configure -text "That was the first button push."
}
set last_push $current_push
}] [label .l]
That is a tiny application with one button, and one textual display updated by the button. It's written in a rather Visual Basic (VB) style of Tcl/Tk.
Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world
jfruh
Apple syncing patent can't come soon enough
pasmith
New Twitter features borrow from 3rd party clients
Esther Schindler
Open Source Changes the Software Acquisition Process
mikelgan
How to set up continuous podcast play on the new iTunes
David Strom
Five important Windows 7 mobility features
sjvn
Guard your Wi-Fi for your own sake
Sandra Henry-Stocker
Grepping on Whole Words
Sidekick: The Good News & the Bad News
Either way you look at it Microsoft Data Center management did not follow standards or best practices in this failure. In which case it makes me wonder more about the outsourcing of corporate data much less personal data.
- mburton325
Join the conversation here
Quick, practical advice for IT pros. Made fresh daily.
Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.












