SlideShare una empresa de Scribd logo
1 de 13
Learn how SpecFlow enables you to do TDD
with friction-free plain-English executable tests.
Larry Apke
Agile Expert
www.agile-doctor.com
larry@agile-doctor.com
• Who are You?
• Who I am and What I Believe
• What is BDD?
• SpecFlow Overview
• Visual Studio 12 SpecFlow Installation
• Interacting with Code!
Who are you?
•How many .net programmers?
•How many using Visual Studio 2012?
•How many familiar with TDD?
•How many familiar with BDD?
•How many using/used SpecFlow?
Who I am:
•A Certified Scrum Master and Certified Scrum Professional
with over 5 years experience in Agile development.
•A former Director of Software Development, Manager of
Software Development, Project Manager, etc.
Who I am not:
•A .Net Programmer
What I believe:
•If you are a programmer and have not acquainted yourself
with and mastered BDD/TDD then you are no longer a true
craftsman.
“TDD is probably the single most important practice
discovered in the last 10 years. “ - Robert Martin
Founder, CEO and President Object Mentor Inc.

•Without automated executable specifications (like those
created through BDD), it is nearly impossible to be truly
Agile.
•Over the next five years BDD/TDD will become THE
standard for software development.
• BDD is a software development process based on test-

driven development (TDD). Sometimes described as
“TDD done right.”
• Developed by Dan North as a response to the issues
encountered teaching test-driven development.
• “BDD is a second-generation, outside–in, pull-based,
multiple-stakeholder, multiple-scale, highautomation, 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 utilizes Ubiquitous Business Language (UBL),

which is composed of plain English, to create
executable specifications.
• Because of UBL, BDD is concerned with the
communication between business needs and
developers.
• BDD allows for frameworks like SpecFlow to automate
the running of the executable specifications by using
Scenarios written using the Gherkin language (Given,
When, Then) - called Gherkin because of Cucumber
(a Ruby BDD Framework that inspired SpecFlow).
Input

Feature File

Output

SpecFlow

Unit Test File

Step Definitions File
SpecFlow

Unit Test File

Test Results File

Step Definitions File

Test Results Report

Class File
• Easy to install with Visual Studio Gallery
• Nearly impossible to get working under Visual

Studio Express but you can try http://watirmelon.com/2011/02/18/c-sharp-atdd-ona-shoestring/
• Make sure that you add SpecFlow and Nunit to your
Windows path
• If you use Nunit you will need something to run the
tests – like Resharper– but you can create a batch file
that will run Nunit and add it to your Tools menu
• Batch File Copy and Paste:

@echo off
nunit-console %1
specflow.exe nunitexecutionreport %2
/xmlTestResult:%3
if NOT %errorlevel% == 0 (
echo "Error generating report - %errorlevel%"
GOTO :exit
)
if %errorlevel% ==0 TestResult.html
:exit
• External Tools Setup:

Title – Run SpecFlow
Command – C:PATH TO FILEnameofbatfile.bat
Arguments - $(TargetName)$(TargetExt)
$(ProjectDir)$(ProjectFileName)
$(BinDir)TestResult.xml
Initial Directory - $(BinDir)
Check Use Output Window
• Setup Project

• Setup the test engine for your project through NuGet
•

•
•
•

- PM> Install-Package SpecFlow.Nunit
Create Feature File
Create Step Definitions
Run Test(s)
Write and Refactor

Más contenido relacionado

Destacado

Introduction to the Improvement Kata
Introduction to the Improvement KataIntroduction to the Improvement Kata
Introduction to the Improvement Kata
Mike Rother
 

Destacado (7)

Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot Framework
 
Cross mobile testautomation mit Xamarin & SpecFlow
Cross mobile testautomation mit Xamarin & SpecFlowCross mobile testautomation mit Xamarin & SpecFlow
Cross mobile testautomation mit Xamarin & SpecFlow
 
API Testing
API TestingAPI Testing
API Testing
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
Introduction to the Improvement Kata
Introduction to the Improvement KataIntroduction to the Improvement Kata
Introduction to the Improvement Kata
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
The Executives Guide
The Executives GuideThe Executives Guide
The Executives Guide
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

BDD with Visual Studio 2012 and SpecFlow

  • 1. Learn how SpecFlow enables you to do TDD with friction-free plain-English executable tests. Larry Apke Agile Expert www.agile-doctor.com larry@agile-doctor.com
  • 2. • Who are You? • Who I am and What I Believe • What is BDD? • SpecFlow Overview • Visual Studio 12 SpecFlow Installation • Interacting with Code!
  • 3. Who are you? •How many .net programmers? •How many using Visual Studio 2012? •How many familiar with TDD? •How many familiar with BDD? •How many using/used SpecFlow?
  • 4. Who I am: •A Certified Scrum Master and Certified Scrum Professional with over 5 years experience in Agile development. •A former Director of Software Development, Manager of Software Development, Project Manager, etc. Who I am not: •A .Net Programmer
  • 5. What I believe: •If you are a programmer and have not acquainted yourself with and mastered BDD/TDD then you are no longer a true craftsman. “TDD is probably the single most important practice discovered in the last 10 years. “ - Robert Martin Founder, CEO and President Object Mentor Inc. •Without automated executable specifications (like those created through BDD), it is nearly impossible to be truly Agile. •Over the next five years BDD/TDD will become THE standard for software development.
  • 6. • BDD is a software development process based on test- driven development (TDD). Sometimes described as “TDD done right.” • Developed by Dan North as a response to the issues encountered teaching test-driven development. • “BDD is a second-generation, outside–in, pull-based, multiple-stakeholder, multiple-scale, highautomation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters.” – Dan North
  • 7. • BDD utilizes Ubiquitous Business Language (UBL), which is composed of plain English, to create executable specifications. • Because of UBL, BDD is concerned with the communication between business needs and developers. • BDD allows for frameworks like SpecFlow to automate the running of the executable specifications by using Scenarios written using the Gherkin language (Given, When, Then) - called Gherkin because of Cucumber (a Ruby BDD Framework that inspired SpecFlow).
  • 8. Input Feature File Output SpecFlow Unit Test File Step Definitions File
  • 9. SpecFlow Unit Test File Test Results File Step Definitions File Test Results Report Class File
  • 10. • Easy to install with Visual Studio Gallery • Nearly impossible to get working under Visual Studio Express but you can try http://watirmelon.com/2011/02/18/c-sharp-atdd-ona-shoestring/ • Make sure that you add SpecFlow and Nunit to your Windows path • If you use Nunit you will need something to run the tests – like Resharper– but you can create a batch file that will run Nunit and add it to your Tools menu
  • 11. • Batch File Copy and Paste: @echo off nunit-console %1 specflow.exe nunitexecutionreport %2 /xmlTestResult:%3 if NOT %errorlevel% == 0 ( echo "Error generating report - %errorlevel%" GOTO :exit ) if %errorlevel% ==0 TestResult.html :exit
  • 12. • External Tools Setup: Title – Run SpecFlow Command – C:PATH TO FILEnameofbatfile.bat Arguments - $(TargetName)$(TargetExt) $(ProjectDir)$(ProjectFileName) $(BinDir)TestResult.xml Initial Directory - $(BinDir) Check Use Output Window
  • 13. • Setup Project • Setup the test engine for your project through NuGet • • • • - PM> Install-Package SpecFlow.Nunit Create Feature File Create Step Definitions Run Test(s) Write and Refactor