Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2005

Tip: Looking for answers? Try searching our database.

Testing Swing GUIs

Thread view: 
Berlin  Brown - 19 Jul 2005 13:17 GMT
What are some ways to unit test a GUI application.  For example, I have
an application that is driven by the interface, meaning all the logic
is in the widgets.   I am not used to GUI development.  The only way I
can think of testing the system is by looking at it and seeing if
everything is where it is supposed to be.

What are approaches out there?
Thomas Weidenfeller - 19 Jul 2005 14:28 GMT
Berlin Brown wrote:
> What are some ways to unit test a GUI application.  For example, I have
> an application that is driven by the interface, meaning all the logic
[quoted text clipped - 3 lines]
>
> What are approaches out there?

Automatic GUI testing is rather hard. Record/playback tools just bring
you to a certain point, and many fail if you do slight adjustments in
the GUI. Meaning that you have to record a new test case after a small
change. This can become very frustrating, particular if you have complex
test cases. Plan for a lot of time going into this.

The tools usually center around java.awt.Robot. If you feel adventurous,
you can run your own, based on that class (not recommended). Other tools
work still below the visible GUI and e.g. feed the event queue.

The following are free tools which I am aware of (I have no in-depth
experience with any of these):

http://marathonman.sourceforge.net/
http://jemmy.netbeans.org/
http://abbot.sourceforge.net/
http://jfcunit.sourceforge.net/

/Thomas

Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

Ramza Brown - 19 Jul 2005 14:54 GMT
> Berlin Brown wrote:
>
[quoted text clipped - 25 lines]
>
> /Thomas

These look interesting.
Ramza Brown - 19 Jul 2005 14:57 GMT
>> Berlin Brown wrote:
>>
[quoted text clipped - 28 lines]
>
> These look interesting.
Thomas Hawtin - 19 Jul 2005 15:49 GMT
Berlin Brown wrote:
> What are some ways to unit test a GUI application.  For example, I have
> an application that is driven by the interface, meaning all the logic
[quoted text clipped - 3 lines]
>
> What are approaches out there?

While automated GUI testing tools are useful, I think it is useful to
separate out the widget code into the thinest possible layer. The bulk
of your code will then be much easier to test. You'll also end up with
higher quality code.

Tom Hawtin
Signature

Unemployed English Java programmer



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.