Do everything in Java…

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 5 12:59:49 PST 2014


On Fri, Dec 05, 2014 at 12:44:17PM -0800, Walter Bright via Digitalmars-d wrote:
> On 12/5/2014 5:41 AM, H. S. Teoh via Digitalmars-d wrote:
> >As for GUI code, I've always been of the opinion that it should be
> >coded in such a way as to be fully scriptable. GUI's that can only
> >operate when given real user input has failed from the start IMO,
> >because not being scriptable also means it's non-automatable
> >(crippled, in my book), but more importantly, it's not auto-testable;
> >you have to hire humans to sit all day repeating the same sequence of
> >mouse clicks just to make sure the latest dev build is still working
> >properly. That's grossly inefficient and a waste of money spent
> >hiring the employee.
> 
> A complementary approach is to have the UI code call "semantic"
> routines that are in non-UI code, and those semantic routines do all
> the semantic work. That minimizes the UI code, and hence the testing
> problem.
> 
> Most GUI apps I've seen mixed up all that code together.

Agreed, but that doesn't address the problem of how to test the GUI code
itself. Modern GUIs are complicated beasts, even in non-semantic code,
and, judging by my admittedly limited experience with GUIs, they sorely
need to be more thoroughly tested.

I had to implement a drag-n-drop function in Javascript once, and the
thing was one big convoluted mess, even after excluding the semantic
part (which in this case is trivial). It left me really longing to have
some kind of unittest framework to verify that later code changes won't
break that fragile tower of cards, but alas, we didn't have any such
framework available.


T

-- 
Try to keep an open mind, but not so open your brain falls out. -- theboz


More information about the Digitalmars-d mailing list