SlideShare a Scribd company logo
1 of 20
BDD with SpecFlow
Pascal Laurin
February 2015
@plaurin78
pascal.laurin@outlook.com
www.pascallaurin.com
Microsoft C# MVP
MSDEVMTL user group organizer
Developer & Architect at GSoft
TDD with B instead of a T!
Somewhat inspired by TDD but using behaviours instead
of tests
What level of behaviours?
Systems level
Applications level
Components level
Classes level
| 2
What is BDD?
Unit Tests
Focus on classes
Validate the implementation
Integrated Tests / Functional Tests / Acceptance Tests
Focus on components
Validate behaviours
Systems Tests
Focus on the complete system
Validate the whole system environment including external
dependencies
| 3
Differences between types of
automated tests
By changing the level of abstraction and the way we
communicate
Using the language of the business domain
Using sentences to express the expected behaviours
By focusing on what the system under test should do
Requirements, use cases, specifications and behaviours are all
useful for BDD
| 4
How to validate behaviours instead
of tests?
Not just for developers
Analysts, QA, business people must also included in this process
Specifications as tests, documentation and collaboration
tool
By automating the specifications like unit tests
By processing specifications as the documentation of the system
By working together on the specifications before writing code
What would a process like that looks like?
| 5
Going further
| 6
[1] Specification by Example
1. Deriving scope from goals
2. Specifying collaboratively
3. Illustrating using examples
4. Refining the specification
5. Automating validation without changing specifications
6. Validating frequently
7. Evolving a documentation system
| 7
Specification by Example
An example of a good business goal
Increase repeat sales to existing customers by 50% over the next
12 months.
| 8
Business goals
User stories for a basic loyalty system
In order to be able to do direct marketing of products to existing
customers, as a marketing manager I want customers to register
personal details by joining a VIP program.
In order to entice existing customers to register for the VIP
program, as a marketing manager I want the system to offer
free delivery on certain items to VIP customers.
In order to save money, as an existing customer I want to receive
information on available special offers.
| 9
Scope
Free delivery
VIP customer with five books in the cart gets free delivery.
VIP customer with four books in the cart doesn’t get free delivery.
Regular customer with five books in the cart doesn’t get free
delivery.
VIP customer with five washing machines in the cart doesn’t get
free delivery.
VIP customer with five books and a washing machine in the cart
doesn’t get free delivery.
| 10
Key examples
Free delivery
Free delivery is offered to VIP customers once they purchase a
certain number of books. Free delivery is not offered to regular
customers or VIP customers buying anything other than books.
Given that the minimum number of books to get free delivery is
five, then we expect the following:
| 11
Specification with examples
Customer type Cart contents Delivery
VIP 5 books Free
VIP 4 books Standard
Regular 10 books Standard
VIP 5 washing machines Standard
VIP 5 books, 1 washing machine Standard
| 12
Specification with examples
1. Deriving scope from goals
2. Specifying collaboratively
3. Illustrating using examples
4. Refining the specification
5. Automating validation without changing
specifications
6. Validating frequently
7. Evolving a documentation system
| 13
Specification by Example
14
SpecFlow
Visual Studio extension, runs like unit tests using any test runner
Write specifications in English with syntax coloring and auto-
completion using the Gherkin[1] language
[1] https://github.com/cucumber/cucumber/wiki/Gherkin
15
SpecFlow
Integrated debugging support
Matching specification lines with step definitions using a RegEx
syntax
Use ScenarioContext.Current and generic Get/Set methods to
store and retrieve test related data between step definitions
16
SpecFlow
Provides code snippet to implement missing step definitions either by
pressing F12 on an unmatched line or by runner the tests
1. Deriving scope from goals
2. Specifying collaboratively
3. Illustrating using examples
4. Refining the specification
5. Automating validation without changing specifications
6. Validating frequently
7. Evolving a documentation system
| 17
Specification by Example
| 18
Specification by Example book
BDD and TDD
Unit tests, integrated tests and manual tests are all important!
Improving communication
Use business domain language, higher level of abstraction,
avoiding technical vocabulary and implementation details
Requires investment
Good software design practices will help
You won’t necessarily hit the same challenges than with TDD
The real value is in collaboration and automation!
| 19
Conclusion
References
[1] Specification by Example
• http://specificationbyexample.com/
SpecFlow
• http://specflow.org/home.aspx
SlideShare of the presentation
• http://www.slideshare.net/PascalLaurin
BitBucket for the code
• https://bitbucket.org/pascallaurin/bdd-talk
@plaurin78
pascal.laurin@outlook.com
www.pascallaurin.com
| 20
Questions?

More Related Content

What's hot

Unit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and MoqUnit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and MoqXPDays
 
ATDD in Practice
ATDD in PracticeATDD in Practice
ATDD in PracticeSteven Mak
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflowcromwellryan
 
TDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & WhereTDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & WhereDaniel Davis
 
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
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven DevelopmentTung Nguyen Thanh
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect coupleStephen Tucker
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestableRoyKlein
 
BDD presentation
BDD presentationBDD presentation
BDD presentationtemebele
 
Win at life with unit testing
Win at life with unit testingWin at life with unit testing
Win at life with unit testingmarkstory
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven developmenttoteb5
 
Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief exampleJeremy Kendall
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)nedirtv
 

What's hot (20)

Unit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and MoqUnit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and Moq
 
ATDD in Practice
ATDD in PracticeATDD in Practice
ATDD in Practice
 
ATDD in practice
ATDD in practiceATDD in practice
ATDD in practice
 
BDD for APIs
BDD for APIsBDD for APIs
BDD for APIs
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflow
 
TDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & WhereTDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & Where
 
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)
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect couple
 
Automation and Technical Debt
Automation and Technical DebtAutomation and Technical Debt
Automation and Technical Debt
 
Using Specflow for BDD
Using Specflow for BDDUsing Specflow for BDD
Using Specflow for BDD
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
Win at life with unit testing
Win at life with unit testingWin at life with unit testing
Win at life with unit testing
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven development
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief example
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)
 
TDD & BDD
TDD & BDDTDD & BDD
TDD & BDD
 

Viewers also liked

Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#Pascal Laurin
 
7 astuces pour améliorer vos tests unitaires
7 astuces pour améliorer vos tests unitaires7 astuces pour améliorer vos tests unitaires
7 astuces pour améliorer vos tests unitairesPascal Laurin
 
L'amélioration des tests unitaires par le refactoring
L'amélioration des tests unitaires par le refactoringL'amélioration des tests unitaires par le refactoring
L'amélioration des tests unitaires par le refactoringPascal Laurin
 
Cloud design patterns
Cloud design patternsCloud design patterns
Cloud design patternsPascal Laurin
 
Tests automatisés java script
Tests automatisés java scriptTests automatisés java script
Tests automatisés java scriptPascal Laurin
 
Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)Tudor Constantin
 
Scrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - ColomboScrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - ColomboNaveen Kumar Singh
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven DevelopmentRichard Ruiter
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Consextentconf Tsoy
 
Behavior driven development for Mobile apps
Behavior driven development for Mobile appsBehavior driven development for Mobile apps
Behavior driven development for Mobile appsGeert van der Cruijsen
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by ExampleNalin Goonawardana
 
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
 
The WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpecThe WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpecBen Mabey
 
Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)Naresh Jain
 
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 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
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentLiz Keogh
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with CucumberBrandon Keepers
 

Viewers also liked (20)

C# 6
C# 6C# 6
C# 6
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#
 
7 astuces pour améliorer vos tests unitaires
7 astuces pour améliorer vos tests unitaires7 astuces pour améliorer vos tests unitaires
7 astuces pour améliorer vos tests unitaires
 
L'amélioration des tests unitaires par le refactoring
L'amélioration des tests unitaires par le refactoringL'amélioration des tests unitaires par le refactoring
L'amélioration des tests unitaires par le refactoring
 
Cloud design patterns
Cloud design patternsCloud design patterns
Cloud design patterns
 
Tests automatisés java script
Tests automatisés java scriptTests automatisés java script
Tests automatisés java script
 
Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)
 
Scrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - ColomboScrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - Colombo
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven Development
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Cons
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
 
Behavior driven development for Mobile apps
Behavior driven development for Mobile appsBehavior driven development for Mobile apps
Behavior driven development for Mobile apps
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
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
 
The WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpecThe WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpec
 
Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world application
 
Behavior Driven Development 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
 
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
 

Similar to BDD SpecFlow Automate Behaviour Driven Development

01- Lecture -Introduction to IT Agile Development.
01- Lecture -Introduction to IT Agile Development.01- Lecture -Introduction to IT Agile Development.
01- Lecture -Introduction to IT Agile Development.mailtoahmedhassan
 
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
 
Best practices for implementing and maintaining successful standards
Best practices for implementing and maintaining successful standardsBest practices for implementing and maintaining successful standards
Best practices for implementing and maintaining successful standardsVeeva Systems
 
Puppet + Diaxon: Getting to the next stage of DevOps evolution
Puppet + Diaxon: Getting to the next stage of DevOps evolutionPuppet + Diaxon: Getting to the next stage of DevOps evolution
Puppet + Diaxon: Getting to the next stage of DevOps evolutionPuppet
 
Best practices to include in your OpenERP implementation contracts. Sandro Bo...
Best practices to include in your OpenERP implementation contracts. Sandro Bo...Best practices to include in your OpenERP implementation contracts. Sandro Bo...
Best practices to include in your OpenERP implementation contracts. Sandro Bo...Odoo
 
Unifying feature management with experiments - Server Side Webinar (1).pdf
Unifying feature management with experiments - Server Side Webinar (1).pdfUnifying feature management with experiments - Server Side Webinar (1).pdf
Unifying feature management with experiments - Server Side Webinar (1).pdfVWO
 
Software testing methodologies to watch out in 2020
Software testing methodologies to watch out in 2020Software testing methodologies to watch out in 2020
Software testing methodologies to watch out in 2020Concetto Labs
 
Test Automation using UiPath Test Suite - Developer Circle Part-1.pdf
Test Automation using UiPath Test Suite - Developer Circle Part-1.pdfTest Automation using UiPath Test Suite - Developer Circle Part-1.pdf
Test Automation using UiPath Test Suite - Developer Circle Part-1.pdfDiana Gray, MBA
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaDatabricks
 
Agile Release Management Best Practices
Agile Release Management Best PracticesAgile Release Management Best Practices
Agile Release Management Best PracticesAnmol Oberoi
 
Independent verification & validation presented by Maneat v02
Independent verification & validation presented by Maneat v02Independent verification & validation presented by Maneat v02
Independent verification & validation presented by Maneat v02Dr. Pierpaolo Mangeruga
 
The DevOps Playbook: How to Start, Scale, and Succeed
The DevOps Playbook: How to Start, Scale, and SucceedThe DevOps Playbook: How to Start, Scale, and Succeed
The DevOps Playbook: How to Start, Scale, and SucceedPuppet
 
General technical interview questions
General technical interview questionsGeneral technical interview questions
General technical interview questionsKevalkumar Shah
 
Reduced specification by_example2
Reduced specification by_example2Reduced specification by_example2
Reduced specification by_example2afreidah
 

Similar to BDD SpecFlow Automate Behaviour Driven Development (20)

01- Lecture -Introduction to IT Agile Development.
01- Lecture -Introduction to IT Agile Development.01- Lecture -Introduction to IT Agile Development.
01- Lecture -Introduction to IT Agile Development.
 
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
 
Best practices for implementing and maintaining successful standards
Best practices for implementing and maintaining successful standardsBest practices for implementing and maintaining successful standards
Best practices for implementing and maintaining successful standards
 
Puppet + Diaxon: Getting to the next stage of DevOps evolution
Puppet + Diaxon: Getting to the next stage of DevOps evolutionPuppet + Diaxon: Getting to the next stage of DevOps evolution
Puppet + Diaxon: Getting to the next stage of DevOps evolution
 
Benchmarking
BenchmarkingBenchmarking
Benchmarking
 
Agile testing
Agile testingAgile testing
Agile testing
 
Best practices to include in your OpenERP implementation contracts. Sandro Bo...
Best practices to include in your OpenERP implementation contracts. Sandro Bo...Best practices to include in your OpenERP implementation contracts. Sandro Bo...
Best practices to include in your OpenERP implementation contracts. Sandro Bo...
 
Unifying feature management with experiments - Server Side Webinar (1).pdf
Unifying feature management with experiments - Server Side Webinar (1).pdfUnifying feature management with experiments - Server Side Webinar (1).pdf
Unifying feature management with experiments - Server Side Webinar (1).pdf
 
Training program BaffleSol academy of learning
Training program BaffleSol academy of learningTraining program BaffleSol academy of learning
Training program BaffleSol academy of learning
 
A Step-by-Step Guide.pptx
A Step-by-Step Guide.pptxA Step-by-Step Guide.pptx
A Step-by-Step Guide.pptx
 
Software testing methodologies to watch out in 2020
Software testing methodologies to watch out in 2020Software testing methodologies to watch out in 2020
Software testing methodologies to watch out in 2020
 
Test Automation using UiPath Test Suite - Developer Circle Part-1.pdf
Test Automation using UiPath Test Suite - Developer Circle Part-1.pdfTest Automation using UiPath Test Suite - Developer Circle Part-1.pdf
Test Automation using UiPath Test Suite - Developer Circle Part-1.pdf
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at Humana
 
Agile Release Management Best Practices
Agile Release Management Best PracticesAgile Release Management Best Practices
Agile Release Management Best Practices
 
Independent verification & validation presented by Maneat v02
Independent verification & validation presented by Maneat v02Independent verification & validation presented by Maneat v02
Independent verification & validation presented by Maneat v02
 
The DevOps Playbook: How to Start, Scale, and Succeed
The DevOps Playbook: How to Start, Scale, and SucceedThe DevOps Playbook: How to Start, Scale, and Succeed
The DevOps Playbook: How to Start, Scale, and Succeed
 
DevTestOps
DevTestOpsDevTestOps
DevTestOps
 
General technical interview questions
General technical interview questionsGeneral technical interview questions
General technical interview questions
 
Test Policy and Practices
Test Policy and PracticesTest Policy and Practices
Test Policy and Practices
 
Reduced specification by_example2
Reduced specification by_example2Reduced specification by_example2
Reduced specification by_example2
 

Recently uploaded

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

BDD SpecFlow Automate Behaviour Driven Development

  • 1. BDD with SpecFlow Pascal Laurin February 2015 @plaurin78 pascal.laurin@outlook.com www.pascallaurin.com Microsoft C# MVP MSDEVMTL user group organizer Developer & Architect at GSoft
  • 2. TDD with B instead of a T! Somewhat inspired by TDD but using behaviours instead of tests What level of behaviours? Systems level Applications level Components level Classes level | 2 What is BDD?
  • 3. Unit Tests Focus on classes Validate the implementation Integrated Tests / Functional Tests / Acceptance Tests Focus on components Validate behaviours Systems Tests Focus on the complete system Validate the whole system environment including external dependencies | 3 Differences between types of automated tests
  • 4. By changing the level of abstraction and the way we communicate Using the language of the business domain Using sentences to express the expected behaviours By focusing on what the system under test should do Requirements, use cases, specifications and behaviours are all useful for BDD | 4 How to validate behaviours instead of tests?
  • 5. Not just for developers Analysts, QA, business people must also included in this process Specifications as tests, documentation and collaboration tool By automating the specifications like unit tests By processing specifications as the documentation of the system By working together on the specifications before writing code What would a process like that looks like? | 5 Going further
  • 7. 1. Deriving scope from goals 2. Specifying collaboratively 3. Illustrating using examples 4. Refining the specification 5. Automating validation without changing specifications 6. Validating frequently 7. Evolving a documentation system | 7 Specification by Example
  • 8. An example of a good business goal Increase repeat sales to existing customers by 50% over the next 12 months. | 8 Business goals
  • 9. User stories for a basic loyalty system In order to be able to do direct marketing of products to existing customers, as a marketing manager I want customers to register personal details by joining a VIP program. In order to entice existing customers to register for the VIP program, as a marketing manager I want the system to offer free delivery on certain items to VIP customers. In order to save money, as an existing customer I want to receive information on available special offers. | 9 Scope
  • 10. Free delivery VIP customer with five books in the cart gets free delivery. VIP customer with four books in the cart doesn’t get free delivery. Regular customer with five books in the cart doesn’t get free delivery. VIP customer with five washing machines in the cart doesn’t get free delivery. VIP customer with five books and a washing machine in the cart doesn’t get free delivery. | 10 Key examples
  • 11. Free delivery Free delivery is offered to VIP customers once they purchase a certain number of books. Free delivery is not offered to regular customers or VIP customers buying anything other than books. Given that the minimum number of books to get free delivery is five, then we expect the following: | 11 Specification with examples
  • 12. Customer type Cart contents Delivery VIP 5 books Free VIP 4 books Standard Regular 10 books Standard VIP 5 washing machines Standard VIP 5 books, 1 washing machine Standard | 12 Specification with examples
  • 13. 1. Deriving scope from goals 2. Specifying collaboratively 3. Illustrating using examples 4. Refining the specification 5. Automating validation without changing specifications 6. Validating frequently 7. Evolving a documentation system | 13 Specification by Example
  • 14. 14 SpecFlow Visual Studio extension, runs like unit tests using any test runner Write specifications in English with syntax coloring and auto- completion using the Gherkin[1] language [1] https://github.com/cucumber/cucumber/wiki/Gherkin
  • 15. 15 SpecFlow Integrated debugging support Matching specification lines with step definitions using a RegEx syntax Use ScenarioContext.Current and generic Get/Set methods to store and retrieve test related data between step definitions
  • 16. 16 SpecFlow Provides code snippet to implement missing step definitions either by pressing F12 on an unmatched line or by runner the tests
  • 17. 1. Deriving scope from goals 2. Specifying collaboratively 3. Illustrating using examples 4. Refining the specification 5. Automating validation without changing specifications 6. Validating frequently 7. Evolving a documentation system | 17 Specification by Example
  • 18. | 18 Specification by Example book
  • 19. BDD and TDD Unit tests, integrated tests and manual tests are all important! Improving communication Use business domain language, higher level of abstraction, avoiding technical vocabulary and implementation details Requires investment Good software design practices will help You won’t necessarily hit the same challenges than with TDD The real value is in collaboration and automation! | 19 Conclusion
  • 20. References [1] Specification by Example • http://specificationbyexample.com/ SpecFlow • http://specflow.org/home.aspx SlideShare of the presentation • http://www.slideshare.net/PascalLaurin BitBucket for the code • https://bitbucket.org/pascallaurin/bdd-talk @plaurin78 pascal.laurin@outlook.com www.pascallaurin.com | 20 Questions?