SlideShare une entreprise Scribd logo
1  sur  17
Experiences introducing BDD and BDD
elements

To unit testing and a legacy codebase
XP 2010, June 3rd 2010
Background

 A local, familyman, 2 children


 Developer, Consultant
 BEKK Consulting

 10+ years
 Seen many types of projects


                                    @ah74
                                    hammervold.com/anders
Background: What I had seen a lot of

 POUT
 Some testclasses of several k+ lines
 Often excellent testcode


 Difficult to understand for others
 Difficult to come back to after some time away
 Focus on test techniques like Mocking


 Refactoring later would mean rewriting complex code AND complex
  tests
 in a hurry?  remove tests that are red
BDD and ”BDD elements”

 BDD
 Started seeing BDD inspired syntax and thinking
 Ground up


 Which effect did this have ?
 Did it correspond with the goals of BDD?
 What was happening in other projects right now ?


 Examples
Example: BDD using Cucumber features




    http://www.engineyard.com/blog/2009/cucumber-introduction/
Example: ”BDDTest”




Adapted from and inpired by code and examples from: Torbjørn Marø and Jonas follesø
Example: ”BDDTest” adapted
Example: Glue




Tore Vestues, http://glue.codeplex.com
Experiment: Regions

 Experimental,
 IDE-specific
Effects: The skeptic




 ”I know how to write tests”
Effects: The skeptic




 ”Wow this test became so much simpler!”
 ”This was almost fun”
How


 ~20 minute interviews
    – Developers
    – Testers
    – Customers
 5 different projects
    – May 2010
Objections?

 Some arguments used were the same as against TDD
 Fear of change
 Technical problems, sometimes new technology
 Unwillingness to learn something new


 Not true BDD, outside in through ui
Developer perspective

 Clear sense of purpose
 Recipe to follow
 Renewed focus on specification
 Smaller, simpler tests


 Easier to maintain
 Most tests now got a similar structure
 Greater number of tests but better organised
 ”I give up,
        i’ll rather go write some BDD-tests,
                  maybe that will cheer me up”
Customer perspective

               ”The bug-rate dropped significantly”
               ”I could see that they (the developers) had understood
                what I meant”
               ”I never understood the code anyway”


                       – Generally responded well to the syntax
                       – Customers were generally more agile than
                         developers perhaps expected
                            – When given a chance
                       – Clarifying requirements
Success

 Many of the results can be attributed to TDD
 BDD elements added to and amplified these
 Skeptics became ”believers”
 The customers showed greater involvement
 Testers could write features in the error report
Some success-criteria

 Access to a mentor
 Commitment from the team
 Willingness to learn
 Including the customer

Contenu connexe

Tendances

Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential Skills
John Choi
 

Tendances (8)

Introduction to Exploratory Testing
Introduction to Exploratory TestingIntroduction to Exploratory Testing
Introduction to Exploratory Testing
 
Tdd 왜 배우기 어려운가
Tdd 왜 배우기 어려운가Tdd 왜 배우기 어려운가
Tdd 왜 배우기 어려운가
 
TDD for the masses
TDD for the massesTDD for the masses
TDD for the masses
 
SubTests are the Best
SubTests are the BestSubTests are the Best
SubTests are the Best
 
Introducing Test Driven Development to an existing environment
Introducing Test Driven Development to an existing environmentIntroducing Test Driven Development to an existing environment
Introducing Test Driven Development to an existing environment
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential Skills
 
Learning Code Review & Commit Message with Google
Learning Code Review & Commit Message with GoogleLearning Code Review & Commit Message with Google
Learning Code Review & Commit Message with Google
 
Common mistakes in tdd can you guess
Common mistakes in tdd   can you guessCommon mistakes in tdd   can you guess
Common mistakes in tdd can you guess
 

En vedette

Jvm-bdd-quality-driven
Jvm-bdd-quality-drivenJvm-bdd-quality-driven
Jvm-bdd-quality-driven
Amir Barylko
 
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
Craeg Strong
 
Agile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin Salvekar
Agile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin SalvekarAgile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin Salvekar
Agile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin Salvekar
India Scrum Enthusiasts Community
 
BDD for Rails Legacy Code
BDD for Rails Legacy CodeBDD for Rails Legacy Code
BDD for Rails Legacy Code
Wei Jen Lu
 
Mock Aren't Stub 讀後心得
Mock Aren't Stub 讀後心得Mock Aren't Stub 讀後心得
Mock Aren't Stub 讀後心得
Wei Jen Lu
 

En vedette (20)

DOES14 - Jonny Wooldridge - The Cambridge Satchel Company - 10 Enterprise Tip...
DOES14 - Jonny Wooldridge - The Cambridge Satchel Company - 10 Enterprise Tip...DOES14 - Jonny Wooldridge - The Cambridge Satchel Company - 10 Enterprise Tip...
DOES14 - Jonny Wooldridge - The Cambridge Satchel Company - 10 Enterprise Tip...
 
Jvm-bdd-quality-driven
Jvm-bdd-quality-drivenJvm-bdd-quality-driven
Jvm-bdd-quality-driven
 
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
 
Agile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin Salvekar
Agile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin SalvekarAgile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin Salvekar
Agile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin Salvekar
 
BDD for Rails Legacy Code
BDD for Rails Legacy CodeBDD for Rails Legacy Code
BDD for Rails Legacy Code
 
Bdd for legacy system
Bdd for legacy systemBdd for legacy system
Bdd for legacy system
 
ATAAS 2016 - Amol pradhan - Bridging the gap between business and technology ...
ATAAS 2016 - Amol pradhan - Bridging the gap between business and technology ...ATAAS 2016 - Amol pradhan - Bridging the gap between business and technology ...
ATAAS 2016 - Amol pradhan - Bridging the gap between business and technology ...
 
Object-Oriented BDD w/ Cucumber by Matt van Horn
Object-Oriented BDD w/ Cucumber by Matt van HornObject-Oriented BDD w/ Cucumber by Matt van Horn
Object-Oriented BDD w/ Cucumber by Matt van Horn
 
Impact Map Your Project
Impact Map Your ProjectImpact Map Your Project
Impact Map Your Project
 
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
10 things about BDD, Cucumber and SpecFlow - Long Version 201610 things about BDD, Cucumber and SpecFlow - Long Version 2016
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
 
BDD com Cucumber
BDD com CucumberBDD com Cucumber
BDD com Cucumber
 
BDD and Test Automation in Evalutionary Product Suite
BDD and Test Automation in Evalutionary Product SuiteBDD and Test Automation in Evalutionary Product Suite
BDD and Test Automation in Evalutionary Product Suite
 
Mock Aren't Stub 讀後心得
Mock Aren't Stub 讀後心得Mock Aren't Stub 讀後心得
Mock Aren't Stub 讀後心得
 
Impact Maps/Story Maps - liefern was wirklich zählt
Impact Maps/Story Maps - liefern was wirklich zähltImpact Maps/Story Maps - liefern was wirklich zählt
Impact Maps/Story Maps - liefern was wirklich zählt
 
Upcoming events 2017
Upcoming events 2017Upcoming events 2017
Upcoming events 2017
 
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
 
Moving away from legacy code (AgileCymru)
Moving away from legacy code  (AgileCymru)Moving away from legacy code  (AgileCymru)
Moving away from legacy code (AgileCymru)
 
Help! My Legacy Application is Unmaintainable!
Help! My Legacy Application is Unmaintainable!Help! My Legacy Application is Unmaintainable!
Help! My Legacy Application is Unmaintainable!
 
Impact Mapping with Innovation Games (R)
Impact Mapping with Innovation Games (R)Impact Mapping with Innovation Games (R)
Impact Mapping with Innovation Games (R)
 
Cross mobile testautomation mit Xamarin & SpecFlow
Cross mobile testautomation mit Xamarin & SpecFlowCross mobile testautomation mit Xamarin & SpecFlow
Cross mobile testautomation mit Xamarin & SpecFlow
 

Similaire à Introducing bdd elements to unit testing.pptx

Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
Svetlin Nakov
 
Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd
Sakares Saengkaew
 

Similaire à Introducing bdd elements to unit testing.pptx (20)

Bdd - L'arte di non farsi i fatti propri
Bdd - L'arte di non farsi i fatti propriBdd - L'arte di non farsi i fatti propri
Bdd - L'arte di non farsi i fatti propri
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Topic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionTopic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolution
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
 
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
 
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
 
Making the Move to Behavior Driven Development
Making the Move to Behavior Driven DevelopmentMaking the Move to Behavior Driven Development
Making the Move to Behavior Driven Development
 
Behavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & JasmineBehavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & Jasmine
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is Importaint
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
 
Being Test-Driven: It's not really about testing
Being Test-Driven: It's not really about testingBeing Test-Driven: It's not really about testing
Being Test-Driven: It's not really about testing
 
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
NDC 2011 - SpecFlow: Pragmatic BDD for .NETNDC 2011 - SpecFlow: Pragmatic BDD for .NET
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
 
Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd
 
BDD for APIs
BDD for APIsBDD for APIs
BDD for APIs
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Introducing bdd elements to unit testing.pptx

  • 1. Experiences introducing BDD and BDD elements To unit testing and a legacy codebase XP 2010, June 3rd 2010
  • 2. Background  A local, familyman, 2 children  Developer, Consultant  BEKK Consulting   10+ years  Seen many types of projects  @ah74  hammervold.com/anders
  • 3. Background: What I had seen a lot of  POUT  Some testclasses of several k+ lines  Often excellent testcode  Difficult to understand for others  Difficult to come back to after some time away  Focus on test techniques like Mocking  Refactoring later would mean rewriting complex code AND complex tests  in a hurry?  remove tests that are red
  • 4. BDD and ”BDD elements”  BDD  Started seeing BDD inspired syntax and thinking  Ground up  Which effect did this have ?  Did it correspond with the goals of BDD?  What was happening in other projects right now ?  Examples
  • 5. Example: BDD using Cucumber features http://www.engineyard.com/blog/2009/cucumber-introduction/
  • 6. Example: ”BDDTest” Adapted from and inpired by code and examples from: Torbjørn Marø and Jonas follesø
  • 8. Example: Glue Tore Vestues, http://glue.codeplex.com
  • 10. Effects: The skeptic  ”I know how to write tests”
  • 11. Effects: The skeptic  ”Wow this test became so much simpler!”  ”This was almost fun”
  • 12. How  ~20 minute interviews – Developers – Testers – Customers  5 different projects – May 2010
  • 13. Objections?  Some arguments used were the same as against TDD  Fear of change  Technical problems, sometimes new technology  Unwillingness to learn something new  Not true BDD, outside in through ui
  • 14. Developer perspective  Clear sense of purpose  Recipe to follow  Renewed focus on specification  Smaller, simpler tests  Easier to maintain  Most tests now got a similar structure  Greater number of tests but better organised  ”I give up, i’ll rather go write some BDD-tests, maybe that will cheer me up”
  • 15. Customer perspective  ”The bug-rate dropped significantly”  ”I could see that they (the developers) had understood what I meant”  ”I never understood the code anyway” – Generally responded well to the syntax – Customers were generally more agile than developers perhaps expected – When given a chance – Clarifying requirements
  • 16. Success  Many of the results can be attributed to TDD  BDD elements added to and amplified these  Skeptics became ”believers”  The customers showed greater involvement  Testers could write features in the error report
  • 17. Some success-criteria  Access to a mentor  Commitment from the team  Willingness to learn  Including the customer