This document provides an overview of SpecFlow, a behavior-driven development (BDD) tool for .NET. It introduces SpecFlow, discusses BDD and how SpecFlow fits into agile practices like test-driven development (TDD) and acceptance test-driven development (ATDD). The document outlines TechTalk, the company behind SpecFlow, demonstrates SpecFlow functionality, and discusses integrations with tools like Visual Studio and build servers. It also previews upcoming SpecFlow sessions at NDC 2011 and takes questions from the audience. The summary concludes in 3 sentences or less.
3. The audience?
• Who is practicing agile Development?
• Who is practicing TDD?
• Who is doing Acceptance Test Driven
Development or Behavior Driven
Development?
• Who is using Cucumber, Fitnesse,
Concordion, NBehave or a similar tool?
• Who knows SpecFlow?
3
4. Overview & Agenda
• BDD: Summary
• SpecFlow Introduction
• Demo: SpecFlow Hands On
• Demo: MonoDevelop
• Q&A
The research is partially supported by the
project of Eötvös Loránd University:
TÁMOP-4.2.1.B-09/1/KMR-2010-0003
4
5. BDD – A definition from Dan North
BDD is a second-generation,
outside-in, pull-based, multiple-
stakeholder, multiple-scale, high-
automation, agile methodology.
It describes a cycle of
interactions with well-defined
outputs, resulting in the delivery
of working, tested software that
matters. Dan North, Agile Testing, Specifications and BDD Exchange 2009
5
6. BDD: An attempt to fit it all together
Specification by
TDD Example
Test Driven Development Definition of
Done
DDD
Domain Driven Design
BDD
Behavior Driven ATDD
DSL Development Acceptance Test Driven
Development
Domain Specific Language
Outside-In User Stories
Development
6
7. Specification by Example
• Abstract requirements and
specifications are not a good
tool for communication.
• Concrete examples are much
better.
• Usually examples are not
formalized and not shared.
are composed of
Examples Tests
elaborate verify & validate
Requirements Books by Gojko Adzic
7
8. Detail Discussions…
We want to encourage new users to place an order.
Therefore we are going to offer 10% discount on
every initial order.
Register as “bart_bookworm”
Go to “/catalog/search”
Enter “ISBN-0955683610”
Click “Search”
Click “Add to Cart”
Click “View Cart”
Verify “Subtotal” is “$33.75”
public void CalculateDiscount(Order order)
{
if (order.Customer.IsNew)
order.FinalAmount = Math.Round(order.Total * 9/10);
}
8
9. … Illustrated with Examples
Given a user who hasn't placed an order yet
When the user puts a book into the shopping cart
Then a discount of 10% should be applied on the cart total.
9
10. Show Implicit Expectations
Actually, this is not quite right:
books on sale should be excluded from
discount.
10
14. Outside-In Development
• Always start with a Story
• What development should focus on:
•Providing business value
•Satisfying stakeholder needs 1
•Software that matters 2
3
•Consumable software
4
5
14
15. BDD: An attempt to fit it all together
Specification by
TDD Example
Test Driven Development Definition of
Done
DDD
Domain Driven Design
BDD
Behavior Driven ATDD
DSL Development Acceptance Test Driven
Development
Domain Specific Language
Outside-In User Stories
Development
15
16. SpecFlow
• Open-source BDD tool for .NET www.specflow.org
• www.specflow.org
• github.com/techtalk/SpecFlow
• Focus on high level behavior: features /
acceptance tests
• Focus on story-style plain text specifications
• Using Gherkin as DSL for specifications
• Uses existing testing frameworks for
execution (Nunit, MSTest, xUnit)
• VisualStudio / Build integration
16
17. SpecFlow History
• Founded in late 2009 by TechTalk
www.specflow.org
• Goals:
• A pragmatic BDD tool for .NET
• Provide a frictionless experience for .NET
environments
• Use existing tools: VisualStudio, UnitTest-
Frameworks
• SpecFlow is now used in most projects
by TechTalk
• SpecFlow is used all over the world.
18
20. Contributors
Jonas Bandi, Darren Cauthon, Christian
Hassa, Gaspar Nagy, Dale Ragan
Vagif Abilov, Jon Archer, Xerxes Battiwalla,
Ryan Burnham, Matt Ellis, Csaba Gerő,
John Gietzen, Marcus Hammarberg, Kerry
Jones, Mátyás Kabódi, Avram Korets,
Viktor Nemes, Max Paulousky, Chris Roff,
Daniel Sack, Attila Sztupák, Charles Weld,
Steven Zhang
21
24. Teaser Session 2
Requirements Analysis
Executable & Automated
Specifications
Improving Feedback with a
Transparent Development
Process
Living Documentation
25
25. Other BDD Sessions at the NDC
Thursday Morning:
• Gojko Adzic
• Scott Bellware
26
26. Questions &
Discussion
GASPAR NAGY JONAS BANDI
gaspar.nagy@techtalk.at jonas.bandi@techtalk.ch
Twitter: @gasparnagy Twitter: @jbandi
COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
28. BDD? – Bushido Driven Development
Write good code
or kill yourself
out of shame.
@durp
29
29. Boss Driven
Development
Beer Driven
Development
30
30. Ah ok... I understand. It is done!"
BDD? – What? What do you mean?"
Bug Driven Well it is done. The system is finished!
Well, no ... I don't see an icon where I can start it?
Devel- I want you to build YouInstant Social Turbo
Oh! an are right. That's a bug! I will fix it!
opment Communication Workstation Terminal
... five minutes later ...
Ok, the icon is here. Now it is done!
But when I double-click the icon nothing happens!
Oh! You are right. That’s a bug! I will fix it.
... five minutes later ...
Ok, the app starts when you double click. Now
31 it is done!"