You have touched on what is probably one of the most overlooked areas of Web-based development. The only commercial solution that I know of anyone using is Silktest. It sounds very powerful, but it's expensive and I've heard a rumor that it's being discontinued.

For an open-source alternative, you may wish to check out Roboweb. It's a few small Perl scripts that are incomplete, but should serve as a nice basis for Web testing. Essentially, you create a proxy server and point your Web browser at it. Then, after entering some basic commands in the browser's address bar to start and stop recording, you browse your application like normal, including filling out fields. The Perl script that acts like a proxy server merely records the traffic and uses them to generate a test suite that runs through Test::Harness. The idea is beautiful in its simplicity and I wish it was taken further (I wish I had the time to do it).

You wrote: Maybe unit-testing is enough? I suspect that this derived from your frustration with integration and acceptance testing in a Web-based environment. However, you put "maybe" in there, so you doubtless know that unit testing isn't enough :)

You might also want to check out http://www.xprogramming.com/software.htm, which has many unit testing frameworks you can download. There are frameworks for Javascript, which Roboweb won't allow you to test.

One note about acceptence testing: these tests are often user-interface tests. User interfaces frequently change and, quite often, they can cause false negatives on a test suite because the interface is correct, the underlying code is correct, but the interface tests wind up needing to be updated to reflect the new interface. This is a problem because ongoing bug-testing and maintenance should primarily be focused on the actual code base, not the tests themselves. A working test should rarely change unless the underlying business rules that it tests are changed. Write the unit tests first and be very careful about how the interface tests are put together. More info on this can be found at http://www.xprogramming.com/testfram.htm.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to Re: Functional testing of CGI apps by Ovid
in thread Functional testing of CGI apps by kappa

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.