Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top