Re^4: Modern Perl Programming Highs and Lows
by stvn (Monsignor) on Apr 29, 2009 at 17:35 UTC
|
Is your Test Flavor of the Day worth 17 dependencies?
Short answer, No.
Long answer, I have been using Test::Exception for many years and I honestly don't give it a second thought. I also do not think of it as a "Test Flavor of the Day", but more "the right way to test exception handling with perl" (is there even another one short of rolling my own with eval ?). It is used in a lot of cpan modules already and I kind of assume that it is already installed most everywhere.
| [reply] |
|
|
I kind of assume that it is already installed most everywhere.
There's your mistake. Other than its oddball testing dependencies, Moose is almost self-contained. Why break that, when it's trivial to just skip the relevant tests if Test::Exception isn't installed?
| [reply] |
|
|
Test::Exception's functions are used in 136 test files. If you really want to avoid such a large chunk of the test suite, you might as well not run tests, or ignore the Test::Exception failures. I'm much happier demanding users to install Test::Exception. That we can be sure all the error conditions of Moose fail loudly, not quietly, on each user's machine.
That's not to say we add dependencies on a whim. I added, then quickly removed, a mandatory dependency on Test::Output. We were not using it in more than a few test files, so it was not worth the hassle of a new dependency. We know installing dependencies can suck.
Chris Prather is currently finishing up a blog post justifying each dependency. In general, we'd much rather depend on a solid, tested module than poorly implement half of its functionality.
| [reply] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Just because lots of modules appear under Test::Exception in the CPANdeps tree (which, incidentally, you should link to as deps.cpantesters.org, not cpandeps.cantrell.org.uk) doesn't mean that they're only required because of Test::Exception.
Each distribution in the dependency tree is listed only once, so if, for example, Module::Build is required for both Test::Exception and Class::MOP, then it will only get listed under whichever 'parent' module I come across first when grovelling over the dependency tree.
| [reply] |
|
|
(which, incidentally, you should link to as deps.cpantesters.org, not cpandeps.cantrell.org.uk)
My bad -- Dave Cantrell's site is still ahead in the Google results for "cpandeps."
And you still lose.
| [reply] |
Re^4: Modern Perl Programming Highs and Lows
by chromatic (Archbishop) on Apr 30, 2009 at 00:18 UTC
|
Where do you see that Test::Exception has 17 dependencies? Its only non-core dependency is Sub::Uplevel, which has no non-core dependencies.
| [reply] |
|
|
Did you bother to click on the link? It looks like 7 of 17 dependencies are non-core, but maybe you and cpandeps have different definitions of "core."
| [reply] |
|
|
| [reply] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You're both right, sort of.
The latest Test::Exception depends on a minimum of (for example) Test::More 0.70, which is only in core if you are running perl 5.10.
| [reply] |