cg-eye

A test suite for HTTP and CGI development

cg-eye

cg-eye is a test harness for HTTP and CGI. It may be used as an intermediate stage between running your software from the commandline and putting it online, and will diagnose a number of potential problems.

cg-eye has three components:

cg-eye offline

A test harness to simulate a CGI environment offline, without the need for a browser or HTTP server. See also Tom Christiansen's Idiot's Guide.

cg-eye interactive

An online harness to specify an HTTP request to send to your server and print diagnostics on the server's response. See also brian d foy's httpeek.

cg-eye live

An online harness to intercept a request from a browser (normally generated "live" from an HTML form) and forward it to your server. Details of both the Request and the server's Response are printed. See also Nick Kew's Header Dumper.

Developing a simple CGI program

  1. Make sure your program runs OK from the commandline.

  2. If it's anything more complicated than HelloWorld, use the offline facilities of a library such as CGI++ or CGI.pm to run tests.

  3. Run the program under cg-eye offline, and take note of anything it tells you.

  4. If your development machine is different from the webserver, you'll need to repeat at least the first step on the webserver itself. If your program requires data files or external programs, make sure you have enough test cases to include accessing them.

  5. Check the program via HTTP using cg-eye interactive.

  6. Check the program with your form(s) using cg-eye live.

  7. Tell me if you find a problem you think cg-eye should have identified but didn't.

For non-trivial programs you should of course use development methods appropriate to your project.

Further Help

Please see the CGI Programming FAQ (and other resources referenced therein) before asking for help. Try the newsgroup comp.infosystems.www.authoring.cgi, and the comp.infosystems.www.servers.* hierarchy. Note that the author will normally answer emailed programming questions if and only if you are paying.

Related Products and Services

See WebÞing's cg-eye pages if you are interested in running your own copy of cg-eye or if you would like to commission a related product or service. An enhanced cg-eye suite will also be included with CGI++ Professional if and when that is commercially released.

Discussion

Comments to nick@htmlhelp.org. If there's interest, I will open a cg-eye discussion forum at htmlhelp.org or webthing.com.