2
votes

I'm using cucumber with gherkhin because it is a mainstream of integration testing in Rails community. But now I doubt that it is a silver bullet.

I see several cases when I should use Cucumber:

  1. It is necessary to show features to somebody without any programming knowledge. To client, for example.
  2. One wants to create documentation on the fly and dosn't pay for it, like cucumber itself do with help of Relish. It is very cool for open source projects which are needed in public documentation, but itsn't so cool for closed and small projects.

Does exist some other reason for using cucumber if you are programmer and want only to cover your product with integration tests? Or in case where you want to use BDD but don't want to write a poem about your future app in gherkin language?

3
Read this blog. It's very goodAndrei Botalov

3 Answers

3
votes

Two reasons I can think of:

  • I find it useful, even a solo project, because it helps you think about the problem from a distance, without having to worry about class names, syntax, assertions, etc. That process of simply writing down what you think you need to build, in plain language, can be very useful.

  • Cucumber is often used for integration tests, so if you don't use it you better have some alternative. Unit tests alone usually aren't enough.

2
votes

Cucumber and Gherkin are a flagpole for a testing and development philosophy to rally around. When you write scenarios with Gherkin it should be a signal that you have decided that what the software does (its behavior) takes precedence over how it does anything. Gherkin gives you the chance to describe your tests completely from the user's perspective, avoiding any mention of an implementation detail.

2
votes