SlideShare ist ein Scribd-Unternehmen logo
1 von 26
SpecFlow ‘functional testing made easy’Twitter: @stack72Email: public@paulstack.co.ukBlog: http://paulstack.co.uk/blog
Agenda A look at ‘traditional testing’ Introduction to BDD ‘Testing Pyramid’ BDD Tools Introduction to WatiN The Marriage of SpecFlow and WatiN
Traditional Testing Ethos Kent Beck introduced us to what testing should be in late 1990’s It was the first real indication that testing should be part of the software development lifecycle Unit Tests smallest testable part of an application - e.g. method or function programmer writes as many tests as they can think of that might "break" the code every piece of code that is written will have tests for it Acceptance Tests can be broken down to smoke tests, user acceptance tests and integration tests verify that requirements as understood by developers satisfy the customers requirements This led to practices like TDD
What is TDD? Write a test beforewriting the production code Make a minimal change to the production code to make the test pass Refactor the code to make it better  Advantages Provides a form of documentation Also provides a safety net when code changes Questions? Where do we start? What is a good enough test? How does this relate to the user stories?
Test Driven Development Cycle
How should these change? March 2006 – Dan North (@Tastapod) he discusses he had a problem with traditional TDD and that he ran into the same problems all other developers ran into - where to start, what to test and what not to test he decided to represent TDD in a way to avoid the pitfalls and get straight to the good stuff The article was called – “Introducing BDD”
BDD Key points Test method names should be sentences A simple sentence template keeps test methods focused An expressive test name is helpful when a test fails “Behaviour” is a more useful word than “test” Requirements are behaviour BDD provides a “ubiquitous language” for analysis (GWT) Acceptance criteria should be executable
Behavioural Driven Development Cycle
How do acceptance tests and unit tests work with each other?
BDD Testing Tools
Different Tools + MSpec, Rspec, Cuke4Nuke etc…
What is SpecFlow? SpecFlow is a .Net tool that lets you write specifications / user stories in plain readable Gherkin format It integrates with Visual Studio, which means you get File->New templates for creating new feature files Gives VS debugger support, so you can set breakpoints on Given/When/Then lines in your .feature files and step through their execution When you compile a project containing SpecFlow feature files, the output is an NUnit test assembly, so you can use your favourite NUnit-compatible test runner or existing CI infrastructure to run the specifications with no additional configuration.
SpecFlow basically turns this type of business level detail: General rules for entering leader boards Usernames need to be checked for profanities before publication. Users will always be asked to post their scores to the leader boards, they won't be done automatically. A user has to complete at least one question correctly to be eligible to be added to the leader board. Users who don't post their scores to the leader board will not appear in any of the leader board stats. A user cannot post their score to the leader board without logging in or registering. Even if  a user hasn't submitted their score to the leader board, show them where they would be positioned in the leader board, when they view it.
Into this level of breakdown: Given a user wants to post their score to a leader board When they have registered the nickname ‘knobhead’ Then that nickname fails the profanity test Given a user wants to post their score to a leader board When they have registered the nickname ‘QuizStar’ Then that nickname passes the profanity test
General rules for entering leader boards Usernames need to be checked for profanities before publication. Users will always be asked to post their scores to the leader boards, they won't be done automatically. A user has to complete at least one question correctly to be eligible to be added to the leader board. Users who don't post their scores to the leader board will not appear in any of the leader board stats. A user cannot post their score to the leader board without logging in or registering. Even if  a user hasn't submitted their score to the leader board, show them where they would be positioned in the leader board, when they view it.
Given a user finishes a quiz When the user is not logged in Then the user is offered the chance to enter the leader board And the post to leader board button redirects to login page Given a user finishes a quiz When the user is logged in Then the user is offered the chance to enter the leader board 	And the post to leader board button returns successful entry
BDD Testing Tools
WatiN
What is WatiN? Open source API (watin.org) that actually uses the browser for testing NOT emulating it Integrates with Visual Studio so tests can be debugged The most impressive feature of WatiN is the level of access you have to the DOM. Web tests are able to find elements by id, index, name, text, CSS class, etc., iterate through collections of elements, and invoke any event.
Front End Testing – Good Practice? Everything should be tested BUT we need to remember a few things when testing the UI UI tests: Can be brittle Can take time Should not replace unit and integration tests Should not be taken as 100% gospel truth
Demo…..
Summary We have looked at: Traditional testing ethos Emergence of BDD SpecFlow as a BDD tool WatiN as a testing tool SpecFlow + WatiN – Marriage made in heaven
Questions…..??
Thanks!  Twitter: @stack72 Email: public@paulstack.co.uk Blog: http://paulstack.co.uk/blog

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDDKnoldus Inc.
 
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UX
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UXBehaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UX
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UXJohn Patterson
 
ATDD in Practice
ATDD in PracticeATDD in Practice
ATDD in PracticeSteven Mak
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven developmenttoteb5
 
BDD in Action - Automated Web Testing with WebDriver and Serenity
BDD in Action - Automated Web Testing with WebDriver and SerenityBDD in Action - Automated Web Testing with WebDriver and Serenity
BDD in Action - Automated Web Testing with WebDriver and SerenityJohn Ferguson Smart Limited
 
Tech talks #1- Unit testing and TDD
Tech talks #1- Unit testing and TDDTech talks #1- Unit testing and TDD
Tech talks #1- Unit testing and TDDDUONG Trong Tan
 
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)Kaunas Java User Group
 
PHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for BeginnersPHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for BeginnersAdam Englander
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiFlorent Batard
 
Writing Testable Code
Writing Testable CodeWriting Testable Code
Writing Testable Codejameshalsall
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Babul Mirdha
 
Test Driven Development presentation delhi meetup
Test Driven Development presentation delhi meetupTest Driven Development presentation delhi meetup
Test Driven Development presentation delhi meetupNaveen Kumar Singh
 

Was ist angesagt? (20)

BDD for APIs
BDD for APIsBDD for APIs
BDD for APIs
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to 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
 
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UX
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UXBehaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UX
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UX
 
TDD and BDD and ATDD
TDD and BDD and ATDDTDD and BDD and ATDD
TDD and BDD and ATDD
 
BDD-Driven Microservices
BDD-Driven MicroservicesBDD-Driven Microservices
BDD-Driven Microservices
 
Help! My Legacy Application is Unmaintainable!
Help! My Legacy Application is Unmaintainable!Help! My Legacy Application is Unmaintainable!
Help! My Legacy Application is Unmaintainable!
 
ATDD in Practice
ATDD in PracticeATDD in Practice
ATDD in Practice
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven development
 
BDD in Action - Automated Web Testing with WebDriver and Serenity
BDD in Action - Automated Web Testing with WebDriver and SerenityBDD in Action - Automated Web Testing with WebDriver and Serenity
BDD in Action - Automated Web Testing with WebDriver and Serenity
 
Automation and Technical Debt
Automation and Technical DebtAutomation and Technical Debt
Automation and Technical Debt
 
Tech talks #1- Unit testing and TDD
Tech talks #1- Unit testing and TDDTech talks #1- Unit testing and TDD
Tech talks #1- Unit testing and TDD
 
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
 
Serenity-BDD training
Serenity-BDD trainingSerenity-BDD training
Serenity-BDD training
 
PHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for BeginnersPHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for Beginners
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansai
 
Writing Testable Code
Writing Testable CodeWriting Testable Code
Writing Testable Code
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)
 
Test Driven Development presentation delhi meetup
Test Driven Development presentation delhi meetupTest Driven Development presentation delhi meetup
Test Driven Development presentation delhi meetup
 

Andere mochten auch

Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflowcromwellryan
 
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 with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with CucumberBrandon Keepers
 
Functional specification
Functional specificationFunctional specification
Functional specificationvurimi prasad
 
Specflow: Specification by Example
Specflow: Specification by ExampleSpecflow: Specification by Example
Specflow: Specification by ExampleSam Leach
 
A Lap Around PowerShell 3.0
A Lap Around PowerShell 3.0A Lap Around PowerShell 3.0
A Lap Around PowerShell 3.0Sarah Dutkiewicz
 
The Dark Side of Code Metrics
The Dark Side of Code MetricsThe Dark Side of Code Metrics
The Dark Side of Code MetricsDonald Belcham
 
StarEast2013 - kanban for test teams
StarEast2013 - kanban for test teamsStarEast2013 - kanban for test teams
StarEast2013 - kanban for test teamsDerk-Jan de Grood
 
Introduction to kanban
Introduction to kanbanIntroduction to kanban
Introduction to kanbanRobert Dempsey
 
Transparent firewall filtering bridge - pf sense 2.0.2 by william tarrh
Transparent firewall filtering bridge - pf sense 2.0.2 by william tarrhTransparent firewall filtering bridge - pf sense 2.0.2 by william tarrh
Transparent firewall filtering bridge - pf sense 2.0.2 by william tarrhHichem Chehida
 
How to Get Started with Kanban, and Why
How to Get Started with Kanban, and WhyHow to Get Started with Kanban, and Why
How to Get Started with Kanban, and WhyIngvald Skaug
 
Maersk Line's Agile Journey LESS 2012
Maersk Line's Agile Journey LESS 2012 Maersk Line's Agile Journey LESS 2012
Maersk Line's Agile Journey LESS 2012 OzlemYuce
 
Gherkin for test automation in agile
Gherkin for test automation in agileGherkin for test automation in agile
Gherkin for test automation in agileViresh Doshi
 
Identifying and managing waste in software product development
Identifying and managing waste in software product developmentIdentifying and managing waste in software product development
Identifying and managing waste in software product developmentKen Power
 
Kanban 101 - 3 - Kanban Essentials
Kanban 101 - 3 - Kanban EssentialsKanban 101 - 3 - Kanban Essentials
Kanban 101 - 3 - Kanban EssentialsMichael Sahota
 

Andere mochten auch (20)

Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflow
 
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 with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 
Functional specification
Functional specificationFunctional specification
Functional specification
 
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
 
A Lap Around PowerShell 3.0
A Lap Around PowerShell 3.0A Lap Around PowerShell 3.0
A Lap Around PowerShell 3.0
 
Kanban in sw development
Kanban in sw developmentKanban in sw development
Kanban in sw development
 
The Dark Side of Code Metrics
The Dark Side of Code MetricsThe Dark Side of Code Metrics
The Dark Side of Code Metrics
 
StarEast2013 - kanban for test teams
StarEast2013 - kanban for test teamsStarEast2013 - kanban for test teams
StarEast2013 - kanban for test teams
 
Introduction to kanban
Introduction to kanbanIntroduction to kanban
Introduction to kanban
 
Transparent firewall filtering bridge - pf sense 2.0.2 by william tarrh
Transparent firewall filtering bridge - pf sense 2.0.2 by william tarrhTransparent firewall filtering bridge - pf sense 2.0.2 by william tarrh
Transparent firewall filtering bridge - pf sense 2.0.2 by william tarrh
 
How to Get Started with Kanban, and Why
How to Get Started with Kanban, and WhyHow to Get Started with Kanban, and Why
How to Get Started with Kanban, and Why
 
Maersk Line's Agile Journey LESS 2012
Maersk Line's Agile Journey LESS 2012 Maersk Line's Agile Journey LESS 2012
Maersk Line's Agile Journey LESS 2012
 
Combating entropy in business
Combating entropy in businessCombating entropy in business
Combating entropy in business
 
Mvvm basics
Mvvm basicsMvvm basics
Mvvm basics
 
Gherkin for test automation in agile
Gherkin for test automation in agileGherkin for test automation in agile
Gherkin for test automation in agile
 
Identifying and managing waste in software product development
Identifying and managing waste in software product developmentIdentifying and managing waste in software product development
Identifying and managing waste in software product development
 
Kanban 101 - 3 - Kanban Essentials
Kanban 101 - 3 - Kanban EssentialsKanban 101 - 3 - Kanban Essentials
Kanban 101 - 3 - Kanban Essentials
 

Ähnlich wie Spec flow – functional testing made easy

CucumberSeleniumWD
CucumberSeleniumWDCucumberSeleniumWD
CucumberSeleniumWDVikas Sarin
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentMichael Denomy
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Robin O'Brien
 
Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1willmation
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQASymphony
 
Code Review
Code ReviewCode Review
Code ReviewRavi Raj
 
The Essentials Of Test Driven Development
The Essentials Of Test Driven Development The Essentials Of Test Driven Development
The Essentials Of Test Driven Development Rock Interview
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Developmentadrianmitev
 
BDD approach with Selenium RC
BDD approach with Selenium RCBDD approach with Selenium RC
BDD approach with Selenium RCMykola Kolisnyk
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionPyxis Technologies
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginnersAdam Englander
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by ExampleNalin Goonawardana
 
General technical interview questions
General technical interview questionsGeneral technical interview questions
General technical interview questionsKevalkumar Shah
 
Software presentation
Software presentationSoftware presentation
Software presentationJennaPrengle
 
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanBehavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanQA or the Highway
 
TDD with Visual Studio 2010
TDD with Visual Studio 2010TDD with Visual Studio 2010
TDD with Visual Studio 2010Stefano Paluello
 
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual StudioSPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual StudioNCCOMMS
 

Ähnlich wie Spec flow – functional testing made easy (20)

CucumberSeleniumWD
CucumberSeleniumWDCucumberSeleniumWD
CucumberSeleniumWD
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development
 
Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the Enterprise
 
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd   seven years afterIan Cooper webinar for DDD Iran: Kent beck style tdd   seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
 
Code Review
Code ReviewCode Review
Code Review
 
The Essentials Of Test Driven Development
The Essentials Of Test Driven Development The Essentials Of Test Driven Development
The Essentials Of Test Driven Development
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
BDD approach with Selenium RC
BDD approach with Selenium RCBDD approach with Selenium RC
BDD approach with Selenium RC
 
Presentation_TDD
Presentation_TDDPresentation_TDD
Presentation_TDD
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginners
 
Agile testing
Agile testingAgile testing
Agile testing
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
General technical interview questions
General technical interview questionsGeneral technical interview questions
General technical interview questions
 
Software presentation
Software presentationSoftware presentation
Software presentation
 
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanBehavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
 
TDD with Visual Studio 2010
TDD with Visual Studio 2010TDD with Visual Studio 2010
TDD with Visual Studio 2010
 
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual StudioSPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
 

Mehr von Paul Stack

Vagrant - the essence of DevOps in a tool
Vagrant - the essence of DevOps in a toolVagrant - the essence of DevOps in a tool
Vagrant - the essence of DevOps in a toolPaul Stack
 
Puppet powershell
Puppet powershellPuppet powershell
Puppet powershellPaul Stack
 
Vagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of developmentVagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of developmentPaul Stack
 
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConfWindows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConfPaul Stack
 
Windows: Having it's ass kicked by Puppet and PowerShell since 2012
Windows: Having it's ass kicked by Puppet and PowerShell since 2012Windows: Having it's ass kicked by Puppet and PowerShell since 2012
Windows: Having it's ass kicked by Puppet and PowerShell since 2012Paul Stack
 
Beginners Guide to CI
Beginners Guide to CIBeginners Guide to CI
Beginners Guide to CIPaul Stack
 

Mehr von Paul Stack (6)

Vagrant - the essence of DevOps in a tool
Vagrant - the essence of DevOps in a toolVagrant - the essence of DevOps in a tool
Vagrant - the essence of DevOps in a tool
 
Puppet powershell
Puppet powershellPuppet powershell
Puppet powershell
 
Vagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of developmentVagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of development
 
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConfWindows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf
 
Windows: Having it's ass kicked by Puppet and PowerShell since 2012
Windows: Having it's ass kicked by Puppet and PowerShell since 2012Windows: Having it's ass kicked by Puppet and PowerShell since 2012
Windows: Having it's ass kicked by Puppet and PowerShell since 2012
 
Beginners Guide to CI
Beginners Guide to CIBeginners Guide to CI
Beginners Guide to CI
 

Kürzlich hochgeladen

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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 WorkerThousandEyes
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Kürzlich hochgeladen (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Spec flow – functional testing made easy

  • 1. SpecFlow ‘functional testing made easy’Twitter: @stack72Email: public@paulstack.co.ukBlog: http://paulstack.co.uk/blog
  • 2. Agenda A look at ‘traditional testing’ Introduction to BDD ‘Testing Pyramid’ BDD Tools Introduction to WatiN The Marriage of SpecFlow and WatiN
  • 3. Traditional Testing Ethos Kent Beck introduced us to what testing should be in late 1990’s It was the first real indication that testing should be part of the software development lifecycle Unit Tests smallest testable part of an application - e.g. method or function programmer writes as many tests as they can think of that might "break" the code every piece of code that is written will have tests for it Acceptance Tests can be broken down to smoke tests, user acceptance tests and integration tests verify that requirements as understood by developers satisfy the customers requirements This led to practices like TDD
  • 4. What is TDD? Write a test beforewriting the production code Make a minimal change to the production code to make the test pass Refactor the code to make it better Advantages Provides a form of documentation Also provides a safety net when code changes Questions? Where do we start? What is a good enough test? How does this relate to the user stories?
  • 6. How should these change? March 2006 – Dan North (@Tastapod) he discusses he had a problem with traditional TDD and that he ran into the same problems all other developers ran into - where to start, what to test and what not to test he decided to represent TDD in a way to avoid the pitfalls and get straight to the good stuff The article was called – “Introducing BDD”
  • 7. BDD Key points Test method names should be sentences A simple sentence template keeps test methods focused An expressive test name is helpful when a test fails “Behaviour” is a more useful word than “test” Requirements are behaviour BDD provides a “ubiquitous language” for analysis (GWT) Acceptance criteria should be executable
  • 9. How do acceptance tests and unit tests work with each other?
  • 10.
  • 11.
  • 13. Different Tools + MSpec, Rspec, Cuke4Nuke etc…
  • 14. What is SpecFlow? SpecFlow is a .Net tool that lets you write specifications / user stories in plain readable Gherkin format It integrates with Visual Studio, which means you get File->New templates for creating new feature files Gives VS debugger support, so you can set breakpoints on Given/When/Then lines in your .feature files and step through their execution When you compile a project containing SpecFlow feature files, the output is an NUnit test assembly, so you can use your favourite NUnit-compatible test runner or existing CI infrastructure to run the specifications with no additional configuration.
  • 15. SpecFlow basically turns this type of business level detail: General rules for entering leader boards Usernames need to be checked for profanities before publication. Users will always be asked to post their scores to the leader boards, they won't be done automatically. A user has to complete at least one question correctly to be eligible to be added to the leader board. Users who don't post their scores to the leader board will not appear in any of the leader board stats. A user cannot post their score to the leader board without logging in or registering. Even if  a user hasn't submitted their score to the leader board, show them where they would be positioned in the leader board, when they view it.
  • 16. Into this level of breakdown: Given a user wants to post their score to a leader board When they have registered the nickname ‘knobhead’ Then that nickname fails the profanity test Given a user wants to post their score to a leader board When they have registered the nickname ‘QuizStar’ Then that nickname passes the profanity test
  • 17. General rules for entering leader boards Usernames need to be checked for profanities before publication. Users will always be asked to post their scores to the leader boards, they won't be done automatically. A user has to complete at least one question correctly to be eligible to be added to the leader board. Users who don't post their scores to the leader board will not appear in any of the leader board stats. A user cannot post their score to the leader board without logging in or registering. Even if  a user hasn't submitted their score to the leader board, show them where they would be positioned in the leader board, when they view it.
  • 18. Given a user finishes a quiz When the user is not logged in Then the user is offered the chance to enter the leader board And the post to leader board button redirects to login page Given a user finishes a quiz When the user is logged in Then the user is offered the chance to enter the leader board And the post to leader board button returns successful entry
  • 20. WatiN
  • 21. What is WatiN? Open source API (watin.org) that actually uses the browser for testing NOT emulating it Integrates with Visual Studio so tests can be debugged The most impressive feature of WatiN is the level of access you have to the DOM. Web tests are able to find elements by id, index, name, text, CSS class, etc., iterate through collections of elements, and invoke any event.
  • 22. Front End Testing – Good Practice? Everything should be tested BUT we need to remember a few things when testing the UI UI tests: Can be brittle Can take time Should not replace unit and integration tests Should not be taken as 100% gospel truth
  • 24. Summary We have looked at: Traditional testing ethos Emergence of BDD SpecFlow as a BDD tool WatiN as a testing tool SpecFlow + WatiN – Marriage made in heaven
  • 26. Thanks! Twitter: @stack72 Email: public@paulstack.co.uk Blog: http://paulstack.co.uk/blog