Jeff Kreeftmeijer

Herbivore / Carnivore

2011-01-31

At the 80beans / Amsterdam.rb new years event, I gave a short presentation about acceptance testing named “Herbivore / Carnivore”.

As a happy Steak user, I wanted to talk about how it could free you from your horrible problems with Cucumber and make you a better and more efficient programmer. But during my research, finding bad things to say about Cucumber proved more difficult than I thought, especially after talking to a bunch of Cucumber users that explained why it works the way it does and cleared some of my misconceptions.

Using my new Cucumber knowledge, I turned my presentation around from explaining why I think you should use a tool like Steak to when I think you should use a tool like Steak. I did this because I think a lot of people just choose between testing in English or Ruby and stick to that, no matter what the next project or situation is.

Instead of trying to convince everyone that writing tests in English is overkill, I tried to explain what a great tool Cucumber is when you’re actually using it as a communication tool. Because, let’s be honest, You can’t let your clients read code, no matter how readable you think it is. You’re a programmer. If you want to write stories together with your client and keep them involved in the process you need some kind of business readable DSL to allow you to write stories in a language everybody involved can understand. That language is not Ruby (in most cases).

In situations where you can’t get the client involved and you find yourself being the only one writing and reading the English stories, Steak might be a great solution. It’s a simple RSpec extension that adds just enough code to allow you to do acceptance testing in Ruby, without the extra complexity or overhead. I’m not going to explain Steak here, I wrote an article about it a couple of moths back.

So, why is Cucumber the most used acceptance testing library while most projects, clients and teams don’t really need English tests? Shouldn’t we add less complexity when we don’t need it?

I ended my presentation with a question I think all Cucumber users should ask themselves every once in a while: “Do you benefit from writing tests in English?”. Do you use the tests as executable documentation and as a communication tool? If your answer is yes, keep doing what you’re doing. Otherwise, Steak might be a good tool for you.

I would love to hear your thoughts on this. Here are my slides if you want to give them another look. Also, here’s a great article by @iain_nl about Steak and Cucumber.