Changing Test::Most (and a note about my OSCON proposals)

After uploading Test::Class::Most, I kept thinking and thinking about the fact that you automatically get strict and warnings with it. I started to think about my annoyance with test suites in general and am now thinking about doing this with Test::Most. I proposed this to Perl-QA and received three positive responses (two offlist) and no negative. It won't import "features" of 5.10, but instead of this:

use strict;
use warnings;
use Test::Most tests => 34;

You can just write:

use Test::Most tests => 34;

... and it's the same thing. I can't recall the last time I've seen a test suite using modern tools and not using strict and warnings, so I think this is a win. chromatic's Modern::Perl is a tiny bit of code but the underlying idea is very important and it's a pattern I'd like to see more of.

In other news, the OSCON Call for Proposals is now closed. I have two proposals in there:

  • Refactoring Enterprise Class Test Suites -- Too Slow, Too Complex, Too Fragile
  • Scratching the 40 Itch of Inheritance with Smalltalk-style Traits

I feel that both of these are very important topics that aren't covered enough. With luck, I'll be in Portland in July (and will be a happily married man at that time).

6 Comments

I'm not so sure encouraging module authors to force use strict upon the calling code is such a good idea. IMO, modules ought not to force onto the code that uses it any other behaviour outside the scope of that module's purpose.

It seems to me that it would be more sensible to encourage perl itself to use strict and warnings by default.

Vigil: maybe so, but the purpose of the ::Most modules is already mostly to bundle up modules commonly needed in tests. Isn’t bundling strict pretty trivially within the scope of that purpose?

Maybe 5.14 could ship a /usr/bin/modernperl

AFAIK, simply "use Test::Most"ing won't change the behaviour of the script itself. For tests, which aren't mission critical by themselves, I would support Ovid's idea, I just wouldn't want someone to think this is a great idea and start adding it to every other module out there that is used in production code (CGI, DBI, etc).

Maybe it could be incorporated into a future perl version, and only used when requested, similar to how we use "use feature ':5.10'". Perhaps that would encourage people to code a bit better - if the only way to get cool new perl features is to make their scripts compliant.

Ovid, I just reread what you said about core. Embarrassing, that!

Leave a comment

About Ovid

user-pic Have Perl; Will Travel. Freelance Perl/Testing/Agile consultant. Photo by http://www.circle23.com/. Warning: that site is not safe for work. The photographer is a good friend of mine, though, and it's appropriate to credit his work.