in reply to Re^6: Developing a module, how do you do it ?
in thread Developing a module, how do you do it ?
So the tests are "huge" yet you want to put them at the end of the module, and force perl to parse them each time the module is loaded?
Many of the modules on CPAN have huge .t files, because that's what the tools they use force them into writing. But I don't use tools that require me to write a dozen lines of test code to test one line of code.
And I guarantee that, even with the tests -- which could be Autoloaded if they became a drag on performance -- not one single module of mine takes 1/1000th of the time to load that your Reprove module takes. Not one.
... (just search for the name) ...
So now you've got to invent names for all your tests. Just so you can search for that name to find the test?
That is asinine make-work.
If I use die. It automatically "names" the test, with the file and line number.
In a single line format that my editor (and just about any other programmers editor worthy of the name) knows how to parse right out of the box.
And if I use Carp::cluck or Carp::confess, I get full trace-back, each line of which my (and any) editor knows how to parse.
And if I need to add extra trace to either the tests, or the code under test, in order to track down the route to the failure, I can add it temporarily, without needing to re-write half the test suite to accommodate that temporary trace.
Or I can use Devel::Trace to track the route to the failure; or the debugger; or Devel::Peek or ...
And if I need to pause the test at some point -- for example, so that I can attach a (C-level) debugger -- I can just stick a <STDIN> in there.
Ie. My test methodology allows me full access to all of the debugging tools and methods available. It doesn't force-fit me into a single one-size-fits-all methodology (ack/nack), whilst stealing my input and output, and denying me all the possibilities that entails.
My way is infinitely better.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Developing a module, how do you do it ?
by tobyink (Canon) on Mar 04, 2012 at 07:53 UTC | |
by BrowserUk (Patriarch) on Mar 04, 2012 at 09:51 UTC | |
by tobyink (Canon) on Mar 05, 2012 at 11:24 UTC | |
by BrowserUk (Patriarch) on Mar 05, 2012 at 11:46 UTC | |
|
Re^8: Developing a module, how do you do it ?
by chromatic (Archbishop) on Mar 04, 2012 at 05:48 UTC | |
by BrowserUk (Patriarch) on Mar 04, 2012 at 05:57 UTC | |
by chromatic (Archbishop) on Mar 04, 2012 at 06:57 UTC | |
by BrowserUk (Patriarch) on Mar 04, 2012 at 07:17 UTC |