The Register® — Biting the hand that feeds IT

Feeds

A simple unit test for GUIs

Last time I described why GUI code is difficult to unit test, and why it's generally better to avoid doing so. But that doesn't mean GUI-related code shouldn't be tested - you just need to separate out the logic. Easier said than done? The number of times I've spoken to Java GUI coders who've said: "Swing code can't be unit- …

This topic is closed for new posts.
Thumb Up

Thanks for that!

I've been working with Microsofts Composite UI Application Block and Smart Client Software Factory for a while now, and until this point haven't found a reasonable explanation or demonstration of how to code SmartParts (the panel in you example) and their controllers. I think I now "get it"!

Happy

Humble Dialog Box

A very nice description of the Humble Dialog Box patter as explained by Martin Fowler.

I have no idea what language you are using, but I have had a lot of success using jfcUnit with Java / Swing applications. End up writing unit test that can interact with the GUI.

When I am not using Swing I use the PresentationModel pattern, where I place all the login in the PresentationModel and simply have the GUI connected to the model via binding listeners.

This topic is closed for new posts.