SlideShare a Scribd company logo
1 of 30
SpecFlow:
Pragmatic BDD for .NET
NDC 2011
             GASPAR NAGY
             gn@techtalk.at
             Twitter: @gasparnagy

             JONAS BANDI
             jonas.bandi@techtalk.ch
             Twitter: @jbandi


Oslo, 8. June 2011


                                       COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
TechTalk at a glance
•   Established: 1993
•   Branches: Austria, Hungary, Switzerland
•   3 Managing partners: no external owners
•   Employees: ~ 60 employees
•   Turnover 2010: ~ 7 Mio CHF
•   Risk rating: very low risk
•   Self-financing, healthy growth




                                                            TechTalk office, Vienna/Austria


                                              COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
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
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
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
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
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
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
… 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
Show Implicit Expectations
     Actually, this is not quite right:
     books on sale should be excluded from
     discount.




10
3 Amigos
                           Exceptional,
     Happy
             Feasibility   Edge Cases
      Path




11
TDD




12
ATDD: Rising the Level of Abstraction




13
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
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
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
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
19
Integrations…
                MSBuild




                     MSTest
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
DEMO



22
http://www.stackoverflow.com
       tag: specflow


           “haacked”
                                           Phil Haack
                       ASP.NET MVC: A New Framework
                          for Building Web Applications




              “forked”



DEMO
23
MonoDevelop Integration
by Dale Ragan



dale.ragan@sinesignal.com
Twitter: @dwragan




 24
Teaser Session 2
                     Requirements Analysis

                   Executable & Automated
                              Specifications

               Improving Feedback with a
                Transparent Development
                                 Process

                      Living Documentation

25
Other BDD Sessions at the NDC
Thursday Morning:
• Gojko Adzic
• Scott Bellware




 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
Other
Interpretations
        of BDD

        COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
BDD? – Bushido Driven Development


     Write good code
     or kill yourself
     out of shame.
                @durp


29
Boss Driven
     Development




                   Beer Driven
                   Development
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!"

More Related Content

What's hot

Successfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSuccessfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSmartBear
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect coupleStephen Tucker
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDDKnoldus Inc.
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationJohn Ferguson Smart Limited
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsIosif Itkin
 
Agile Test Driven Development
Agile Test Driven DevelopmentAgile Test Driven Development
Agile Test Driven DevelopmentViraf Karai
 
TDD That Was Easy!
TDD   That Was Easy!TDD   That Was Easy!
TDD That Was Easy!Kaizenko
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)Rohit Bisht
 
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...agil8 Ltd
 
Scrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - ColomboScrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - ColomboNaveen Kumar Singh
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven developmenttoteb5
 
Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Ajay Danait
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven DevelopmentTung Nguyen Thanh
 
Introduction to Acceptance Test Driven Development
Introduction to Acceptance Test Driven DevelopmentIntroduction to Acceptance Test Driven Development
Introduction to Acceptance Test Driven DevelopmentSteven Mak
 

What's hot (20)

Successfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSuccessfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile World
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect couple
 
Journey of atdd
Journey of atddJourney of atdd
Journey of atdd
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDD
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world application
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Cons
 
TDD and BDD and ATDD
TDD and BDD and ATDDTDD and BDD and ATDD
TDD and BDD and ATDD
 
Agile Test Driven Development
Agile Test Driven DevelopmentAgile Test Driven Development
Agile Test Driven Development
 
TDD That Was Easy!
TDD   That Was Easy!TDD   That Was Easy!
TDD That Was Easy!
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)
 
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
 
Scrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - ColomboScrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - Colombo
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven development
 
Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)
 
BDD in Action - building software that matters
BDD in Action - building software that mattersBDD in Action - building software that matters
BDD in Action - building software that matters
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Atdd half day_new_1_up
Atdd half day_new_1_upAtdd half day_new_1_up
Atdd half day_new_1_up
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Introduction to Acceptance Test Driven Development
Introduction to Acceptance Test Driven DevelopmentIntroduction to Acceptance Test Driven Development
Introduction to Acceptance Test Driven Development
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 

Viewers also liked

SpecFlow and some things I've picked up
SpecFlow and some things I've picked upSpecFlow and some things I've picked up
SpecFlow and some things I've picked upMarcus Hammarberg
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlowAiste Stikliute
 
Cross mobile testautomation mit Xamarin & SpecFlow
Cross mobile testautomation mit Xamarin & SpecFlowCross mobile testautomation mit Xamarin & SpecFlow
Cross mobile testautomation mit Xamarin & SpecFlowChristian Hassa
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Gáspár Nagy
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API TestingBruno Pedro
 

Viewers also liked (12)

Using Specflow for BDD
Using Specflow for BDDUsing Specflow for BDD
Using Specflow for BDD
 
SpecFlow and some things I've picked up
SpecFlow and some things I've picked upSpecFlow and some things I've picked up
SpecFlow and some things I've picked up
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
Julho 2016 - BDD com SpecFlow
Julho 2016 - BDD com SpecFlowJulho 2016 - BDD com SpecFlow
Julho 2016 - BDD com SpecFlow
 
Specflow
SpecflowSpecflow
Specflow
 
Specflow - Criando uma ponte entre desenvolvedores.
Specflow - Criando uma ponte entre desenvolvedores.Specflow - Criando uma ponte entre desenvolvedores.
Specflow - Criando uma ponte entre desenvolvedores.
 
Cross mobile testautomation mit Xamarin & SpecFlow
Cross mobile testautomation mit Xamarin & SpecFlowCross mobile testautomation mit Xamarin & SpecFlow
Cross mobile testautomation mit Xamarin & SpecFlow
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
 
API Testing
API TestingAPI Testing
API Testing
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
 
Copyright
CopyrightCopyright
Copyright
 
Copyright Act 1957
Copyright Act 1957Copyright Act 1957
Copyright Act 1957
 

Similar to NDC 2011 - SpecFlow: Pragmatic BDD for .NET

Topic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionTopic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionHoa Le
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012Justin Gordon
 
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Synerzip
 
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...BA and Beyond
 
Real developers-dont-need-unit-tests
Real developers-dont-need-unit-testsReal developers-dont-need-unit-tests
Real developers-dont-need-unit-testsSkills Matter
 
Real developers-dont-need-unit-tests
Real developers-dont-need-unit-testsReal developers-dont-need-unit-tests
Real developers-dont-need-unit-testsSkills Matter
 
Closing the gap between development and production with Datadog and NerdVisio...
Closing the gap between development and production with Datadog and NerdVisio...Closing the gap between development and production with Datadog and NerdVisio...
Closing the gap between development and production with Datadog and NerdVisio...David Thacker
 
NDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDDNDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDDjbandi
 
Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd Sakares Saengkaew
 
Database Refactoring
Database RefactoringDatabase Refactoring
Database RefactoringAnton Keks
 
It is a sunny day
It is a sunny dayIt is a sunny day
It is a sunny daybcoder
 
Friday final test
Friday final testFriday final test
Friday final testbcoder
 
How to contribute to open source
How to contribute to open sourceHow to contribute to open source
How to contribute to open sourceAlbert Wong
 
From dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneFrom dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneEdorian
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDDavid Rodenas
 
Behavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & JasmineBehavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & JasmineRemus Langu
 
Old code doesn't stink - Detroit
Old code doesn't stink - DetroitOld code doesn't stink - Detroit
Old code doesn't stink - DetroitMartin Gutenbrunner
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedAlexander Makarov
 

Similar to NDC 2011 - SpecFlow: Pragmatic BDD for .NET (20)

Topic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionTopic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolution
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
 
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
 
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
 
Real developers-dont-need-unit-tests
Real developers-dont-need-unit-testsReal developers-dont-need-unit-tests
Real developers-dont-need-unit-tests
 
Real developers-dont-need-unit-tests
Real developers-dont-need-unit-testsReal developers-dont-need-unit-tests
Real developers-dont-need-unit-tests
 
Real developers-dont-need-unit-tests
Real developers-dont-need-unit-testsReal developers-dont-need-unit-tests
Real developers-dont-need-unit-tests
 
Closing the gap between development and production with Datadog and NerdVisio...
Closing the gap between development and production with Datadog and NerdVisio...Closing the gap between development and production with Datadog and NerdVisio...
Closing the gap between development and production with Datadog and NerdVisio...
 
NDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDDNDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDD
 
Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd
 
Database Refactoring
Database RefactoringDatabase Refactoring
Database Refactoring
 
It is a sunny day
It is a sunny dayIt is a sunny day
It is a sunny day
 
Friday final test
Friday final testFriday final test
Friday final test
 
How to contribute to open source
How to contribute to open sourceHow to contribute to open source
How to contribute to open source
 
From dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneFrom dev to ops and beyond - getting it done
From dev to ops and beyond - getting it done
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDD
 
Behavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & JasmineBehavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & Jasmine
 
Old code doesn't stink - Detroit
Old code doesn't stink - DetroitOld code doesn't stink - Detroit
Old code doesn't stink - Detroit
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 

More from jbandi

From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reactionjbandi
 
From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reactionjbandi
 
Angular 2: What's New?
Angular 2: What's New?Angular 2: What's New?
Angular 2: What's New?jbandi
 
The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015jbandi
 
Java & JavaScript: Best Friends?
Java & JavaScript: Best Friends?Java & JavaScript: Best Friends?
Java & JavaScript: Best Friends?jbandi
 
There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014jbandi
 
Professional JavaScript Development (An Introduction for Java Developers)
Professional JavaScript Development (An Introduction for Java Developers)Professional JavaScript Development (An Introduction for Java Developers)
Professional JavaScript Development (An Introduction for Java Developers)jbandi
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMjbandi
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?jbandi
 
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?jbandi
 
Testing: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile WorldTesting: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile Worldjbandi
 

More from jbandi (11)

From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reaction
 
From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reaction
 
Angular 2: What's New?
Angular 2: What's New?Angular 2: What's New?
Angular 2: What's New?
 
The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015
 
Java & JavaScript: Best Friends?
Java & JavaScript: Best Friends?Java & JavaScript: Best Friends?
Java & JavaScript: Best Friends?
 
There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014
 
Professional JavaScript Development (An Introduction for Java Developers)
Professional JavaScript Development (An Introduction for Java Developers)Professional JavaScript Development (An Introduction for Java Developers)
Professional JavaScript Development (An Introduction for Java Developers)
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVM
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
 
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
 
Testing: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile WorldTesting: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile World
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

NDC 2011 - SpecFlow: Pragmatic BDD for .NET

  • 1. SpecFlow: Pragmatic BDD for .NET NDC 2011 GASPAR NAGY gn@techtalk.at Twitter: @gasparnagy JONAS BANDI jonas.bandi@techtalk.ch Twitter: @jbandi Oslo, 8. June 2011 COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
  • 2. TechTalk at a glance • Established: 1993 • Branches: Austria, Hungary, Switzerland • 3 Managing partners: no external owners • Employees: ~ 60 employees • Turnover 2010: ~ 7 Mio CHF • Risk rating: very low risk • Self-financing, healthy growth TechTalk office, Vienna/Austria COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
  • 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
  • 11. 3 Amigos Exceptional, Happy Feasibility Edge Cases Path 11
  • 13. ATDD: Rising the Level of Abstraction 13
  • 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
  • 18. 19
  • 19. Integrations… MSBuild MSTest 20
  • 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
  • 22. http://www.stackoverflow.com tag: specflow “haacked” Phil Haack ASP.NET MVC: A New Framework for Building Web Applications “forked” DEMO 23
  • 23. MonoDevelop Integration by Dale Ragan dale.ragan@sinesignal.com Twitter: @dwragan 24
  • 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
  • 27. Other Interpretations of BDD 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!"