View
6.982
Download
0
Category
Tags:
Preview:
DESCRIPTION
What is Behavior Driven Testing (BDT)? How does it differ from Behavior Driven Development? What tools support this kind of testing? The value proposition BDT offers. - Anand Bagmar
Citation preview
Behavior Driven Testing (BDT)
Anand Bagmar Software Quality Evangelist
ThoughtWorks
Case Study
• Multiple, long running projects
• Legacy applications
• Integrated
• No Automation - Long regression cycle
• Mini-Waterfall
• Huge cost of fixing defects
Testing Challenges
• 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
• BDD is an extension of TDD
– primarily a development practice
• Developers translate the Acceptance Criteria into product functionality
Behavior Driven Development (BDD)
Given the account has balance of INR 5000
When the customer requests INR 1000
Then the account is debited by INR 1000
Expected Functionality:
The customer should be able to withdraw money from his account
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 + automated)
Cucumber .feature files with 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 other testing responsibilities.
BDT
The QA team focuses on defining acceptance criteria, doing manual / ad-hoc / exploratory testing, etc. and the development team itself will do Functional Test Automation.
BDD
The QA team focuses on defining acceptance criteria, doing manual / ad-hoc / exploratory testing, etc. and pairs with the development team to do Functional Test Automation.
BDD + BDT
Tools to enable BDD / BDT
• Cucumber
• JBehave
• SpecFlow
• Twist
Anand.Bagmar@thoughtworks.com
abagmar@gmail.com
Recommended