Reputation: 37376
Last time I looked for a framework was at the end of 2009, now I want to use BDD and I find out there are about 7 frameworks for BDD in .NET, I was wondering if, based on someone's experience, which one is the most mature?
Upvotes: 12
Views: 4046
Reputation: 287
Concordion.NET is a nice little framework that enables BDD in plain English. As it is based on html, it can use the expressiveness of the web to describe the software product from the customer perspective. It does not rely on pattern matching, but uses a small set of commands (e.g. "set", "execute", "assertEquals") to turn concrete examples within html documents into automated acceptance tests. Thus it is well suited for Specification by Example.
Upvotes: 0
Reputation: 13852
I haven't really used specflow but my impression is that there is QUITE some overhead! You need to phrase everything three times. In the spec file, as a regex to be parsed and a method with somewhat the same name as the line that is parsed.. https://github.com/davidmfoley/storevil/wiki seems MUCH more lean
For example, in order to match the following:
Given I have a savings account with $100
In SpecFlow, and similarly in Cucumber (ignoring the language differences between C# & Ruby), you would write something like this:
[Given(@"I have a (\w+) account with $(.*)")]
public void GivenIHaveAccount(string type, decimal amount) { ... }
In StorEvil, you could use similar syntax to the above, OR, you can write it in as follows:
public void Given_I_Have_A_accountType_Account_with_amount(string accountType, decimal amount) { ... }
Upvotes: 1
Reputation: 21
I strongly agree with Lunivore's comment's on desisting the move to BDD tools until you are ready. It resonates with my experience. While the tools are important, sometimes it can get in the way. And there's a lot you can gain from BDD without adopting any frameworks.
I've written my thoughts here:
http://neelnarayan.blogspot.com/2011/04/bdd-is-not-about-tools.html
Upvotes: 2
Reputation: 17637
SpecFlow is emerging as one of the better .NET BDD tools, it's true, and MSpec is great at a unit level though I haven't found much benefit over NUnit, given the non-technical nature of the audience.
Seriously, though - BDD isn't about the tools. If you want to get started, focus on the conversations around scenarios first. This is where the big wins in BDD happen - when conversations start generating understanding and more ideas for how to solve the problem and deliver the real value of the project. If your business stakeholders would like to be more involved based on those conversations, that's a great point at which to get started with English-language BDD tools. Otherwise, recognize that those tools introduce another layer of abstraction, together with the difficulty of refactoring English, working out which steps are no longer used, etc. BDD tools introduce another layer of complexity to scenario automation, which is already tricky.
If you're just looking to learn more about how BDD frameworks hang together, rather than using them on an enterprise project, then go for it.
As an alternative, you can capture the scenarios in a little custom DSL, and do everything you need to in plain old NUnit. I'm one of the original JBehave devs and I still wouldn't automatically make the jump to JBehave without a good reason and plenty of stakeholder engagement. It's easy to move to English-language BDD tools later once (if!) it becomes the most useful thing to do.
Upvotes: 8
Reputation: 1477
I think SpecFlow is awesome - but for me it left a hole in the BDD process - unit tests.
So now I am looking for a "Total BDD" solution and plan to use MSpec for "unit tests" (read context specifications).
At first MSpec can look a bit weird, but it doesn't take long to get used to.
Upvotes: 1