SlideShare a Scribd company logo
SpecFlow for Agile
Teams
Alejandro Ramirez
Senior Consultant
Polaris Solutions
Platinum Sponsors
Silver Sponsors
Gold Sponsors
The evolved role of testing
Image credit: http://www.archeolog-home.com/pages/content/how-humans-became-masters-of-the-earth.html
Black-Box Agile
Test automation pyramid
GUI
Tests
Acceptance Tests
Unit Tests
Manual
Tests
Test automation pyramid
GUI
Tests
Acceptance Tests / BDD | ATDD
Unit Tests / Component Tests/ TDD
Manual
Tests
CodedUI Visual Studio
SpecFlow Visual Studio
xUnit Visual Studio
Manual Test Cases
Exploratory Tests
MTM
Agile
Maturity
ATDD or BDD?
They are the same thing!
Agile techniques
Started in 2003
Understanding software behavior through discussion
Discussing acceptance criteria with examples
Focus on why and benefits of code
Embodies the definition of done in tests
Image is copyright of Nintendo
https://microsite.nintendo-europe.com/Stay_Updated/ptPT/
What is SpecFlow?
Not a pickle
Automated testing tool
Runs acceptance tests written in BDD style
It’s Cucumber for .NET
What you need to use it
• Visual Studio
• SpecFlow package
• Learn Gherkin
How to use SpecFlow in 3 Steps
ONE: Specify behavior in Gherkin
TWO: Automate scenarios
THREE: Enjoy and repeat
Example( y o u a r e g o i n g t o l o v e i t )
Specifying behavior with Gherkin
Describe behavior in plain English
Given,
When,
Then
In order to,
As a,
I want to
Feature
Behavior
Feature: Add Customer
In order to store new customer information
As a User of the XYZ system
I want to be able to create and store new customers
Scenario 1: Happy Path
Given a user has entered information about a customer
When he/she completes entering more information
Then the customer information should be stored in the system
Scenario 1 (more elaborate)
Given a user has entered information about a customer
And he/she has provided a first name and a last name
When he/she completes entering more information
Then the customer information should be stored in the system
Scenario 1 (even more elaborate)
Given a user has entered information about a customer
And he/she has provided a first name and a last name
When he/she completes entering more information
Then the customer information should be stored in the system
Scenario 1 (even more elaborate)
Given a user has entered information about a customer
And he/she has provided a first name and a last name
When he/she completes entering more information
Then the customer information should be stored in the system
Scenario 2: Missing Required Data
Given a user has entered information about a customer
And he/she has not provided the first name and last name
When he/she completes entering more information
Then the user will be notified about the missing data
And the customer will not be stored into the system
Exercise
In real life:
Quick Demo
Automating behaviors
Generate stubs
Fill in the blanks
Run
SpecFlow approaches for agile teams
Service layer
Integration
GUI
SpecFlow approaches for agile teams
Dev + BA
Dev + Test + BA
Dev + Test
Do you want to know more?
Contact:
alejandro.ramirez@polarissolutions.com
@alejandrormz
www.polarissolutions.com
Q&A

More Related Content

PPTX
SpecFlow Executable Specifications
PPTX
Spec flow – functional testing made easy
PPTX
Bdd and spec flow
PPTX
Behaviour Driven Development with SpecFlow
PDF
Spec(ing) Out Your Workflow with SpecFlow
PDF
Behavior Driven Development with SpecFlow
PPT
Acceptance Test Driven Development With Spec Flow And Friends
PPTX
BDD for APIs
SpecFlow Executable Specifications
Spec flow – functional testing made easy
Bdd and spec flow
Behaviour Driven Development with SpecFlow
Spec(ing) Out Your Workflow with SpecFlow
Behavior Driven Development with SpecFlow
Acceptance Test Driven Development With Spec Flow And Friends
BDD for APIs

What's hot (20)

PPTX
Automated Acceptance Tests in .NET
PPTX
Selenium + Specflow
PPTX
Automated tests to a REST API
PPTX
BDD with SpecFlow and Selenium
PPTX
REST API testing with SpecFlow
PPT
Points.com fisheye crucible code reviews 2011
PPTX
PHPConf.asia 2016 - BDD with Behat for Beginners
PDF
Automated testing in javascript
PPTX
Using Specflow for BDD
PDF
Serenity-BDD training
PPTX
Cypress test techniques cucumber bdd framework,tdd,api tests course
PDF
Codeception Testing Framework -- English #phpkansai
PPTX
Automation and Technical Debt
PPTX
Testing the untestable
PPTX
Introduction to Bdd and cucumber
PPTX
Automated Acceptance Tests & Tool choice
PPTX
ATAGTR2017 Expanding test horizons with Robot Framework
PDF
EVOLVE'15 | Enhance | Rene Ugarte | AEM Quality Assurance
PDF
Help! My Legacy Application is Unmaintainable!
Automated Acceptance Tests in .NET
Selenium + Specflow
Automated tests to a REST API
BDD with SpecFlow and Selenium
REST API testing with SpecFlow
Points.com fisheye crucible code reviews 2011
PHPConf.asia 2016 - BDD with Behat for Beginners
Automated testing in javascript
Using Specflow for BDD
Serenity-BDD training
Cypress test techniques cucumber bdd framework,tdd,api tests course
Codeception Testing Framework -- English #phpkansai
Automation and Technical Debt
Testing the untestable
Introduction to Bdd and cucumber
Automated Acceptance Tests & Tool choice
ATAGTR2017 Expanding test horizons with Robot Framework
EVOLVE'15 | Enhance | Rene Ugarte | AEM Quality Assurance
Help! My Legacy Application is Unmaintainable!
Ad

Viewers also liked (20)

PPT
Confort Bus Services
PPTX
E FIT BANUS
PPTX
Sportbooking T T B V
PDF
Mesura de Govern: Pla Director de la Guàrdia Urbana
PDF
Perl 111223 my college tomorrow article
DOCX
Carta de presentación de candidatura patxi aldecoa
PDF
Festes de la Mercè Almacelles 2012
PPT
Acuerdo extrajudicial de pagos
PDF
Hydraulic Torque & Tension Bolted Connection
PDF
Métodos de-recuperación-de-información-para-medios-ópticos-y-discos-duros-1 (1)
PDF
Cookies, normative e strategie per il marketing Digitale
PDF
Document 2012-03-28-11858067-0-the-wealth-report-2012
PDF
Hacia el despertar espiritual - José Manuel Martínez Sánchez
PPTX
Building Contagious Commitment for Change - Workshop with Helen Bevan | April...
PPTX
In-room TV: Smart TV solutions to Hotels, Hospitals and Care Homes
PPTX
Team p foodie zone - 083012 canvas-v2
PDF
Adysa Group Club de Fidelización
PPTX
Tagging Systems to Assist Visually Impaired Users Identify Visual Data in Clo...
PPTX
Fibromialgia
Confort Bus Services
E FIT BANUS
Sportbooking T T B V
Mesura de Govern: Pla Director de la Guàrdia Urbana
Perl 111223 my college tomorrow article
Carta de presentación de candidatura patxi aldecoa
Festes de la Mercè Almacelles 2012
Acuerdo extrajudicial de pagos
Hydraulic Torque & Tension Bolted Connection
Métodos de-recuperación-de-información-para-medios-ópticos-y-discos-duros-1 (1)
Cookies, normative e strategie per il marketing Digitale
Document 2012-03-28-11858067-0-the-wealth-report-2012
Hacia el despertar espiritual - José Manuel Martínez Sánchez
Building Contagious Commitment for Change - Workshop with Helen Bevan | April...
In-room TV: Smart TV solutions to Hotels, Hospitals and Care Homes
Team p foodie zone - 083012 canvas-v2
Adysa Group Club de Fidelización
Tagging Systems to Assist Visually Impaired Users Identify Visual Data in Clo...
Fibromialgia
Ad

Similar to SpecFlow for Agile Teams (20)

PDF
Behavior Driven Testing with SpecFlow
PPTX
Sumo Logic Cert Jam - Fundamentals
PDF
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
PPTX
1-Software Construction and Development.pptx
PPTX
FASHIONTOP.pptx
PPTX
Specification workshops
PPTX
Hotel management system
PDF
Top AZ-500 Prep Resources for 2025: Exam Dumps, Real Questions & Expert Guidance
PDF
Pass the AZ-500 Exam Easily with Certifiedumps Updated Dumps and Practice Tests
PDF
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
PDF
[Rakuten TechConf2014] [G-4] Beyond Agile Testing to Lean Development
PDF
Software Development Lifecycle Presentation
PDF
Testers in an agile world
PPTX
Continuous Testing in Vegas
PPTX
Modern developer workflow
DOCX
E-LEARNING
PDF
Level 2 Certification: Using Sumo Logic - Oct 2018
PDF
2 anton muzhailo - team development techniques you must know to be a valuab...
PPT
Formal Versus Agile: Survival of the Fittest? (Paul Boca)
DOCX
Project report(Smart Auction Access)
Behavior Driven Testing with SpecFlow
Sumo Logic Cert Jam - Fundamentals
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
1-Software Construction and Development.pptx
FASHIONTOP.pptx
Specification workshops
Hotel management system
Top AZ-500 Prep Resources for 2025: Exam Dumps, Real Questions & Expert Guidance
Pass the AZ-500 Exam Easily with Certifiedumps Updated Dumps and Practice Tests
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
[Rakuten TechConf2014] [G-4] Beyond Agile Testing to Lean Development
Software Development Lifecycle Presentation
Testers in an agile world
Continuous Testing in Vegas
Modern developer workflow
E-LEARNING
Level 2 Certification: Using Sumo Logic - Oct 2018
2 anton muzhailo - team development techniques you must know to be a valuab...
Formal Versus Agile: Survival of the Fittest? (Paul Boca)
Project report(Smart Auction Access)

Recently uploaded (20)

PDF
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
PPTX
HR Introduction Slide (1).pptx on hr intro
PDF
SIMNET Inc – 2023’s Most Trusted IT Services & Solution Provider
PPTX
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
PPTX
Principles of Marketing, Industrial, Consumers,
PDF
pdfcoffee.com-opt-b1plus-sb-answers.pdfvi
PDF
MSPs in 10 Words - Created by US MSP Network
DOCX
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
PPTX
Belch_12e_PPT_Ch18_Accessible_university.pptx
PDF
Unit 1 Cost Accounting - Cost sheet
DOCX
Business Management - unit 1 and 2
PDF
How to Get Business Funding for Small Business Fast
PDF
Nidhal Samdaie CV - International Business Consultant
PDF
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
DOCX
unit 1 COST ACCOUNTING AND COST SHEET
DOCX
Euro SEO Services 1st 3 General Updates.docx
PDF
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
PDF
IFRS Notes in your pocket for study all the time
PDF
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
PDF
Roadmap Map-digital Banking feature MB,IB,AB
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
HR Introduction Slide (1).pptx on hr intro
SIMNET Inc – 2023’s Most Trusted IT Services & Solution Provider
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
Principles of Marketing, Industrial, Consumers,
pdfcoffee.com-opt-b1plus-sb-answers.pdfvi
MSPs in 10 Words - Created by US MSP Network
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
Belch_12e_PPT_Ch18_Accessible_university.pptx
Unit 1 Cost Accounting - Cost sheet
Business Management - unit 1 and 2
How to Get Business Funding for Small Business Fast
Nidhal Samdaie CV - International Business Consultant
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
unit 1 COST ACCOUNTING AND COST SHEET
Euro SEO Services 1st 3 General Updates.docx
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
IFRS Notes in your pocket for study all the time
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
Roadmap Map-digital Banking feature MB,IB,AB

SpecFlow for Agile Teams

  • 1. SpecFlow for Agile Teams Alejandro Ramirez Senior Consultant Polaris Solutions
  • 3. The evolved role of testing Image credit: http://www.archeolog-home.com/pages/content/how-humans-became-masters-of-the-earth.html Black-Box Agile
  • 4. Test automation pyramid GUI Tests Acceptance Tests Unit Tests Manual Tests
  • 5. Test automation pyramid GUI Tests Acceptance Tests / BDD | ATDD Unit Tests / Component Tests/ TDD Manual Tests CodedUI Visual Studio SpecFlow Visual Studio xUnit Visual Studio Manual Test Cases Exploratory Tests MTM Agile Maturity
  • 6. ATDD or BDD? They are the same thing! Agile techniques Started in 2003 Understanding software behavior through discussion Discussing acceptance criteria with examples Focus on why and benefits of code Embodies the definition of done in tests Image is copyright of Nintendo https://microsite.nintendo-europe.com/Stay_Updated/ptPT/
  • 7. What is SpecFlow? Not a pickle Automated testing tool Runs acceptance tests written in BDD style It’s Cucumber for .NET
  • 8. What you need to use it • Visual Studio • SpecFlow package • Learn Gherkin
  • 9. How to use SpecFlow in 3 Steps ONE: Specify behavior in Gherkin TWO: Automate scenarios THREE: Enjoy and repeat
  • 10. Example( y o u a r e g o i n g t o l o v e i t )
  • 11. Specifying behavior with Gherkin Describe behavior in plain English Given, When, Then In order to, As a, I want to Feature Behavior
  • 12. Feature: Add Customer In order to store new customer information As a User of the XYZ system I want to be able to create and store new customers
  • 13. Scenario 1: Happy Path Given a user has entered information about a customer When he/she completes entering more information Then the customer information should be stored in the system
  • 14. Scenario 1 (more elaborate) Given a user has entered information about a customer And he/she has provided a first name and a last name When he/she completes entering more information Then the customer information should be stored in the system
  • 15. Scenario 1 (even more elaborate) Given a user has entered information about a customer And he/she has provided a first name and a last name When he/she completes entering more information Then the customer information should be stored in the system
  • 16. Scenario 1 (even more elaborate) Given a user has entered information about a customer And he/she has provided a first name and a last name When he/she completes entering more information Then the customer information should be stored in the system
  • 17. Scenario 2: Missing Required Data Given a user has entered information about a customer And he/she has not provided the first name and last name When he/she completes entering more information Then the user will be notified about the missing data And the customer will not be stored into the system
  • 22. SpecFlow approaches for agile teams Service layer Integration GUI
  • 23. SpecFlow approaches for agile teams Dev + BA Dev + Test + BA Dev + Test
  • 24. Do you want to know more? Contact: alejandro.ramirez@polarissolutions.com @alejandrormz www.polarissolutions.com
  • 25. Q&A

Editor's Notes

  • #4: Evolution: Talk about how testers have been perceived through time. Dream come true: testing as a first-class citizen in agile. Team Members: Talk about how in agile is all about “roles”, and not so much about a “Tester” or “Developer”, but the skills they bring to the table
  • #6: Unit Testing and TDD: MSTest, NUnit Executable Specifications and BDD: SpecFlow UI Automation: CodedUI ES/SBE An executable specification is a description of software behavior written in natural language, but with a defined structure. A.K.A. Behavior-Driven Development (BDD) Acceptance-Test-Driven-Development (ATDD)  Gherkin uses GIVEN/WHEN/THEN structure that lets you write specifications like this: GIVEN that I have items in my basket, WHEN I go to the checkout, THEN I am shown a confirmation screen, AND the screen lists all the items in my basket. CodedUI requires: Visual Studio Premium or Ultimate Edition (CodedUI Test Project) Pitfalls Trying to do everything UI should be last resort When should I use UI testing? Test the things that are only possible from the UI Navigation The way the user interacts Stuff you can't test from Unit tests When not? Validating business rules ONLY TEST THINGS YOU CANNOT TEST WITH UNIT TESTS 3 Ways to use CodedUI Record & Playback (most common) Great way to get started Not the way to get the most ROI Most fragile way to build your test automation Be careful of multiple team members recording at the same time and merging the UIMap files One big chunk of unmaintainable code Use Recording of UI Maps to abstract the UI and then code against the abstraction More maintainable Be careful about maintaining UI Map files Create multiple UI maps, each one targeting a specific part of your UI Record ACTIONS and ASSERTIONS in separate UIMap Files Hand code everything and not use UI Map files Most control Most time-consuming Use UI Maps only for specific purposes like locating controls Create a UI Map per distinct par of the UI Requires more coding Page Object Pattern Helps you abstract the details of HOW the UI is CONSTRUCTED We create a class that represents the screen we see when we browse a web page, and we represent those UI elements as objects. Each Page Object abstracsts a PAGE or a PART OF A PAGE The Page Object has knowledge of the page and has the ability to find controls within the page. A Page Object has Methods Provides services to the test developer Abstracts the way UI elements are located Returns page objects A Page Object has Query Methods Used in assertions so deails about the UI stay with the object and don't leak to your test E.G. IsPageValid() os IsItemInShoppingBasket("name of item") Assertion is done in the test!
  • #8: Cucumber is a software tool that computer programmers use for testing other software. It runs automated acceptance tests written in a behavior-driven development (BDD) style. Specification by Example An executable specification is a description of software behavior written in natural language, but with a defined structure. Cucumber is written in the Ruby programming language.[6][7] Cucumber projects are available for other platforms beyond Ruby. Some use Ruby Cucumber with a bridge into the target language (e.g. cuke4php and cuke4lua). Others use the Gherkin parser but implement everything else in the target language.[8] Cucumber allows the execution of feature documentation written in business-facing text.
  • #11: Talk about the work that goes into Test Planning Sprint Planning vs. Poker Planning
  • #12: Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented. Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.   Gherkin uses GIVEN/WHEN/THEN structure that lets you write specifications like this: GIVEN that I have items in my basket, WHEN I go to the checkout, THEN I am shown a confirmation screen, AND the screen lists all the items in my basket.
  • #13: Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented. Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.   Gherkin uses GIVEN/WHEN/THEN structure that lets you write specifications like this: GIVEN that I have items in my basket, WHEN I go to the checkout, THEN I am shown a confirmation screen, AND the screen lists all the items in my basket.
  • #14: Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented. Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.   Gherkin uses GIVEN/WHEN/THEN structure that lets you write specifications like this: GIVEN that I have items in my basket, WHEN I go to the checkout, THEN I am shown a confirmation screen, AND the screen lists all the items in my basket.
  • #15: Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented. Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.   Gherkin uses GIVEN/WHEN/THEN structure that lets you write specifications like this: GIVEN that I have items in my basket, WHEN I go to the checkout, THEN I am shown a confirmation screen, AND the screen lists all the items in my basket.
  • #16: Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented. Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.   Gherkin uses GIVEN/WHEN/THEN structure that lets you write specifications like this: GIVEN that I have items in my basket, WHEN I go to the checkout, THEN I am shown a confirmation screen, AND the screen lists all the items in my basket.
  • #17: Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented. Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.   Gherkin uses GIVEN/WHEN/THEN structure that lets you write specifications like this: GIVEN that I have items in my basket, WHEN I go to the checkout, THEN I am shown a confirmation screen, AND the screen lists all the items in my basket.
  • #18: Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented. Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.   Gherkin uses GIVEN/WHEN/THEN structure that lets you write specifications like this: GIVEN that I have items in my basket, WHEN I go to the checkout, THEN I am shown a confirmation screen, AND the screen lists all the items in my basket.
  • #19: Talk about the work that goes into Test Planning Sprint Planning vs. Poker Planning
  • #20: Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented. Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.   Gherkin uses GIVEN/WHEN/THEN structure that lets you write specifications like this: GIVEN that I have items in my basket, WHEN I go to the checkout, THEN I am shown a confirmation screen, AND the screen lists all the items in my basket.
  • #21: Talk about the work that goes into Test Planning Sprint Planning vs. Poker Planning