> Does that mean the test scripts are full of "copy/paste coding"?
> So if there is a bug in the test up routine, it would be propagated
> everywhere.

That is indeed potentially the case.  OTOH, once the code works, then
changes to it are intentionally painful.

> It seems reasonable to break with the ideal of "self
> contained tests" a bit and put shared test setup/tearcode code into  
> a re-usable testing module. (which itself might have a single set of
> tests run against it). 

And in many cases we do that as well.  The problem with that is knowing
where the test counts are incremented.

We also have a module TW::Mechanize (TW is our app) that subclasses
WWW::Mechanize and includes TW-specifc object methods.  Now, instead of:

   $mech->get( $url );
   html_ok( $mech->content, "HTML is OK" );

we do

   $mech->get( $url );
   $mech->html_ok( "HTML is OK" );

which means that if we want to do other HTML checking, it's encapsulated
in the html_ok() method.

xoa

-- 
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance

Reply via email to