4 ms·
Survey: Python vs Ruby Test Ecosystems
- techiferous 16y agoGreat idea. rvm is not a QA tool, by the way; it's a way to manage multiple versions of Ruby.
- andrewvc 16y agoIf you're developing gems for distribution, it quickly becomes one.
- lostbit 16y agoPlease post the results later! I don't have experience on both to produce any valuable data to your survey but I'm interested in the results/discussions.
- abraham 16y agoResults: https://spreadsheets.google.com/viewanalytics?formkey=dElMTHB4WXRyNnBMSVpSdll6WlU0WEE6MQ https://spreadsheets.google.com/viewanalytics?formkey=dElMTH...
- 100k 16y agoI recently started developing for Google App Engine after several years working with Rails, and my sense is that Python testing (at least on App Engine) is seriously behind the Ruby/Rails world. GAE is especially hard to test because you essentially run it in an emulator locally. It's also pretty bare-bones, so you don't get the free testing tools you get with Rails, like fixtures (love 'em or hate 'em, at least they can get you started) and a test runner. Sure, you can set all that stuff up (and I do) but it sucks having to do a bunch of grunt work that's done for you in Rails. FWIW, my preferred testing setup in Rails is Shoulda with Mocha for mocking and my own fixie library for pre-populating test data (it's faster than factory_girl) and factory_girl if I find I need it. I think acceptance testing with Cucumber is over rated and I'll be damned if I'm going to program in English, so I do not bother. For GAE, I'm using gaetestbed and writing a lot of helper functions.
- cdavid 16y agoI don't think it is fair to base your impression on GAE. GAE is a very particular platform. I am not so familiar with testing for web applications, but nose on python certainly supports test runners, fixtures, etc... I am actually surprised you can get a testing framework without those
- lusis 16y agoI know he made a little "bait" comment but at least he admits the simple inability for python to seriously host DSLs. If you look at any python port of a DSL (sinatra clone, cucumber clone, whatever) it's just simply ugly. It's STILL python code.
- silentbicycle 16y agoRuby DSLs still look like Ruby code, too; it just has a laxer lexer. For a reality check, look at DSLs in Forth or Prolog sometime. Many Ruby DSLs are :covered with? accent "marks", though, like Romanized Vietnamese* . You're probably just used to it. * e.g. http://en.wikipedia.org/wiki/Cà_phê_sữa_đá http://en.wikipedia.org/wiki/Cà_phê_sữa_đá
- lusis 16y agoFair enough. Sinatra and Chef are good examples of "ruby code" DSLs. In contrast, however, I give you Cucumber scenario files. Yes, Given/When/Then are methods but it's still a very elegant DSL. I'll do some poking into prolog and forth-based DSLs. You've peaked my interest.
- nvie 16y agoCucumber is not really a native DSL. The scenario files are simply text files that are parsed (pattern matched) by Cucumber, which is a parser that's written in Ruby. It could well be written in Python, too. If you look at Steak (https://github.com/cavalle/steak https://github.com/cavalle/steak), however, this is a real native Ruby DSL, and such a thing is impossible to ever do as elegant in Python.
- cageface 16y agoMaybe, but my enthusiasm for DSLs in ruby has diminished a lot in the 6+ years I've been doing ruby work. DSLs don't compose well and it's usually easier to learn a new api than yet another new mini-language.
- bobbywilson0 16y agoA common thing I have heard is that Python people are obsessed with documentation and Ruby people are obsessed with testing. Not saying that one or the other is 'better', just that the culture around each of the languages has created these stereotypes.
- silentbicycle 16y agoDoctest (http://docs.python.org/library/doctest.html http://docs.python.org/library/doctest.html) seems like an interesting crossover point, though.
- nvie 16y agoI find this quite ironic, since some of the key properties in the Ruby language IMHO lead to an increased demand for documentation. For examples, see this comment on the blog post: http://nvie.com/posts/python-vs-ruby-survey/#comment-98209520 http://nvie.com/posts/python-vs-ruby-survey/#comment-9820952...
- cageface 16y agoI find it slightly ironic that python people envy rspec. I like ruby but (IMO) rspec pushes the ruby penchant for DSLs to a gratuitous extreme. I much prefer shoulda or plain old Test::Unit.