Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cuke4Nuke or SpecFlow?

I am trying to decide if I should use Cuke4Nuke or SpecFlow. What are the pro/cons of each? Opinions on which is better and why.

Thanks!

like image 821
Rich Blumer Avatar asked Jan 21 '10 23:01

Rich Blumer


People also ask

Is SpecFlow same as Cucumber?

Cucumber is an application that reads Gherkin syntax plain text specification files and runs ruby files to execute those specifications. Specflow is a 'port' of cucumber for . net that also uses Gherkin syntax files but wires them up to . net code.

Is SpecFlow useful?

SpecFlow helps to define, manage, and automatically execute human-readable tests in . NET projects. It facilitates collaboration between all business stakeholders. SpecFlow uses simple English language and acts as a bridge between business and technical languages.

What is SpecFlow and Gherkin?

SpecFlow tests are written using Gherkin, which allows you to write test cases using natural languages. SpecFlow uses the official Gherkin parser, which supports over 70 languages.

Does SpecFlow use Cucumber?

SpecFlow is a test automation solution for . NET which follows the BDD paradigm, and is part of the Cucumber family. SpecFlow tests are written with Gherkin, using the official Gherkin parser which allows you to write test cases using natural languages and supports over 70 languages.


2 Answers

(I might be biased because I am involved with SpecFlow, but here my thoughts...)

Cuke4Nuke is very close to Cucumber. This promises a lot of advantages:

  • Compatibility
  • Getting new features from Cucumber when Cucumber evolves (at least in theory, but language support is an example for this)
  • Being a real part of the Cucumber community and the Cucumber ecosystem

However this comes also with some potential disadvantages:

  • Ruby is a necessity
  • Since more infrastructure (Ruby, Wire-Protocol, command-line integration...) is involved, the complexity of the whole solution rises, and chances that something in the chain is failing rise
  • Debugging is possible but a bit of a hassle
  • Running scenarios on the dos-commandline is just plain ugly, and I still have problems with some characters (German Umlaute). The solutions from Cucumber did not work for cuke4nuke in my case.
  • Integration with your continuous build is something you have to work out for yourself

SpecFlow is a separate project from Cucumber. It tries to be as close to Cucumber as possible, but there are and will be gaps. There are plans to use the same parser as Cucumber, to improve compatibility on the language level.

SpecFlow tries to offer the following advantages:

  • A pure .NET solution (so no installation of Ruby is necessary and Ruby is not involved at runtime)
  • There is a basic integration with VisualStudio (and there are plans to evolve this)
  • Scenarios are basically UnitTests and can be run with your existing infrastructure (NUnit.Runners, ReSharper, VisualStudio MSTest Integration ...)
  • Scenarios and steps are easily debuggable out of VisualStudio (just set a breakpoint)
  • Integration in your continuous build should be a breeze, since the infrastructure to run unit-tests is most certainly there already

As disadvantages of SpecFlow I see currently:

  • It does not support as many languages as Cucumber
  • Currently there is a "code generation" step involved. This is transparent when using VisualStudio, and there is a commandline to do this without VisualStudio, but a lot of people do not like code-generation.
  • Currently there is no explicit commandline runner for SpecFlow. However you can use your unit-test commandline runner.
  • SpecFlow depends on a Unit-Test framework, and currently only NUnit and MSTest is supported
  • Reporting in SpecFlow is not very sophisticated yet. Cucumber does offer more options, however I don't know if they are all available in cuke4nuke...
like image 197
jbandi Avatar answered Nov 11 '22 08:11

jbandi


jbandi gives a good summary. I answer the question in much the same way (with the opposite disclaimer for bias, of course).

The goal for Cuke4Nuke is full Cucumber compatibility in .NET while duplicating as little Cucumber code as possible. Therefore, some of the trade-offs you highlighted—e.g. the Ruby dependency—are inherent to the tool. Others, like bugs in language and formatter support and limited debugging support, are temporary issues and will go away with future versions.

I've run into a few issues where Cuke4Nuke doesn't work quite like Cucumber. But as I work primarily in English, I don't see the language-related issues in my normal work. I'd welcome steps to reproduce any of these issues so I can fix them. (Please post to them the Cuke4Nuke issues list, not here.)

like image 22
Richard Lawrence Avatar answered Nov 11 '22 08:11

Richard Lawrence