Subject: Re: Kwalitee and has_test_*
From: David Golden <[EMAIL PROTECTED]>
Date: Thu, 07 Apr 2005 14:34:21 -0400

}What if I, as a developer, choose to run test as part of my development
}but don't ship them.  Why should I make users have to spent time waiting
}for my test suite to run?

Let's extend that argument a bit - I have two platforms I can test my 
module on - a Linux single-processor CPU and an OSX Panther system.  Both 
are only running one version of Perl (although I could do more, I just 
don't), and both are set up sane (to me).  I run my test suite on both 
before I ship my module off to CPAN.  No problems, right?

Except that my module might run on a Solaris box, or a Windows box, or any
number of alternate platforms, perls and environments that I cannot
envision right now.  The only reliable method a sysadmin has to find out
if the program is doing what the author intended is through some form test 
suite or through other people reporting their successful builds (e.g. how 
djb asks people to mail him a SYSDEPS file on successful install).

If I write something, I also want to make sure that if I receive a bug 
report, it's a real bug and not an environmental bug.  Having a test suite 
gives me a controlled environment in which I can (hopefully) reproduce a 
simple enough test to indicate what's wrong.

}The flip side, of course, is that by including test that are necessary
}for CPANTS, a developer inflicts them on everyone who uses the code.

As a sysadmin, I'd rather spend an extra 5 minutes (or even 5 hours) 
running a regression/testing suite to make sure it doesn't break something 
else than to have a surprise foisted on me at the least inopportune 
moment.  The only reason I really see D::C as not being appropriate for 
"make test" is because it's not a binary - it's more of a fuzzy "how 
much", which people will interpret differently and which may have no 
bearing on how the program operates.

}Counter:  developers should take responsibility for ensuring portability
}instead of hoping it works unti some user breaks it.

It's not just portability.  Should the module I wrote and tested on 5.6.1 
work on 5.8.6?  How about 5.005_04?  CPAN doesn't have a by-perl-rev 
repository for modules, and maintaining one would be a nightmare, at best.


I agree with your stance on Kwalitee.  I think it's important to 
understand that the presence of tests in the first place puts us light 
years ahead of many other systems.  Imagine if you had a full test suite 
(or even a partial) for Windows, or the Linux kernel, etc.  Sure, those 
things aren't necessarily public right now, but if I had a hardware-level 
test suite that simulated what I was actually doing, I could find out much 
quicker if that new stick of RAM I put in my computer was going to cause 
unexpected behavior.

-Pete K
-- 
Pete Krawczyk
  perl at bsod dot net


Reply via email to