[PLUG] GUI Development

Rogan Creswick creswick at gmail.com
Wed Jul 5 23:36:52 UTC 2006


On 7/5/06, JOHN F EWING <jkewing9 at msn.com> wrote:
>
> Part two of this question would be how would you test such an application (other > than ad hoc testing, of course)?

Testing should be (roughly) the same under any OS, but some tips:

Java (and other lanugages, I'm sure) has a Robot class that can record
/ playback some verbatim actions at the simplest, and probably allows
for some relatively complex scripting of gui actions.  I haven't done
any of this, but I think it was built with the intent of testing and
automation.  I'd assume it's a pain in the ass, but probably better
than doing all the testing by hand every time you do a new build..

As Larry mentioned, in an OO-capable language you can create an
(extremely simple) interface for each gui widget / portion of the
interface and put all the interface-related logic into a logic class
that uses only the interface you've created to access the actual
widget.  Then implement that interface to pass calls directly through
to the real widget for your application.  At this point it is trivial
to stub the interface in testing code and verify the behavior of the
logic class, and if your interface is simple enough you can rely on
the presumed correctness of the gui toolkit.  (This is all assuming
you have access to some unit testing framework, like nunit, junit, etc
...)

For the situations where this isn't possible (custom components, for
example) keep a list of acceptance tests that must be done by hand.

You can also add a code-coverage tool, but I'm not aware of any that
do much better than line-coverage, which is arguably worse than none.
(Line coverage generates a false sense of security.)  It's probably
not a bad idea to check even line coverage of your test suite once in
a while, just to make sure you've at least tested that well -- just
don't use it as a constant measurement of your progress.

RE: toolkits, I second wxWidgets, but I can't reccomend any gui
building toolkits.  I've tried a number of them for java and met only
serious dissapointment, and I don't have experience with any others...

For what it's worth, Eclipse is the least aggrivating IDE I've used.
It has some fabulous tools for code navigation and java refactoring,
but it does not have a macro recorder...

--Rogan

>
> Thanks in advance ...
>
> -John Ewing
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>



More information about the PLUG mailing list