5 ms·
cucumber? what is this, 2013? rspec + capybara is much more enjoyable and maintainable. Maintaining a cucumber test suit is basically a nightmare. I hate writi
by meesterdude 11y ago
cucumber? what is this, 2013?
rspec + capybara is much more enjoyable and maintainable. Maintaining a cucumber test suit is basically a nightmare. I hate writing tests for it, I hate fixing tests in it when they break, and i hate the random cucumber exceptions that cause random failures. and should you come to a point where you want to optimize the test suit performance, good luck!
cucumber is good if you're not the one writing or maintaining the tests. You just have to have a DSL that the test maintainers can use, and they handle writing and maintaining. But thats it.
If the devs are the ones who have to write the tests, as is far more common; then interfacing with capybara directly is much much better than bringing cucumber into the mix. I used to be into cucumber, but once i switched over to a leaner approach i found testing was much easier and more enjoyable.
- zyM7A6bQzJKBHnS 11y ago> rspec + capybara is much more enjoyable and maintainable It looks like it's limited to testing web sites and is not really useful for me. Gherkins can be adapted for all kind of tests (even if I agree that it's far from perfect).
- eugene-d 11y agoBDD is more about communication, not regression testing. If all you want is testing you never really needed cucumber.
- jxm262 11y agoI agree with this. I've recently tried using cucumber for a couple side projects and have decided it's complete overkill for my needs. I see the major benefit would be communication amongst your teams (especially to translate the detailed technical stuff), but if it's a small team who are all devs I'm not finding it very useful.
- matthewmacleod 11y agoYou're right, in that if you are writing Gherkin specs as a replacement for something you can implement using Capybara, then I don't think you'll get the most out of Cucumber – it becomes an unnecessary abstraction. If you're using it to communicate features to other team members, it can be super-useful, since it's much easier to comprehend that the equivalent developer-friendly code.
- meesterdude 11y ago> If you're using it to communicate features to other team members, it can be super-useful, since it's much easier to comprehend that the equivalent developer-friendly code. In ruby/rspec it's actually still understandable and direct. in other languages, maybe not so much. I have not run into a cucumber implementation I liked. I agree it can lead to a human readable spec, but the effort it takes to get there, and stay there, is a nontrivial cost in terms of maintenance/flow/optimization. I don't think it solves technical problems, but organizational. It's all about tradeoffs, with everything we do. Outside of someone else writing and maintaining the spec, I don't think the downfalls at all warrant any benefit of clarity. cucumber is not "free" to use, it's a commitment with lots of fine print. I suppose thats really what i'm trying to advocate, in the end. At least thats been my experience across 5 or so projects with it. YMMV.
- ldpg 11y agoYour opinion.
- meesterdude 11y agois that not inferred? Or is that your way of disagreeing with me?
- teacup50 11y agoThis is frightening; is the state of the art in software development set by a process more reminiscent of music fans arguing about esoteric bands than any kind of formal rational engineering?
- meesterdude 11y agoI don't think this is like that. There is no right or wrong, but pragmatically these tools have their upsides and downsides, and cucumber in my experience has been more trouble than its worth; I would hope to give others pause before deciding to use cucumber, because it does come with some fine print.
- omouse 11y agoPretty much yes. You will rarely see anyone using real evidence and studies to prove their point, you're more likely to see someone say "hey I heard so and so is doing this maybe just maybe it's a good idea" which is why you have half-hearted adoption of Agile for example and why you see people arguing against automating error-prone manual processes.
- crdoconnor 11y ago>Maintaining a cucumber test suit is basically a nightmare. I hate writing tests for it, I hate fixing tests in it when they break, and i hate the random cucumber exceptions that cause random failures. and should you come to a point where you want to optimize the test suit performance, good luck! This is partially the reason I wrote this: http://hitchtest.com/ http://hitchtest.com/ While I don't like the regular expression mangling of Cucumber, I do think that tests need their own "readable" non-turing complete language. I thought that a mix of YAML and jinja2 made for the cleanest, most readable tests and still made writing steps easy enough.
- GolfyMcG 11y agoCouldn't agree more. We built up a huge cucumber test suite and are now struggling to transfer it all over to RSpec with our unit specs. We were convinced we were doing it all wrong but after speaking with some of the developers at thoughbot it seems we're not alone. Transferring projects from cucumber to RSpec+capybara has become something of a regular occurrence and they have RARELY seen anyone use cucumber successfully.
- kodablah 11y agoCucumber is still quite relevant. Your alternative assumes Ruby, Cucumber does not. I personally enjoy writing Gherkin as I get a large set of feature files that serves as documentation. I don't think it's that great as a DSL or to have someone besides the step definer writing the tests. Maybe that's why you found it hard to maintain. Oftentimes I define single-use steps because my other scenarios simply don't need them. It's definitely a poor solution if you are looking at it from a programming language or code reuse perspective. Instead I use it as a way, in English, to explain features. Granted I use it almost exclusively for integration/systems tests and not unit tests or anything.