in reply to Re^2: Test::Class modules, skip install
in thread Test::Class modules, skip install

People subclassing your code should look at your distribution for how to test it. In that case, they'll find your test classes.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re^3: Test::Class modules, skip install

Replies are listed 'Best First'.
Re^4: Test::Class modules, skip install
by adrianh (Chancellor) on Jun 07, 2006 at 08:21 UTC
    People subclassing your code should look at your distribution for how to test it.

    Again - I question "should".

    They don't have to look to my distribution to figure out how to code the subclass - why should they need to do so to figure out how to test it? Especially now that testing is a more central part of development for many people.

      They don't have to look to my distribution to figure out how to code the subclass

      Maybe, if the subclasser both is disciplined and doesn't want to do very much (like add new attributes). However, a lot of subclassing involves overriding private methods, adding new attributes, and other potentially invasive procedures. As such, the subclasser will need to read the code in order to understand implementation details.

      Me, I always read the distribution because the distribution may involve OS-specific installation tasks. PDF-Template and Excel-Template both do and I learned that trick by reading other Makefile.PL's. *shrugs*


      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
        Maybe, if the subclasser both is disciplined and doesn't want to do very much (like add new attributes).

        One of the reasons I like inside-out objects :-)

        However, a lot of subclassing involves overriding private methods, adding new attributes, and other potentially invasive procedures. As such, the subclasser will need to read the code in order to understand implementation details.

        If somebody has to read my code before they can subclass something then I've not done my job right. If they have to override private methods then I've really not done my job right.

        (Not that I'm against folk fiddling for fun/good reason - just that it's almost certainly a sign of a design gone wrong)

        Me, I always read the distribution because the distribution may involve OS-specific installation tasks. PDF-Template and Excel-Template both do and I learned that trick by reading other Makefile.PL's. *shrugs*

        I've got nothing against reading the distribution. Do it myself all the time. I'm just questioning whether having test suites be a "distribution only" thing is necessarily always the sensible option.

        Rather than think of test classes as *.t files - only useful at installation time, it sometimes makes sense to look at them as application-specific Test::* modules - of general use to people who use the module.