SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler offline
Behavior Driven Testing (BDT)

         Anand Bagmar
      Software Quality Evangelist
           ThoughtWorks
Case Study




             • Multiple, long
               running projects
             • Legacy
               applications
             • Integrated
Testing Challenges
• No Automation - Long regression cycle
• Mini-Waterfall
• Huge cost of fixing defects
•   No visibility into what is tested
•   Outdated tests in QC
•   Brittle
•   Little / less value
•   Maintenance nightmare
• Remove the ambiguity
• Same visibility for all
  roles on the team
Evolution of Test Frameworks

             Behavior
              Driven
           Development
              (BDD)


          Optimized scripts


             Record &
             Playback




               Core
            Framework
Behavior Driven Development
                 (BDD)
• Specify the behavior looking at the system
  from the outside.
• Collaborate and come up with a good and
  clear set of Acceptance Criteria
Behavior Driven Development
                 (BDD)
• BDD is an extension of TDD
  – primarily a development practice
• Developers translate the Acceptance Criteria
  into product functionality
Expected Functionality:
The customer should be able to withdraw
money from his account


Given the account has balance of INR 5000
When the customer requests INR 1000
Then the account is debited by INR 1000
Behavior Driven Testing
                 (BDT)
• It is an approach to testing
• Work towards the big picture
Given the account is in credit
And the dispenser contains cash

When the customer requests cash

Then ensure the account is debited
And ensure cash is dispensed
And ensure the card is returned
New Expected Functionality:
The customer should be able to withdraw
money from his account only if his card is
valid
Given the account is in credit
And the card is valid
And the dispenser contains cash

When the customer requests cash

Then ensure the account is debited
And ensure cash is dispensed
And ensure the card is returned
Imperative Scenario




Reference: http://watirmelon.com/2010/12/10/cucumber-imperative-or-declarative-that-is-the-
question/
Declarative Scenario




Reference: http://watirmelon.com/2010/12/10/cucumber-imperative-or-declarative-that-is-the-
question/
What does this do for me?
• Identify the different user flows / behaviors
  for the product
• Determine how the functionality under test
  affects / impacts the above user flows
• Incrementally build up your user flows
What does this do for me?
• Provide visibility
• Automate the right set of tests
• Make your testing efforts more effective
How did we accomplish this?
Who is doing the action?


What is the business functionality?


Actions and verifications / assertions
happen implicitly

Long running tests
Current state

Testes running on Hudson / Jenkins   Since 1st test was automated
Feature files                        33
Scenarios                            65
Smoke tests execution time           15 minutes
Regression tests execution time      45 minutes
Test case repository (manual +       Cucumber .feature files with
automated)                           appropriate tagging
Project Management tool              Mingle
Its not what I
said, its what I
     mean!
Are you doing BDD or BDT?
Pattern                                         Testing Type
The QA team does Test Automation along with BDT
other testing responsibilities.

The QA team focuses on defining acceptance      BDD
criteria, doing manual / ad-hoc / exploratory
testing, etc. and the development team itself
will do Functional Test Automation.
The QA team focuses on defining acceptance      BDD + BDT
criteria, doing manual / ad-hoc / exploratory
testing, etc. and pairs with the development
team to do Functional Test Automation.
Tools to enable BDD / BDT
•   Cucumber
•   JBehave
•   SpecFlow
•   Twist
Anand.Bagmar@thoughtworks.com

     abagmar@gmail.com

Mais conteúdo relacionado

Mais de vodQA

Mais de vodQA (20)

vodQA Pune (2019) - Browser automation using dev tools
vodQA Pune (2019) - Browser automation using dev toolsvodQA Pune (2019) - Browser automation using dev tools
vodQA Pune (2019) - Browser automation using dev tools
 
vodQA Pune (2019) - Augmented reality overview and testing challenges
vodQA Pune (2019) - Augmented reality overview and testing challengesvodQA Pune (2019) - Augmented reality overview and testing challenges
vodQA Pune (2019) - Augmented reality overview and testing challenges
 
vodQA Pune (2019) - Testing AI,ML applications
vodQA Pune (2019) - Testing AI,ML applicationsvodQA Pune (2019) - Testing AI,ML applications
vodQA Pune (2019) - Testing AI,ML applications
 
vodQA Pune (2019) - Design patterns in test automation
vodQA Pune (2019) - Design patterns in test automationvodQA Pune (2019) - Design patterns in test automation
vodQA Pune (2019) - Design patterns in test automation
 
vodQA Pune (2019) - Testing ethereum smart contracts
vodQA Pune (2019) - Testing ethereum smart contractsvodQA Pune (2019) - Testing ethereum smart contracts
vodQA Pune (2019) - Testing ethereum smart contracts
 
vodQA Pune (2019) - Insights into big data testing
vodQA Pune (2019) - Insights into big data testingvodQA Pune (2019) - Insights into big data testing
vodQA Pune (2019) - Insights into big data testing
 
vodQA Pune (2019) - Performance testing cloud deployments
vodQA Pune (2019) - Performance testing cloud deploymentsvodQA Pune (2019) - Performance testing cloud deployments
vodQA Pune (2019) - Performance testing cloud deployments
 
vodQA Pune (2019) - Jenkins pipeline As code
vodQA Pune (2019) - Jenkins pipeline As codevodQA Pune (2019) - Jenkins pipeline As code
vodQA Pune (2019) - Jenkins pipeline As code
 
vodQA(Pune) 2018 - Consumer driven contract testing using pact
vodQA(Pune) 2018 - Consumer driven contract testing using pactvodQA(Pune) 2018 - Consumer driven contract testing using pact
vodQA(Pune) 2018 - Consumer driven contract testing using pact
 
vodQA(Pune) 2018 - Visual testing of web apps in headless environment manis...
vodQA(Pune) 2018 - Visual testing of web apps in headless environment   manis...vodQA(Pune) 2018 - Visual testing of web apps in headless environment   manis...
vodQA(Pune) 2018 - Visual testing of web apps in headless environment manis...
 
vodQA(Pune) 2018 - Enhancing the capabilities of testing team preparing for...
vodQA(Pune) 2018 - Enhancing the capabilities of testing team   preparing for...vodQA(Pune) 2018 - Enhancing the capabilities of testing team   preparing for...
vodQA(Pune) 2018 - Enhancing the capabilities of testing team preparing for...
 
vodQA(Pune) 2018 - QAing the security way
vodQA(Pune) 2018 - QAing the security wayvodQA(Pune) 2018 - QAing the security way
vodQA(Pune) 2018 - QAing the security way
 
vodQA(Pune) 2018 - Docker in Testing
vodQA(Pune) 2018 - Docker in TestingvodQA(Pune) 2018 - Docker in Testing
vodQA(Pune) 2018 - Docker in Testing
 
Mobile automation using appium.pptx
Mobile automation using appium.pptxMobile automation using appium.pptx
Mobile automation using appium.pptx
 
An approach to app security - For beginners
An approach to app security - For beginnersAn approach to app security - For beginners
An approach to app security - For beginners
 
Retrospective
RetrospectiveRetrospective
Retrospective
 
Whys and Hows of Automation
Whys and Hows of AutomationWhys and Hows of Automation
Whys and Hows of Automation
 
Test Automation Pyramid
Test Automation PyramidTest Automation Pyramid
Test Automation Pyramid
 
Test automation Frame Works
Test automation Frame WorksTest automation Frame Works
Test automation Frame Works
 
Stand up
Stand upStand up
Stand up
 

Último

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
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
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
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
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...
 
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
 

Anand Bagmar - Behavior Driven Testing (BDT)

  • 1. Behavior Driven Testing (BDT) Anand Bagmar Software Quality Evangelist ThoughtWorks
  • 2. Case Study • Multiple, long running projects • Legacy applications • Integrated
  • 3. Testing Challenges • No Automation - Long regression cycle • Mini-Waterfall • Huge cost of fixing defects
  • 4. No visibility into what is tested • Outdated tests in QC • Brittle • Little / less value • Maintenance nightmare
  • 5.
  • 6.
  • 7. • Remove the ambiguity • Same visibility for all roles on the team
  • 8.
  • 9. Evolution of Test Frameworks Behavior Driven Development (BDD) Optimized scripts Record & Playback Core Framework
  • 10. Behavior Driven Development (BDD) • Specify the behavior looking at the system from the outside. • Collaborate and come up with a good and clear set of Acceptance Criteria
  • 11. Behavior Driven Development (BDD) • BDD is an extension of TDD – primarily a development practice • Developers translate the Acceptance Criteria into product functionality
  • 12. Expected Functionality: The customer should be able to withdraw money from his account Given the account has balance of INR 5000 When the customer requests INR 1000 Then the account is debited by INR 1000
  • 13. Behavior Driven Testing (BDT) • It is an approach to testing • Work towards the big picture
  • 14. Given the account is in credit And the dispenser contains cash When the customer requests cash Then ensure the account is debited And ensure cash is dispensed And ensure the card is returned
  • 15. New Expected Functionality: The customer should be able to withdraw money from his account only if his card is valid
  • 16. Given the account is in credit And the card is valid And the dispenser contains cash When the customer requests cash Then ensure the account is debited And ensure cash is dispensed And ensure the card is returned
  • 19. What does this do for me? • Identify the different user flows / behaviors for the product • Determine how the functionality under test affects / impacts the above user flows • Incrementally build up your user flows
  • 20. What does this do for me? • Provide visibility • Automate the right set of tests • Make your testing efforts more effective
  • 21.
  • 22.
  • 23. How did we accomplish this?
  • 24.
  • 25. Who is doing the action? What is the business functionality? Actions and verifications / assertions happen implicitly Long running tests
  • 26. Current state Testes running on Hudson / Jenkins Since 1st test was automated Feature files 33 Scenarios 65 Smoke tests execution time 15 minutes Regression tests execution time 45 minutes Test case repository (manual + Cucumber .feature files with automated) appropriate tagging Project Management tool Mingle
  • 27. Its not what I said, its what I mean!
  • 28. Are you doing BDD or BDT? Pattern Testing Type The QA team does Test Automation along with BDT other testing responsibilities. The QA team focuses on defining acceptance BDD criteria, doing manual / ad-hoc / exploratory testing, etc. and the development team itself will do Functional Test Automation. The QA team focuses on defining acceptance BDD + BDT criteria, doing manual / ad-hoc / exploratory testing, etc. and pairs with the development team to do Functional Test Automation.
  • 29. Tools to enable BDD / BDT • Cucumber • JBehave • SpecFlow • Twist
  • 30. Anand.Bagmar@thoughtworks.com abagmar@gmail.com