Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chromatic (983)

chromatic
  (email not shown publicly)
http://wgz.org/chromatic/

Blog Information [technorati.com] Profile for chr0matic [technorati.com]

Journal of chromatic (983)

Monday February 16, 2009
03:42 PM

Facts versus Reputation

[ #38494 ]

What language community has a greater reputation for being obsessed with TDD?

Obie: NO, Giles Bowkett (discussing Ruby)

Perl has had a canonical test suite in the core repository and shipped those tests with every source distribution since 1987. As of at least Ruby 1.8.7 (May 2008), this was not true of Ruby.

The third edition of Programming Perl, released in 2000, had a short (less than a page) discussion of Perl's testing modules and the CPAN testing system. The first edition of Programming Ruby, released in 2001, has no mention of testing that I can find.

Test::Builder, written in 2002, allows the existence of hundreds of Perl testing modules which can all work together in the same program to improve testing and the reusability, abstraction, and clarity of test programs. To my knowledge, Ruby has nothing like this.

The CPAN Testers project is nearly 11 years old (May 1998). Every distribution uploaded to the CPAN receives test reports for myriad combinations of operating system and version. The Perl CPAN culture encourages a testing culture, and has done so since before anyone in the US had even heard of Ruby. (Ruby has nothing quite like the CPAN.)

The Perl 6 specification includes a comprehensive test suite; every implementation of Perl 6 must pass this test suite to earn the label of "A conforming Perl 6 implementation". While the Rubinius project has done great work trying to create something similar for Ruby -- and while projects such as JRuby and IronRuby use this suite -- I'm not aware that the MRI developers have the same degree of interest in a comprehensive test suite.

This, then, is one of my persistent gripes with certain vocal members of the Ruby community. While it may be technically correct (the best kind of correct) that the Ruby community has the greatest reputation for testing of any other language community, the facts as I see them seem to contradict such a strong assertion.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Hey, never let facts get in the way of a little hyperbole. ;)

    Perl has had a canonical test suite in the core repository and shipped those tests with every source distribution since 1987. As of at least Ruby 1.8.7 (May 2008), this was not true of Ruby.

    I wouldn't equate a core development team with that language's community. The Perl core team certainly was and is fanatical about testing, but the community? I think they caught up much later. In the case of Ruby we have the opposite situation - the community

    • The Perl core team certainly was and is fanatical about testing, but the community? I think they caught up much later.

      In 2000, CPAN authors had the expectation to write tests. The CPAN client ran those tests when installing modules.

      It's 2009. Does Ruby gems run tests yet?

      Adding features is usually a simple matter of subclassing (with Test::Unit anyway - I don't use RSpec).

      You don't even have to do this with Perl. Someone writes a new test module, once, uploads it to the CPAN, and then everyone can us

      • In 2000, CPAN authors had the expectation to write tests. The CPAN client ran those tests when installing modules.

        Yeah, but I don't know when a real jump was made from running that stock one-test default test file that h2xs generated to people being really good about writing tests. That's hard to know for sure, but I would put it somewhere around 2002. But still, yeah, pretty good.

        You don't even have to do this with Perl. Someone writes a new test module, once, uploads it to the CPAN, and then everyone

        • That's hard to know for sure, but I would put it somewhere around 2002.

          It started in late 2001, but you're probably right that it only became popular and inevitable in 2002. I spent a lot of time in late 2001 avoiding finishing a book and writing tests for the Perl 5 core instead.

          I think the decision to not run them by default is, in part, because of the weakness of Test::Unit 1.x.

          That's what I don't get about the "Rah rah, TDD whee!" cheerleading from some parts of the Ruby community. You might as we

          • That's what I don't get about the "Rah rah, TDD whee!" cheerleading from some parts of the Ruby community. You might as well not write tests if you're not going to run them.

            Yeah, that makes no sense to me either.

    • IMHO most language communities these days are pretty good about testing.

      How good? 200,000 fully automated test reports per month [cpantesters.org] good?

  • Perl's name is mud to most people outside the community (or so it seems), but in my experience, the Java community has a very strong reputation for TDD. It's probably partly because Java is still the defacto language for a lot of new development, and a lot of new stuff tends to focus on modern practices.

    But I do think the testing movement in Perl pre-dates even Java's. One reason why Perl doesn't use xUnit - it wasn't invented when the original test modules were written.

    We all have biases towards our langua

  • I love Perl. I love testing :-)

    That said... while I see a lot of focus on *testing* in Perl. I've not encountered *that* much focus on TDD. They are - as you know - completely different things.

    Now I've not spent huge amount of time with Ruby teams / code bases / community - so I can't say whether they're better or worse. But evidence of testing != evidence of TDD.

    • TDD is all well and good, but if you don't run your tests, you've wasted your time writing them.

      Say what you like about the Perl community, the language, our testing libraries, our culture, or whatever -- but we run our tests.

      • TDD is all well and good, but if you don't run your tests, you've wasted your time writing them.

        No I haven't. I still get the "D" from TDD. I get that even if a third party never runs my tests again.

        I'm not saying running tests is useless. They're not. I'm not saying that the Perl/CPAN testing infrastructure isn't grand. It's fantastic - the best in any language that I've used.

        I'm just saying that it has nothing to do with whether Perl folk do TDD. Because it doesn't. And that was the quote you seemed to

        • As an aside, and in my experience, the Perl/CPAN infrastructure supports testing really well doesn't seem to have any relation to whether teams writing Perl code in the wild do good testing - TDD or not.

          Agreed, but we can measure that neither for Perl nor Ruby.

          Along those lines, I'm sure you have the same experience that I do, that many (if not most) people who claim to do TDD really don't, not in any pervasive fashion.

          Perhaps I've overspoken here, especially claiming that TDD without running the tests is