Live data from Hacker News

Saving Agile with BDD and Cucumber

blog.fogcreek.com

31–40 of 48 posts

Re: Saving Agile with BDD and Cucumber

#31

Note from the field: the purpose of BDD/ATDD and Cucumber (aside from validating work and making sure the system is still up) is to work with the business to get agreement on common business terms. That means there's a fair bit of factoring involved as the system grows. Things like "When you say 'content', do you mean 'html content', or also user manuals?'. It's like English is the programming language, and you're co…

This is spot on.

I think a good policy to try to follow is that nobody with a title including the word "software" or "engineer" should ever write a feature file without someone without such a title in the room or at the computer with them. If a test needs to be written and it isn't possible to get buy-in or time to follow this rule, that test should be written in a programming language at the developer's discretion. Not following this policy results in programmer frustration at writing code in a weird english / code hybrid, without any of the benefits of it catalyzing communication and elucidating business language and processes.

Everyone "knows" all this, but it's so tempting to just say "it will be easier to just let the developers do it this time", which eventually becomes every time.

Re: Saving Agile with BDD and Cucumber

#32
I find the idea about describing the requirements to the computer leading to greater human understanding of the requirements interesting. Where I work, the product people decide random shit on a whim so this would be deemed "not Agile", but insightful nonetheless.

I have actually used Cucumber before, back when it was a new thing. It was mostly a boondoggle because this was a .NET shop, so our QA folks would figure out how they wanted their Cucumber tests to look (may have been Gherkin, not clear on the distinction), then the .NET devs would have to go off and write Cucumber parsers for that, then the tests could be run. You can imagine this cycle taking roughly forever. ("parser" is probably the wrong word, but, the thing that takes a bunch of English words, turns them into code, then evaluates it)

Re: Saving Agile with BDD and Cucumber

#33
post #29

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…

Your opinion.

is that not inferred? Or is that your way of disagreeing with me?

Re: Saving Agile with BDD and Cucumber

#34

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…

This 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?

Re: Saving Agile with BDD and Cucumber

#35

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…

You'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.

> 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.

Re: Saving Agile with BDD and Cucumber

#36

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…

>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/

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.

Re: Saving Agile with BDD and Cucumber

#37

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…

This 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?

I 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.

Re: Saving Agile with BDD and Cucumber

#38

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…

Couldn'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.

Re: Saving Agile with BDD and Cucumber

#39

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…

BDD is more about communication, not regression testing. If all you want is testing you never really needed cucumber.

I 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.

Re: Saving Agile with BDD and Cucumber

#40

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…

This 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?

Pretty 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.
Post reply on HN