Hacker News new | past | comments | ask | show | jobs | submit login
Fun Numbers - Ruby and Perl (Massive difference in core test suite size) (perl.org)
24 points by draegtun on April 17, 2009 | hide | past | favorite | 12 comments



I doubt that Ruby is so feature poor to justify Perl having more than 50 tests for every 1 of Ruby's.

Perhaps Ruby isn't "feature poor". Perhaps Perl is "edge-case rich".

The language is rather complex. Browsing at random through the dreaded Camel Book, here are some things I find, in no particular order: a goto statement with three forms (page 105), typeglobs (pg 115), explicit syntax for references (pg 116), a text-formatting mechanism in core (pg 121), expressions that evaluate completely differently in "scalar context" vs "list context" (pg 45), taint mode (pg 357)...

A more fundamental question is: Where do these numbers come from? And an even more fundamental question is: Since when did counting tests prove anything? Isn't that just like counting lines of code, or counting the number of bugs that have had to be fixed? (Give me a day or two and I'll double the raw number of Ruby's tests! I'll just add more assertions!)


The difference in how values are treated alone is enough to quintuple the test cases. :)


Perhaps they should add RubySpec then come back with those numbers. IIRC, there's somewhere in the neighborhood of 50,000 assertions in there and growing everyday.

Unlike Perl, Ruby has elected to make these specs an open community process usable across all implementations. Oops.


Does the regular Ruby use RubySpec when you run "make test" or such?

Perl 6 does separate the specification from the implementations.


Yes.

http://svn.ruby-lang.org/repos/ruby/trunk/Makefile.in

Find "test-rubyspec".

It even `git clone`s rubyspec if you ask it to (update-rubyspec).


Thanks, good to know.


Now, granted early 1.8's tests were sparse. RubySpec is a by-product of the alternative implementations and a couple of test attempts (http://blog.headius.com/2008/05/rubyspec-bringing-ruby-test-...).

A lot of developers continue to use MRI 1.8 despite 1.9.1 being out due to API changes. So you could still make the case that the main interpreter being used was at one point not well tested. However, forward progress in the language is tested, so there's nothing really to be remedied.


Talk about flame-bait.

I'm not sure who they're arguing with here. Developers that write code in Ruby have a testing culture... I've never heard anyone imply that Matz and the core development team care even slightly about it.

In short, your average Ruby project and Ruby the project are entirely unrelated, they're written in different languages, even!


I took the line Hello, core Ruby developers! You've got an awesome language there. Could you start testing, please? Your community seems to do OK. Why not you? to suggest that the author of the post is fully aware that the Ruby Core team and the Community of Ruby Users are two separate things with different attitudes towards testing.


I agree with you, but if you get detailed, you might also question the use of "culture" as in "who has the testing culture again?" to be more indicative of Ruby developers as a community (which is a word the author also uses in praise of it)

I think the words were poorly chosen. I understand the main point, which IMO supports your assertion. But knowing the habits of people surfing the web, I can certainly understand how it doesn't appear that way to everyone.


Code size does not imply functionality. Does Perl have more core functionality? Does Ruby have more expressiveness in its tests, or how they test? Are the Perl core tests testing the core libs, the language itself? Both? What are the Ruby tests doing? This benchmark, like most, is meaningless.


This is the second post I've read claiming that Perl is better tested than Ruby.

Why is this a topic of discussion? Is someone from the Ruby community running around saying otherwise?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: