SlideShare a Scribd company logo
BDD with Visual Studio 2010,
  SpecFlow and WATIN
            Charles Nurse
  Senior Architect, DotNetNuke Corp.
BDD with Visual Studio 2010, SpecFlow and WATIN

Who Am I
• ASP.NET MVP (since Jan 2007)
• ASPInsider (since Jan 2008)
• Senior Architect, DotNetNuke Corporation

•   Web: www.dotnetnuke.com
•   Blog: www.charlesnurse.com
•   Email: charles.nurse@dnncorp.com
•   Twitter: @cnurse
BDD with Visual Studio 2010, SpecFlow and WATIN

Agenda
•   Intro to BDD
•   Gherkins
•   SpecFlow
•   WatiN
BDD with Visual Studio 2010, SpecFlow and WATIN

Part I – Behavior Driven Development
• Developed by Dan North
• Response to some issues with TDD
      Where to start
      What to test and what not to test
      How much to test in one go
      What to call the tests
      How to understand why a test fails

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
BDD with Visual Studio 2010, SpecFlow and WATIN

Part I – Behavior Driven Development
• Driven by Business Value
• Realized through the Interface (GUI)
• Tests are defined in a natural language (Gherkins)
BDD with Visual Studio 2010, SpecFlow and WATIN

Part I – Behavior Driven Development
• BDD Practices
     Establish the goals of different stakeholders
     Drawing out features which will achieve those goals using feature injection
     Involve stakeholders through outside–in software development
     Use examples to describe the behavior of the application
     Automate those examples to provide feedback and regression testing
     Use 'should' when describing the behavior of software
     Use 'ensure' when describing responsibilities of software
     Use mocks to stand-in for modules of code which have not yet been written
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 2 – Gherkins
• Natural Language definition of tests.
    TDD – Arrange, Act, Assert


• Gherkin – Given, When, Then
    Given – defines the conditions that must exits for the test to be run
    When – defines the action a “user” will execute
    Then – defines the expectations of the Test


• Gherkins Frameworks
    Cucumber – Ruby
    Lettuce – Python
    Specflow - .NET
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 2 – Gherkins
• Example – "Refunded or exchanged items should be
  returned to stock.“

• Customer, Product Manager, Developer or QA engineer
  might clarify the requirements by breaking this down into
  specific scenarios

• Scenario 1: Refunded items should be returned to stock
• Scenario 2: Replaced items should be returned to stock
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 2 – Gherkins
• Scenario 1: Refunded items should be returned to stock

    Given a customer previously bought a black sweater from me
      and I currently have three black sweaters left in stock

    When he returns the sweater for a refund

    Then I should have four black sweaters in stock
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 2 – Gherkins
• Scenario 2: Replaced items should be returned to stock

    Given that a customer buys a blue garment
      and I have two blue garments in stock
      and three black garments in stock.

    When he returns the garment for a replacement in black,

    Then I should have three blue garments in stock
      and two black garments in stock
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 2 – Gherkins
• Programmer-domain examples

• Example 1: New lists are empty
    Given a new list
    Then the list should be empty


• Example 2: Lists with things in them are not empty
    Given a new list
    When we add an object
    Then the list should not be empty
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 3 – SpecFlow
• SpecFlow aims at bridging the communication gap between domain
  experts and developers by binding business readable behavior
  specifications to the underlying implementation.
       SpecFlow.org


• Visual Studio Extension – to support Gherkin language
  tests
    www.specflow.org
    https://github.com/techtalk/SpecFlow


• SpecFlow Demo
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 3 – SpecFlow
• Demo Summary
• Review of SpecFlow in VS 2010
      Reviewed the Extension Manager Addin
      Reviewed the Nuget Package (SpecFlow/NUnit) integration)
      Added a SpecFlow Feature
      Run SpecFlow Scenarios
      Added Steps File
      Updated Feature
      Updated Steps File
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 4 – WatiN
• Browser Automation Framework
     Web Application Testing in .NET
     http://watin.org/


•   Inspired by WatiR (Web Application Testing in Ruby)
•   Supports IE (6+) or Firefox (2+)
•   Licensed under Apache License 2.0
•   Available as a Nuget package
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 4 – WatiN
•   Automate all major HTML elements with ease
•   Find elements by multiple attributes
•   Native support for Page and Control model.
•   Supports AJAX website testing
•   Supports creating screenshots of webpages
•   Supports frames (cross domain) and IFrames
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 4 – WatiN
•   Handles popup dialogs like alert, confirm, login etc..
•   Supports HTML dialogs (modal and modeless)
•   Easy to integrate with your favorite (unit) test tool
•   Can be used with any .Net Language
•   Downloaded more than 120,000 times.
•   Since its open source you can add/contribute new features
    yourself!
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 4 – WatiN
• Demo
• Finish the Tests
BDD with Visual Studio 2010, SpecFlow and WATIN

Part 4 – WatiN
• Demo Summary
• Review of SpecFlow in VS 2010
      Reviewed the Nuget Package (WatiN) integration)
      Completed the SpecFlow Scenario
      Added a second SpecFlow Scenario
      Reviewed a real Scenario in a real Application
BDD with Visual Studio 2010, SpecFlow and WATIN

Next Steps
• Get Specflow
   www.specflow.org
   https://github.com/techtalk/SpecFlow


• Get WatiN
  •   http://watin.org/
BDD with Visual Studio 2010, SpecFlow and WATIN

Thank You


• Email: charles.nurse@dnncorp.com
• Blog: www.charlesnurse.com
• Twitter: @cnurse

More Related Content

What's hot

Automated Test Framework with Cucumber
Automated Test Framework with CucumberAutomated Test Framework with Cucumber
Automated Test Framework with Cucumber
Ramesh Krishnan Ganesan
 
Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)
Mindfire Solutions
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
Knoldus Inc.
 
BDD & Cucumber
BDD & CucumberBDD & Cucumber
BDD & Cucumber
Vladimir Arutin
 
Testing with test_complete
Testing with test_completeTesting with test_complete
Testing with test_completebinuiweb
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)
Peter Thomas
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
selvanathankapilan
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)
Rohit Bisht
 
Karate DSL
Karate DSLKarate DSL
Karate DSL
anil borse
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
Nibu Baby
 
Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium
Edureka!
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDD
Knoldus Inc.
 
Cucumber BDD
Cucumber BDDCucumber BDD
Cucumber BDD
Pravin Dsilva
 
Test case development
Test case developmentTest case development
Test case development
Hrushikesh Wakhle
 
Bdd Introduction
Bdd IntroductionBdd Introduction
Bdd Introduction
Skills Matter
 
BDD Approach with Karate Framework in Service Tests
BDD Approach with Karate Framework in Service TestsBDD Approach with Karate Framework in Service Tests
BDD Approach with Karate Framework in Service Tests
kloia
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
Arati Joshi
 
Types of testing
Types of testingTypes of testing
Types of testing
Valarmathi Srinivasan
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?
QATestLab
 

What's hot (20)

Automated Test Framework with Cucumber
Automated Test Framework with CucumberAutomated Test Framework with Cucumber
Automated Test Framework with Cucumber
 
Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
BDD & Cucumber
BDD & CucumberBDD & Cucumber
BDD & Cucumber
 
Testing with test_complete
Testing with test_completeTesting with test_complete
Testing with test_complete
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)
 
Karate DSL
Karate DSLKarate DSL
Karate DSL
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDD
 
Cucumber BDD
Cucumber BDDCucumber BDD
Cucumber BDD
 
Test case development
Test case developmentTest case development
Test case development
 
Bdd Introduction
Bdd IntroductionBdd Introduction
Bdd Introduction
 
BDD Approach with Karate Framework in Service Tests
BDD Approach with Karate Framework in Service TestsBDD Approach with Karate Framework in Service Tests
BDD Approach with Karate Framework in Service Tests
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
 
Types of testing
Types of testingTypes of testing
Types of testing
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?
 

Viewers also liked

Spec flow – functional testing made easy
Spec flow – functional testing made easySpec flow – functional testing made easy
Spec flow – functional testing made easyPaul Stack
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflow
cromwellryan
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
temebele
 
SpecFlow Executable Specifications
SpecFlow Executable SpecificationsSpecFlow Executable Specifications
SpecFlow Executable Specifications
Sam Leach
 
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
John Ferguson Smart Limited
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testingdversaci
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
Liz Keogh
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with CucumberBrandon Keepers
 
Behavior Driven Testing with SpecFlow
Behavior Driven Testing with SpecFlowBehavior Driven Testing with SpecFlow
Behavior Driven Testing with SpecFlow
Rachid Kherrazi
 
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
John Ferguson Smart Limited
 
BDD with JBehave
BDD with JBehaveBDD with JBehave
BDD with JBehave
Sascha Rodekamp
 
Specflow: Specification by Example
Specflow: Specification by ExampleSpecflow: Specification by Example
Specflow: Specification by Example
Sam Leach
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
Daniel Kummer
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
Qwinix Technologies
 
Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)
Ajay Danait
 
BDD in Action: Building Software Right and Building the Right Software
BDD in Action: Building Software Right and Building the Right SoftwareBDD in Action: Building Software Right and Building the Right Software
BDD in Action: Building Software Right and Building the Right Software
John Ferguson Smart Limited
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
Aiste Stikliute
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberKMS Technology
 
Why vREST?
Why vREST?Why vREST?
Why vREST?
vrest_io
 

Viewers also liked (20)

Spec flow – functional testing made easy
Spec flow – functional testing made easySpec flow – functional testing made easy
Spec flow – functional testing made easy
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflow
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
SpecFlow Executable Specifications
SpecFlow Executable SpecificationsSpecFlow Executable Specifications
SpecFlow Executable Specifications
 
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 (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 
Behavior Driven Testing with SpecFlow
Behavior Driven Testing with SpecFlowBehavior Driven Testing with SpecFlow
Behavior Driven Testing with SpecFlow
 
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
 
BDD with JBehave
BDD with JBehaveBDD with JBehave
BDD with JBehave
 
Specflow: Specification by Example
Specflow: Specification by ExampleSpecflow: Specification by Example
Specflow: Specification by Example
 
BDD using JBehave
BDD using JBehaveBDD using JBehave
BDD using JBehave
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
 
Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)
 
BDD in Action: Building Software Right and Building the Right Software
BDD in Action: Building Software Right and Building the Right SoftwareBDD in Action: Building Software Right and Building the Right Software
BDD in Action: Building Software Right and Building the Right Software
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Why vREST?
Why vREST?Why vREST?
Why vREST?
 

Similar to Bdd and spec flow

Bdd with Visual Studio 2010, Spec Flow and WatiN
Bdd with Visual Studio 2010, Spec Flow and WatiNBdd with Visual Studio 2010, Spec Flow and WatiN
Bdd with Visual Studio 2010, Spec Flow and WatiN
Charles Nurse
 
New SharePoint Features in Visual Studio 2012!
New SharePoint Features in Visual Studio 2012!New SharePoint Features in Visual Studio 2012!
New SharePoint Features in Visual Studio 2012!
SPC Adriatics
 
Lecture 1 dev_environment
Lecture 1 dev_environmentLecture 1 dev_environment
Lecture 1 dev_environment
moduledesign
 
Lecture 1 dev_environment
Lecture 1 dev_environmentLecture 1 dev_environment
Lecture 1 dev_environment
moduledesign
 
Whats new for developers in Visual Studio 2013
Whats new for developers in Visual Studio 2013Whats new for developers in Visual Studio 2013
Whats new for developers in Visual Studio 2013
Chris Dufour
 
Kenneth Webber Portfolio
Kenneth Webber PortfolioKenneth Webber Portfolio
Kenneth Webber Portfolio
Kenneth Webber
 
Mcsa certification 410
Mcsa certification 410Mcsa certification 410
Mcsa certification 410
Information Technology
 
Debugging Integration Flows
Debugging Integration FlowsDebugging Integration Flows
Debugging Integration Flows
WSO2
 
Staying connected: An Overview of Announcements from Microsoft’s Connect();
Staying connected: An Overview of Announcements from Microsoft’s Connect();Staying connected: An Overview of Announcements from Microsoft’s Connect();
Staying connected: An Overview of Announcements from Microsoft’s Connect();
dotNet Miami
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
Nalin Goonawardana
 
Converting SAP Business Objects to a New Architecture Solution
Converting SAP Business Objects to a New Architecture SolutionConverting SAP Business Objects to a New Architecture Solution
Converting SAP Business Objects to a New Architecture Solution
Denodo
 
Codestrong 2012 breakout session how to develop your own modules
Codestrong 2012 breakout session   how to develop your own modulesCodestrong 2012 breakout session   how to develop your own modules
Codestrong 2012 breakout session how to develop your own modulesAxway Appcelerator
 
Introduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumIntroduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator Titanium
Aaron Saunders
 
The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012
Imaginet
 
The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012
Imaginet
 
Unit Testing and Why it Matters
Unit Testing and Why it MattersUnit Testing and Why it Matters
Unit Testing and Why it Matters
yahyaSadiiq
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
Mike Douglas
 
DEVASC_Module_1.pdf
DEVASC_Module_1.pdfDEVASC_Module_1.pdf
DEVASC_Module_1.pdf
MorooCoffee
 
Software proposal sample_project_1-_web_site_development_by_zx_7_of_november_...
Software proposal sample_project_1-_web_site_development_by_zx_7_of_november_...Software proposal sample_project_1-_web_site_development_by_zx_7_of_november_...
Software proposal sample_project_1-_web_site_development_by_zx_7_of_november_...
Oleg Zhuravlev
 
Tech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagyTech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagySkills Matter
 

Similar to Bdd and spec flow (20)

Bdd with Visual Studio 2010, Spec Flow and WatiN
Bdd with Visual Studio 2010, Spec Flow and WatiNBdd with Visual Studio 2010, Spec Flow and WatiN
Bdd with Visual Studio 2010, Spec Flow and WatiN
 
New SharePoint Features in Visual Studio 2012!
New SharePoint Features in Visual Studio 2012!New SharePoint Features in Visual Studio 2012!
New SharePoint Features in Visual Studio 2012!
 
Lecture 1 dev_environment
Lecture 1 dev_environmentLecture 1 dev_environment
Lecture 1 dev_environment
 
Lecture 1 dev_environment
Lecture 1 dev_environmentLecture 1 dev_environment
Lecture 1 dev_environment
 
Whats new for developers in Visual Studio 2013
Whats new for developers in Visual Studio 2013Whats new for developers in Visual Studio 2013
Whats new for developers in Visual Studio 2013
 
Kenneth Webber Portfolio
Kenneth Webber PortfolioKenneth Webber Portfolio
Kenneth Webber Portfolio
 
Mcsa certification 410
Mcsa certification 410Mcsa certification 410
Mcsa certification 410
 
Debugging Integration Flows
Debugging Integration FlowsDebugging Integration Flows
Debugging Integration Flows
 
Staying connected: An Overview of Announcements from Microsoft’s Connect();
Staying connected: An Overview of Announcements from Microsoft’s Connect();Staying connected: An Overview of Announcements from Microsoft’s Connect();
Staying connected: An Overview of Announcements from Microsoft’s Connect();
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
Converting SAP Business Objects to a New Architecture Solution
Converting SAP Business Objects to a New Architecture SolutionConverting SAP Business Objects to a New Architecture Solution
Converting SAP Business Objects to a New Architecture Solution
 
Codestrong 2012 breakout session how to develop your own modules
Codestrong 2012 breakout session   how to develop your own modulesCodestrong 2012 breakout session   how to develop your own modules
Codestrong 2012 breakout session how to develop your own modules
 
Introduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumIntroduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator Titanium
 
The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012
 
The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012
 
Unit Testing and Why it Matters
Unit Testing and Why it MattersUnit Testing and Why it Matters
Unit Testing and Why it Matters
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
DEVASC_Module_1.pdf
DEVASC_Module_1.pdfDEVASC_Module_1.pdf
DEVASC_Module_1.pdf
 
Software proposal sample_project_1-_web_site_development_by_zx_7_of_november_...
Software proposal sample_project_1-_web_site_development_by_zx_7_of_november_...Software proposal sample_project_1-_web_site_development_by_zx_7_of_november_...
Software proposal sample_project_1-_web_site_development_by_zx_7_of_november_...
 
Tech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagyTech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagy
 

Recently uploaded

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 

Recently uploaded (20)

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 

Bdd and spec flow

  • 1. BDD with Visual Studio 2010, SpecFlow and WATIN Charles Nurse Senior Architect, DotNetNuke Corp.
  • 2. BDD with Visual Studio 2010, SpecFlow and WATIN Who Am I • ASP.NET MVP (since Jan 2007) • ASPInsider (since Jan 2008) • Senior Architect, DotNetNuke Corporation • Web: www.dotnetnuke.com • Blog: www.charlesnurse.com • Email: charles.nurse@dnncorp.com • Twitter: @cnurse
  • 3. BDD with Visual Studio 2010, SpecFlow and WATIN Agenda • Intro to BDD • Gherkins • SpecFlow • WatiN
  • 4. BDD with Visual Studio 2010, SpecFlow and WATIN Part I – Behavior Driven Development • Developed by Dan North • Response to some issues with TDD  Where to start  What to test and what not to test  How much to test in one go  What to call the tests  How to understand why a test fails 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
  • 5. BDD with Visual Studio 2010, SpecFlow and WATIN Part I – Behavior Driven Development • Driven by Business Value • Realized through the Interface (GUI) • Tests are defined in a natural language (Gherkins)
  • 6. BDD with Visual Studio 2010, SpecFlow and WATIN Part I – Behavior Driven Development • BDD Practices  Establish the goals of different stakeholders  Drawing out features which will achieve those goals using feature injection  Involve stakeholders through outside–in software development  Use examples to describe the behavior of the application  Automate those examples to provide feedback and regression testing  Use 'should' when describing the behavior of software  Use 'ensure' when describing responsibilities of software  Use mocks to stand-in for modules of code which have not yet been written
  • 7. BDD with Visual Studio 2010, SpecFlow and WATIN Part 2 – Gherkins • Natural Language definition of tests.  TDD – Arrange, Act, Assert • Gherkin – Given, When, Then  Given – defines the conditions that must exits for the test to be run  When – defines the action a “user” will execute  Then – defines the expectations of the Test • Gherkins Frameworks  Cucumber – Ruby  Lettuce – Python  Specflow - .NET
  • 8. BDD with Visual Studio 2010, SpecFlow and WATIN Part 2 – Gherkins • Example – "Refunded or exchanged items should be returned to stock.“ • Customer, Product Manager, Developer or QA engineer might clarify the requirements by breaking this down into specific scenarios • Scenario 1: Refunded items should be returned to stock • Scenario 2: Replaced items should be returned to stock
  • 9. BDD with Visual Studio 2010, SpecFlow and WATIN Part 2 – Gherkins • Scenario 1: Refunded items should be returned to stock  Given a customer previously bought a black sweater from me  and I currently have three black sweaters left in stock  When he returns the sweater for a refund  Then I should have four black sweaters in stock
  • 10. BDD with Visual Studio 2010, SpecFlow and WATIN Part 2 – Gherkins • Scenario 2: Replaced items should be returned to stock  Given that a customer buys a blue garment  and I have two blue garments in stock  and three black garments in stock.  When he returns the garment for a replacement in black,  Then I should have three blue garments in stock  and two black garments in stock
  • 11. BDD with Visual Studio 2010, SpecFlow and WATIN Part 2 – Gherkins • Programmer-domain examples • Example 1: New lists are empty  Given a new list  Then the list should be empty • Example 2: Lists with things in them are not empty  Given a new list  When we add an object  Then the list should not be empty
  • 12. BDD with Visual Studio 2010, SpecFlow and WATIN Part 3 – SpecFlow • SpecFlow aims at bridging the communication gap between domain experts and developers by binding business readable behavior specifications to the underlying implementation. SpecFlow.org • Visual Studio Extension – to support Gherkin language tests  www.specflow.org  https://github.com/techtalk/SpecFlow • SpecFlow Demo
  • 13. BDD with Visual Studio 2010, SpecFlow and WATIN Part 3 – SpecFlow • Demo Summary • Review of SpecFlow in VS 2010  Reviewed the Extension Manager Addin  Reviewed the Nuget Package (SpecFlow/NUnit) integration)  Added a SpecFlow Feature  Run SpecFlow Scenarios  Added Steps File  Updated Feature  Updated Steps File
  • 14. BDD with Visual Studio 2010, SpecFlow and WATIN Part 4 – WatiN • Browser Automation Framework  Web Application Testing in .NET  http://watin.org/ • Inspired by WatiR (Web Application Testing in Ruby) • Supports IE (6+) or Firefox (2+) • Licensed under Apache License 2.0 • Available as a Nuget package
  • 15. BDD with Visual Studio 2010, SpecFlow and WATIN Part 4 – WatiN • Automate all major HTML elements with ease • Find elements by multiple attributes • Native support for Page and Control model. • Supports AJAX website testing • Supports creating screenshots of webpages • Supports frames (cross domain) and IFrames
  • 16. BDD with Visual Studio 2010, SpecFlow and WATIN Part 4 – WatiN • Handles popup dialogs like alert, confirm, login etc.. • Supports HTML dialogs (modal and modeless) • Easy to integrate with your favorite (unit) test tool • Can be used with any .Net Language • Downloaded more than 120,000 times. • Since its open source you can add/contribute new features yourself!
  • 17. BDD with Visual Studio 2010, SpecFlow and WATIN Part 4 – WatiN • Demo • Finish the Tests
  • 18. BDD with Visual Studio 2010, SpecFlow and WATIN Part 4 – WatiN • Demo Summary • Review of SpecFlow in VS 2010  Reviewed the Nuget Package (WatiN) integration)  Completed the SpecFlow Scenario  Added a second SpecFlow Scenario  Reviewed a real Scenario in a real Application
  • 19. BDD with Visual Studio 2010, SpecFlow and WATIN Next Steps • Get Specflow  www.specflow.org  https://github.com/techtalk/SpecFlow • Get WatiN • http://watin.org/
  • 20. BDD with Visual Studio 2010, SpecFlow and WATIN Thank You • Email: charles.nurse@dnncorp.com • Blog: www.charlesnurse.com • Twitter: @cnurse

Editor's Notes

  1. http://en.wikipedia.org/wiki/Behavior_Driven_Developmenthttp://behaviour-driven.org/
  2. BDD is driven by business value[6]; that is, the benefit to the business which accrues once the application is in production. The only way in which this benefit can be realized is through the user interface(s) to the application, usually (but not always) a GUI.In the same way, each piece of code, starting with the UI, can be considered a stakeholder of the other modules of code which it uses. Each element of code provides some aspect of behavior which, in collaboration with the other elements, provides the application behavior.The first piece of production code that BDD developers implement is the UI. Developers can then benefit from quick feedback as to whether the UI looks and behaves appropriately. Through code, and using principles of good design and refactoring, developers discover collaborators of the UI, and of every unit of code thereafter. This helps them adhere to the principle of YAGNI, since each piece of production code is required either by the business, or by another piece of code already written.BDD focuses on obtaining a clear understanding of desired software behavior through discussion with stakeholders. It extends TDD by writing test cases in a natural language that non-programmers can read. Behavior-driven developers use their native language in combination with the ubiquitous language of domain-driven design to describe the purpose and benefit of their code. This allows the developers to focus on why the code should be created, rather than the technical details, and minimizes translation between the technical language in which the code is written and the domain language spoken by the business, users, stakeholders, project management, etc
  3. Establishing the goals of different stakeholders required for a vision to be implementedDrawing out features which will achieve those goals using feature injectionInvolving stakeholders in the implementation process through outside–in software developmentUsing examples to describe the behavior of the application, or of units of codeAutomating those examples to provide quick feedback and regression testingUsing 'should' when describing the behavior of software to help clarify responsibility and allow the software's functionality to be questionedUsing 'ensure' when describing responsibilities of software to differentiate outcomes in the scope of the code in question from side-effects of other elements of code.Using mocks to stand-in for collaborating modules of code which have not yet been written