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.
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.
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.
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.
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.
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? 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.
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.
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.
One disadvantage of mspec is you cannot run in parallel whereas with specflow runner you can. That is a big performance issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With