Folks, I've read the section in Simon's recent 'Advanced' book on testing and then browsed some of the test packages on CPAN. A bit earlier, I was much impressed by Brian Ingerson's presentation on data-driven testing at YAPC NA. So now I want to include testing in what I write in Perl. Previous testing experiences are in C, no user interfaces. So I have this GUI application in Perl (using the Prima toolkit). Now, what to do to incorporate tests ? I have one monolithic app. Testing in Perl, as far as I saw, has mainly to do with modules. I think I have to decouple the GUI from the program actions in order to produce a module that can be tested using one or many of the methods proposed on CPAN:
use myActions; goButton [ onClick => moduleGo }
But then, when the go button is pressed I have to check out several check boxes for possible options chosen by the user. I could maybe store all of them in variables instead of polling the GUI interface directly and I could feed them to moduleGo(). What do you think ? Would this be roughly the way to go to incorporate testing in a GUI-driven application ? As for me, as you can see, I'm not sure at all on what to do. Is it possible to have global variables that are shared by a module ? If you'd have an example or two about using tests on a GUI application I'd be very glad. Cheers.

In reply to Testing a GUI application by carcassonne

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.