Ford & Mason Ltd
HOME
ABOUT
CONTACT
RESOURCES
ADVERTISING



donations support the development of
cronolog.org
and
refcards.com

next up previous contents index
Next: Testing with the Up: Testing dynamic documents Previous: Testing dynamic documents


Testing in isolation from the server

The server creates an environment in which the CGI script is executed. Wrapper programs or test harnesses can be written to simulate this environment and to execute the script in a controlled manner.

Wrapper programs can simply be ad hoc shell or Perl scripts that set up all the environment variables defined in the CGI specification and call the CGI script to be tested. The wrapper program can be executed, and the output checked, manually. This may suffice for very simple scripts, but for anything more complicated or critical, a more sophisticated test harness may be required.

A test harness which incorporates a system of wrapper programs can be devised, and can be used for regression testing. The expected outputs resulting from specific inputs could be defined, and each stored in a set of files. The wrapper programs might then fetch each set of inputs from a file, invoke the CGI script with those inputs, and compare the outputs from the script with the expected results. Regression testing simply means checking that software continues to function as expected, and that tests previously carried out continue to give the same result. Test systems exist that can be used to automate the process and report on the results.  DejaGNU is one such test system, freely available.


next up previous contents index
Next: Testing with the Up: Testing dynamic documents Previous: Testing dynamic documents

[ITCP]Spinning the Web by Andrew Ford
© 1995 International Thomson Publishing
© 2002 Andrew Ford and Ford & Mason Ltd
Note: this HTML document was generated in December 1994 directly from the LaTeX source files using LaTeX2HTML. It was formatted into our standard page layout using the Template Toolkit. The document is mainly of historical interest as obviously many of the sites mentioned have long since disappeared.

 
Copyright © 1996-2002 Ford & Mason Ltd