Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSpec and SpecFlow when to use which? What are the advantages/disadvantages of either?

I am trying to get started with BDD and found a view blog posts about MSpec and SpecFlow. I'm currently not quite sure when I would use which and what the advantages/disadvantages of either framework are.

Looking at the documentation it seems that MSpec uses the context specification style whereas SpecFlow uses Given/When/Then style. I don't really mind either but I would like to know if there are any pitfalls to watch out for further down the track when the project/test suite grows.

Basically some real world advice/feedback of someone who uses it in their every day work would be great.

like image 820
b3n Avatar asked Apr 28 '11 03:04

b3n


People also ask

What is SpecFlow used for?

What is SpecFlow? SpecFlow is a BDD framework for . NET which boosts your productivity by helping you with writing your feature files and automation code in your favorite IDE using C# and . NET methods.

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

What is SpecFlow 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.

What is specspecflow framework?

SpecFlow is a testing framework. It is a software that allows the testing and functioning of developers of code to write code and develop a new program.

What are the disadvantages of using SpecFlow?

The other disadvantage of SpecFlow is that it is a relatively new software and yet to develop even more to suit the needs of not only long term projects but also short term projects. This makes the use of SpecFlow a little unreliable for overtly serious projects.

What is the difference between SpecFlow tables and Scenario Outline?

What is the difference between SpecFlow tables and Scenario Outline? SpecFlow tables are a means to supply tabular data with almost any scenario step. And, it is passed as the SpecFlow table argument in the measures' implementation that can be parsed to the preferred object type as per the requirement.

What are the advantages of using SpecFlow+ runner?

Some of the critical advantages of SpecFlow+ Runner include: It offers you support for multiple targets; thus, allowing you to write one single test to target varying environments. SpecFlow+ Runner lets you configure file transformations, which can be used with targets.


2 Answers

So I've used both. I like the mspec workflow in away because its an easier sell for me to speak to users and say.

"When logging in" "I should return to the page I requested"

When I've worked for organisations that have bought more into active collaboration (read agile) I've used the Given When Then pattern. That organisation was used to user stories so they were used to a more rigid style of specification. Also we were using more than one tool to feed the specs into. so the 'text only' feature files could be reused between tools.

In my own projects I use SpecFlow for the 'outside' and 'mspec' for inside of tests. If I was to give someone advice it would be to use specflow if non technical people are writing the outside specs and mspec if a developer is writing the.

Bad points: Mspec is class explosion SpecFlow is a slower workflow Good points: Mspec is a more natural language Specflow is better for reusability for steps.

The bottom line is they work well together.

like image 133
Johnno Nolan Avatar answered Oct 20 '22 09:10

Johnno Nolan


One disadvantage of mspec is you cannot run in parallel whereas with specflow runner you can. That is a big performance issue.

like image 21
Arvin Bhurtun Avatar answered Oct 20 '22 07:10

Arvin Bhurtun