Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

dws (341)

dws
  (email not shown publicly)
http://www.davewsmith.com/

Journal of dws (341)

Tuesday May 10, 2005
08:41 PM

An 8-line start, and then tiny steps

[ #24623 ]

It's surprising how far you can get in one day by starting with

#!/usr/bin/perl -w
use strict;
use Test;
use WWW::Mechanize;

use constant STARTING_URL => 'http://localhost//notyetbuilt.cgi';

my $agent = WWW::Mechanize->new();
$agent->get(STARTING_URL);
ok( $agent->status, 200 );

and then writing just enough CGI code to make that first little test pass, and then by writing the next test, and then writing just enough code to make that pass, and so on. Tiny step by tiny step.

By the end of the day, what looked like two days of work is nearly done, with good functional test coverage. Add unit tests on the other side, as appropriate.

Replace Test with Test::Simple or Test::More as your preferences dictate.

A shout out to Andy for a fine piece of work on WWW::Mechanize, which made quick work of driving form development.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.