[#67346] Future of test suites for Ruby — Charles Oliver Nutter <headius@...>
I'll try to be brief so we can discuss all this. tl;dr: RubySpec is
19 messages
2015/01/05
[#67353] Re: Future of test suites for Ruby
— Tanaka Akira <akr@...>
2015/01/05
2015-01-06 7:18 GMT+09:00 Charles Oliver Nutter <headius@headius.com>:
[#67444] [ruby-trunk - Feature #10718] [Open] IO#close should not raise IOError on closed IO objects. — akr@...
Issue #10718 has been reported by Akira Tanaka.
3 messages
2015/01/09
[#67689] Keyword Arguments — Anthony Crumley <anthony.crumley@...>
Please forgive my ignorance as I am new to MRI development and am still
5 messages
2015/01/20
[#67733] [ruby-trunk - Bug #10761] Marshal.dump 100% slower in 2.2.0 vs 2.1.5 — normalperson@...
Issue #10761 has been updated by Eric Wong.
4 messages
2015/01/21
[#67736] Re: [ruby-trunk - Bug #10761] Marshal.dump 100% slower in 2.2.0 vs 2.1.5
— Eric Wong <normalperson@...>
2015/01/22
normalperson@yhbt.net wrote:
[#67772] Preventing Redundant Email Messages — Jeremy Evans <code@...>
For a long time, I've wondered why I sometimes receive redundant email
5 messages
2015/01/23
[ruby-core:67371] Re: Future of test suites for Ruby
From:
Charles Oliver Nutter <headius@...>
Date:
2015-01-06 20:05:32 UTC
List:
ruby-core #67371
On Tue, Jan 6, 2015 at 1:50 AM, "Martin J. D=C3=BCrst" <duerst@it.aoyama.ac.jp> wrote: > Ruby always has had an inclusive rather than prescriptive culture (e.g. w= hen > compared to Python), so the fact that there are two test suites may not b= e > that bad. Also, mixing and matching things, and combining stuff from > different sources, is something that is very frequent in Japanese culture= . I'm getting the impression that half the folks like RubySpec better and half the folks like the MRI suite better, and both have fair reasons. At the moment there's a tremendous amount of inertia behind the MRI suite and far more tests go there than to RubySpec over time. New features, modified features, and bugs all have tests added to MRI's suite first...probably because it's "there" in the repository. That is, of course, why JRuby considers MRI its primary compatibility suite= . I have run coverage reports for both projects on JRuby. MRI: http://headius.github.io/mri-coverage/ RubySpec: http://headius.github.io/rubyspec/-coverage/ Note that the aggregate numbers are not useful because RubySpec no longer includes any tests for the standard library (they were transplanted into Rubinius's "rubysl" projects) and JRuby does not run all tests/specs from either suite. Individual classes and methods do have useful numbers though. For example, RubyString (which implements String) is 85% covered by MRI's suite and 79% covered by RubySpec. RubyString under MRI suite: http://headius.github.io/mri-coverage/org.jruby/RubyString.html#dn-a Highlighted source: http://headius.github.io/mri-coverage/org.jruby/RubyString.java.html RubyString under RubySpec: http://headius.github.io/rubyspec-coverage/org.jruby/RubyString.html#dn-a Highlighted source: http://headius.github.io/rubyspec-coverage/org.jruby/RubyString.java.html Other cases have slightly more coverage running RubySpec. Overall, coverage of the core classes seems roughly the same between MRI's suite and RubySpec, but if either suite is to be the "winner" we need reports like this to ensure we maintain test coverage. > I think contributions to both MRI's test suite and to RubySpec are very > welcome. We are getting lots of small but valuable contributions to the > documentation from what I understand are people who use this as a way to > study Ruby. Maybe something similar could work for tests; it would be > somewhat more difficult than working on documentation but may have a simi= lar > educational effect and likewise produce very valuable improvements. Perhaps the biggest benefit of RubySpec is that all specs are small and contain an English specdoc string describing what they test. Compare that to MRI where you may have one method called "test_function" that tests 100 different behaviors and you are left reading the code to figure it out. The specdoc requirement is not necessarily a *good* think, though. Today I was fixing some bugs in JRuby and found that the related RubySpec's English description described the exact *opposite* behavior. English descriptions, just like comments, must be maintained. And if all specs must have a specdoc string, then non-English speakers are required to compose formal specdoc English just to write a test. That said, if we broke up the large test methods in MRI's suite and added one-liner comments indicating what they do (perhaps with rdoc formatting?) it would go a long way toward better readability. I'm taking notes on what an "MRI test suite coding guide" might look like. - Charlie