Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Stories from the trenches about how not to do BDD
Twelve BDD Antipatterns
John
Ferguson
Smart
Introductions
“I help teams of smart people 

learn to work together more efficiently, 

to deliver bet...
To deliver
software that
matters
And a common
language to build
a shared
understanding
Using examples at
multiple levels
C...
To deliver
software that
matters
And a common
language to build
a shared
understanding
Using examples at
multiple levels
C...
To deliver
software that
matters
And a common
language to build
a shared
understanding
Using examples at
multiple levels
C...
To deliver
software that
matters
And a common
language to build
a shared
understanding
Using examples at
multiple levels
C...
To deliver
software that
matters
And a common
language to build
a shared
understanding
Using examples at
multiple levels
C...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
The business owner
tells the business
analyst what he wants
1
2
The business
analyst writes a
requirements
document
3
The ...
How does it work?
The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
4 The tester ...
How does it work?
The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
4 The tester ...
How does it work?
The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
4 The tester ...
How does it work?
The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
4 The tester ...
How does it work?
The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
4 The tester ...
How does it work?
The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
4 The tester ...
FeedbackPitch
The three forms of balance
Timing
FeedbackPitch
The three forms of balance
Timing
FeedbackPitch
The three forms of balance
Timing
FeedbackPitch
The three forms of balance
Timing
FeedbackPitch
The three forms of balance
Timing
Timing
“Out to lunch”
Antipattern #1
“The Cucumber Salad”
Antipattern #2
“The Cucumber Salad”
Feature: Display customer details

As an user

I want to view the customer's personal profile

In ord...
“Cucumber as a Test Tool”
Antipattern #3
Pitch
“Aimless requirements”
Antipattern #4
“Aimless requirements”
Feature: Display customer details

As a user
I want to view the customer's profile details

So that...
“Aimless requirements”
Feature: Display customer details

As a user
I want to view the customer's profile details

So that...
“Aimless requirements”
Feature: Display customer details

As a user
I want to view the customer's profile details

So that...
“Aimless requirements”
Feature: Display customer details

As a user
I want to view the customer's profile details

So that...
“Aimless requirements”
Feature: Display customer details

As a user
I want to view the customer's profile details

So that...
“Aimless requirements”
Feature: Display customer details

As a user
I want to view the customer's profile details

So that...
“Aimless requirements”
Feature: Authenticate using social media

In order to access the application more easily

As a new ...
“Aimless requirements”
Feature: Authenticate using social media

In order to access the application more easily

As a new ...
“Aimless requirements”
Feature: Authenticate using social media

In order to access the application more easily

As a new ...
“Aimless requirements”
Feature: Authenticate using social media

In order to access the application more easily

As a new ...
“Aimless requirements”
Feature: Authenticate using social media

In order to access the application more easily

As a new ...
“Aimless requirements”
Feature: Authenticate using social media

In order to access the application more easily

As a new ...
“Boring requirements”
Antipattern #5
“Boring scenarios”
Scenario Outline: User tries to log on to application with invalid credentials

Given I am a registered...
“Boring scenarios”
Scenario Outline: User tries to log on to application with invalid credentials

Given I am a registered...
“Boring scenarios”
Scenario Outline: User tries to log on to application with invalid credentials

Given I am a registered...
“Eyes on the screen”
Antipattern #6
“Eyes on the screen”
19
Scenario: User logs on to application

Given I am an authorised user
When I enter ‘scott’ into the...
“Eyes on the screen”
19
Scenario: User logs on to application

Given I am an authorised user
When I enter ‘scott’ into the...
“Eyes on the screen”
19
Scenario: User logs on to application

Given I am an authorised user
When I enter ‘scott’ into the...
“Eyes on the screen”
19
Scenario: User logs on to application

Given I am an authorised user
When I enter ‘scott’ into the...
“Eyes on the screen”
19
Scenario: User logs on to application

Given I am an authorised user
When I enter ‘scott’ into the...
“Top-heavy scenarios”
Antipattern #7
“Not having all the cards”
Antipattern #8
“Not having all the cards”
22
Scenario: Find a customer by various criteria

Given I am logged into the application

When ...
“Not having all the cards”
22
Scenario: Find a customer by various criteria

Given I am logged into the application

When ...
“Not having all the cards”
22
Scenario: Find a customer by various criteria

Given I am logged into the application

When ...
“Not having all the cards”
22
Scenario: Find a customer by various criteria

Given I am logged into the application

When ...
“Not having all the cards”
22
Scenario: Find a customer by various criteria

Given I am logged into the application

When ...
“Scenario overload”
Antipattern #9
“Scenario overload”
24
Scenario: The account earns 4% interest when the balance is over $10000

Given a bonus saver accoun...
“Scenario overload”
25
“Scenario overload”
25
Scenario Outline: Bonus saver account
Given a bonus saver account with an end-of-month balance of <...
“Scenario overload”
26
“Scenario overload”
26
Scenario Outline: Bonus saver account
Given a bonus saver account with an end-of-month balance of <...
“Cucumber test scripts”
Antipattern #10
“Cucumber test scripts”
28
“Cucumber test scripts”
29
“Tech-speak Scenarios”
Antipattern #11
“Techie Scenarios”
31
Scenario: Propose user branch when user logs in

Given I am an authorized staff member

When I log o...
Feedback
“Incommunicado scenarios”
Antipattern #12
“Incommunicado scenarios”
34
“Incommunicado scenarios”
35
“Incommunicado scenarios”
36
FeedbackPitch
So keep your balance!
Timing
Questions?
John Ferguson Smart
john.smart@wakaleo.com
wakaleo
http://www.wakaleo.com
Upcoming SlideShare
Loading in …5
×

BDD Anti-patterns

5,371 views

Published on

Behaviour Driven Development is a powerful collaboration technique that can empower teams to deliver higher value features to the business faster and more effectively. But although Behaviour Driven Development is based on a number of simple principles, it can go dramatically wrong in a myriad of different ways.

In this talk we discuss twelve BDD anti-patterns we frequently encounter in real-world BDD projects, anti-patterns that can dramatically reduce the effectiveness of BDD as a practice, and that can even cause BDD adoption to fail entirely. Looking at everything from insufficient collaboration practices to poor use of test automation tooling, from teams that test too much to teams that forget the most important scenarios, we will look at the many different ways that BDD can go wrong, and how it should be done.

We will use real-world examples to illustrate each of these anti-patterns. You will learn how to spot these issues in your own projects, and more importantly how to avoid them in the first place.

Published in: Technology
  • Dating for everyone is here: ♥♥♥ http://bit.ly/39pMlLF ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Earn Up To $316/day! Social Media Jobs from the comfort of home! ◆◆◆ http://t.cn/AieXiXbg
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Making a living taking surveys at home! I have been a stay at home mom for almost 5 years and I am so excited to be able to still stay home, take care of my children and make a living taking surveys on my own computer! It's so easy to get started and I plan to make enough money each week so that my husband can actuallly quit his second job!!! Thank you so much! ●●● http://ishbv.com/goldops777/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

BDD Anti-patterns

  1. 1. Stories from the trenches about how not to do BDD Twelve BDD Antipatterns
  2. 2. John Ferguson Smart Introductions “I help teams of smart people 
 learn to work together more efficiently, 
 to deliver better software faster”
  3. 3. To deliver software that matters And a common language to build a shared understanding Using examples at multiple levels Collaborate to discover requirements and identify uncertainty The essence of BDD
  4. 4. To deliver software that matters And a common language to build a shared understanding Using examples at multiple levels Collaborate to discover requirements and identify uncertainty The essence of BDD
  5. 5. To deliver software that matters And a common language to build a shared understanding Using examples at multiple levels Collaborate to discover requirements and identify uncertainty The essence of BDD
  6. 6. To deliver software that matters And a common language to build a shared understanding Using examples at multiple levels Collaborate to discover requirements and identify uncertainty The essence of BDD
  7. 7. To deliver software that matters And a common language to build a shared understanding Using examples at multiple levels Collaborate to discover requirements and identify uncertainty The essence of BDD
  8. 8. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  9. 9. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  10. 10. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  11. 11. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  12. 12. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  13. 13. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  14. 14. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  15. 15. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  16. 16. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  17. 17. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  18. 18. The business owner tells the business analyst what he wants 1 2 The business analyst writes a requirements document 3 The developer translates the requirements into software 4 The tester translates the requirements into test cases 5 The technical writer translates the software into functional and technical documentation A traditional development process How does it work?
  19. 19. How does it work? The business owner and the business analyst have a conversation about what he needs. 1 2 3 4 The tester uses these scenarios as the basis for her tests 5 The automated tests provide feedback on progress and help document the application The business analyst, the developer and the tester elaborate the requirements together. The scenarios guide the developer and act as automated tests They define requirements as structured, English- language format "scenarios" A BDD development process
  20. 20. How does it work? The business owner and the business analyst have a conversation about what he needs. 1 2 3 4 The tester uses these scenarios as the basis for her tests 5 The automated tests provide feedback on progress and help document the application The business analyst, the developer and the tester elaborate the requirements together. The scenarios guide the developer and act as automated tests They define requirements as structured, English- language format "scenarios" A BDD development process
  21. 21. How does it work? The business owner and the business analyst have a conversation about what he needs. 1 2 3 4 The tester uses these scenarios as the basis for her tests 5 The automated tests provide feedback on progress and help document the application The business analyst, the developer and the tester elaborate the requirements together. The scenarios guide the developer and act as automated tests They define requirements as structured, English- language format "scenarios" A BDD development process
  22. 22. How does it work? The business owner and the business analyst have a conversation about what he needs. 1 2 3 4 The tester uses these scenarios as the basis for her tests 5 The automated tests provide feedback on progress and help document the application The business analyst, the developer and the tester elaborate the requirements together. The scenarios guide the developer and act as automated tests They define requirements as structured, English- language format "scenarios" A BDD development process
  23. 23. How does it work? The business owner and the business analyst have a conversation about what he needs. 1 2 3 4 The tester uses these scenarios as the basis for her tests 5 The automated tests provide feedback on progress and help document the application The business analyst, the developer and the tester elaborate the requirements together. The scenarios guide the developer and act as automated tests They define requirements as structured, English- language format "scenarios" A BDD development process
  24. 24. How does it work? The business owner and the business analyst have a conversation about what he needs. 1 2 3 4 The tester uses these scenarios as the basis for her tests 5 The automated tests provide feedback on progress and help document the application The business analyst, the developer and the tester elaborate the requirements together. The scenarios guide the developer and act as automated tests They define requirements as structured, English- language format "scenarios" A BDD development process
  25. 25. FeedbackPitch The three forms of balance Timing
  26. 26. FeedbackPitch The three forms of balance Timing
  27. 27. FeedbackPitch The three forms of balance Timing
  28. 28. FeedbackPitch The three forms of balance Timing
  29. 29. FeedbackPitch The three forms of balance Timing
  30. 30. Timing
  31. 31. “Out to lunch” Antipattern #1
  32. 32. “The Cucumber Salad” Antipattern #2
  33. 33. “The Cucumber Salad” Feature: Display customer details
 As an user
 I want to view the customer's personal profile
 In order to access the personal information on the customer Scenario: Customer Profile field 'Gender'
 Given I am logged into the application
 And I have displayed the customer
 When I view the customer profile on the summary screen
 Then I should see the Gender field (field type: Dropdown - read only information)
 
 Scenario: Customer Profile ‘DOB/Age' field
 Given I am logged into the application And I have displayed the customer
 When I view the Personal Profile on the Summary screen
 Then I should see the DOB/Age field (DOB field type: Date, format: dd mmm yyyy - read only) (Age field type:read only - numeric) under Personal Profile
 And it should be blank if no value returned
 
 Scenario: Customer Profile 'Marital Status' field
 Scenario: Customer Profile 'Dependents' field
  34. 34. “Cucumber as a Test Tool” Antipattern #3
  35. 35. Pitch
  36. 36. “Aimless requirements” Antipattern #4
  37. 37. “Aimless requirements” Feature: Display customer details
 As a user I want to view the customer's profile details
 So that I can see the personal information on the customer
  38. 38. “Aimless requirements” Feature: Display customer details
 As a user I want to view the customer's profile details
 So that I can see the personal information on the customer
  39. 39. “Aimless requirements” Feature: Display customer details
 As a user I want to view the customer's profile details
 So that I can see the personal information on the customer Feature: Locate a customer
 In order to propose more relevant services to my customers
 As a financial adviser
 I want to view a customer's profile details
  40. 40. “Aimless requirements” Feature: Display customer details
 As a user I want to view the customer's profile details
 So that I can see the personal information on the customer Feature: Locate a customer
 In order to propose more relevant services to my customers
 As a financial adviser
 I want to view a customer's profile details In order to propose more relevant services to my customers What is the real business goal?
  41. 41. “Aimless requirements” Feature: Display customer details
 As a user I want to view the customer's profile details
 So that I can see the personal information on the customer Feature: Locate a customer
 In order to propose more relevant services to my customers
 As a financial adviser
 I want to view a customer's profile details As a financial adviser
 What is the real business goal? What is the context of the user who needs this feature?
  42. 42. “Aimless requirements” Feature: Display customer details
 As a user I want to view the customer's profile details
 So that I can see the personal information on the customer Feature: Locate a customer
 In order to propose more relevant services to my customers
 As a financial adviser
 I want to view a customer's profile details What is the real business goal? What is the context of the user who needs this feature?
  43. 43. “Aimless requirements” Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password
  44. 44. “Aimless requirements” Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password Scenario: Login via LinkedIn Scenario: Login via Twitter
  45. 45. “Aimless requirements” Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password Scenario: Login via LinkedIn Scenario: Login via Twitter
  46. 46. “Aimless requirements” Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password Scenario: Login via LinkedIn Scenario: Login via Twitter
  47. 47. “Aimless requirements” Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password Scenario: Login via LinkedIn Scenario: Login via Twitter Scenario: Login via Facebook
  48. 48. “Aimless requirements” Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password Feature: Authenticate using social media
 In order to access the application more easily
 As a new user I want to authenticate using social media instead of having to provide a username and password Scenario: Login via LinkedIn Scenario: Login via Twitter Scenario: Login via Facebook
  49. 49. “Boring requirements” Antipattern #5
  50. 50. “Boring scenarios” Scenario Outline: User tries to log on to application with invalid credentials
 Given I am a registered user When I login as <username> with password <password> Then I should not be allowed to logon And I should see the error message <error-message> Examples: | username | password | message | | scott | | Please enter a password | | | tiger | Please enter a username | | scott | wrong | Invalid username or password |
  51. 51. “Boring scenarios” Scenario Outline: User tries to log on to application with invalid credentials
 Given I am a registered user When I login as <username> with password <password> Then I should not be allowed to logon And I should see the error message <error-message> Examples: | username | password | message | | scott | | Please enter a password | | | tiger | Please enter a username | | scott | wrong | Invalid username or password | UX concerns
  52. 52. “Boring scenarios” Scenario Outline: User tries to log on to application with invalid credentials
 Given I am a registered user When I login as <username> with password <password> Then I should not be allowed to logon And I should see the error message <error-message> Examples: | username | password | message | | scott | | Please enter a password | | | tiger | Please enter a username | | scott | wrong | Invalid username or password | UX concerns OK, but what else?
  53. 53. “Eyes on the screen” Antipattern #6
  54. 54. “Eyes on the screen” 19 Scenario: User logs on to application
 Given I am an authorised user When I enter ‘scott’ into the username field And I enter ‘tiger’ into the password field And I click on ‘login’ Then the application home page should open
  55. 55. “Eyes on the screen” 19 Scenario: User logs on to application
 Given I am an authorised user When I enter ‘scott’ into the username field And I enter ‘tiger’ into the password field And I click on ‘login’ Then the application home page should open Scenario: User logs on to application
 Given I am an authorised user When I login with a valid username and password Then I should be provided access to my accounts
  56. 56. “Eyes on the screen” 19 Scenario: User logs on to application
 Given I am an authorised user When I enter ‘scott’ into the username field And I enter ‘tiger’ into the password field And I click on ‘login’ Then the application home page should open Scenario: User logs on to application
 Given I am an authorised user When I login with a valid username and password Then I should be provided access to my accounts When I login with a valid username and password
  57. 57. “Eyes on the screen” 19 Scenario: User logs on to application
 Given I am an authorised user When I enter ‘scott’ into the username field And I enter ‘tiger’ into the password field And I click on ‘login’ Then the application home page should open Scenario: User logs on to application
 Given I am an authorised user When I login with a valid username and password Then I should be provided access to my accountsThen I should be provided access to my accounts
  58. 58. “Eyes on the screen” 19 Scenario: User logs on to application
 Given I am an authorised user When I enter ‘scott’ into the username field And I enter ‘tiger’ into the password field And I click on ‘login’ Then the application home page should open Scenario: User logs on to application
 Given I am an authorised user When I login with a valid username and password Then I should be provided access to my accounts
  59. 59. “Top-heavy scenarios” Antipattern #7
  60. 60. “Not having all the cards” Antipattern #8
  61. 61. “Not having all the cards” 22 Scenario: Find a customer by various criteria
 Given I am logged into the application
 When I click Search
 Then I will see search criteria options to search for the customer by customer name, date of birth, and account number
  62. 62. “Not having all the cards” 22 Scenario: Find a customer by various criteria
 Given I am logged into the application
 When I click Search
 Then I will see search criteria options to search for the customer by customer name, date of birth, and account number
  63. 63. “Not having all the cards” 22 Scenario: Find a customer by various criteria
 Given I am logged into the application
 When I click Search
 Then I will see search criteria options to search for the customer by customer name, date of birth, and account number Scenario: Find a customer by name
 Given the following customers exist:
 | id | first name | last name |
 | 100 | Sarah-Jane | Smith |
 | 101 | Sarah | Smith |
 When I search for a customer using the following search criteria:
 | name | Sarah-Jane Smith |
 Then I should display the following customer: | id | first name | last name |
 | 100 | Sarah-Jane | Smith |
  64. 64. “Not having all the cards” 22 Scenario: Find a customer by various criteria
 Given I am logged into the application
 When I click Search
 Then I will see search criteria options to search for the customer by customer name, date of birth, and account number Scenario: Find a customer by name
 Given the following customers exist:
 | id | first name | last name |
 | 100 | Sarah-Jane | Smith |
 | 101 | Sarah | Smith |
 When I search for a customer using the following search criteria:
 | name | Sarah-Jane Smith |
 Then I should display the following customer: | id | first name | last name |
 | 100 | Sarah-Jane | Smith | Well-defined inputs
  65. 65. “Not having all the cards” 22 Scenario: Find a customer by various criteria
 Given I am logged into the application
 When I click Search
 Then I will see search criteria options to search for the customer by customer name, date of birth, and account number Scenario: Find a customer by name
 Given the following customers exist:
 | id | first name | last name |
 | 100 | Sarah-Jane | Smith |
 | 101 | Sarah | Smith |
 When I search for a customer using the following search criteria:
 | name | Sarah-Jane Smith |
 Then I should display the following customer: | id | first name | last name |
 | 100 | Sarah-Jane | Smith | Well-defined inputs Well-defined outcomes
  66. 66. “Scenario overload” Antipattern #9
  67. 67. “Scenario overload” 24 Scenario: The account earns 4% interest when the balance is over $10000
 Given a bonus saver account with a end-of-month balance of 12000
 When interest is calculated
 Then the monthly interest earned should be 40
 
 Scenario: The account earns 2% interest when the balance is less than $10000
 Given a bonus saver account with a end-of-month balance of 9000
 When interest is calculated
 Then the monthly interest earned should be 15
 
 Scenario: The account earns 4% interest when the balance is over $10000 and no more than $300 has been withdrawn
 Given a bonus saver account with a end-of-month balance of 12000
 And a previous end-of-month balance of $12300
 When interest is calculated
 Then the monthly interest earned should be 40
 
 Scenario: The account earns 2% interest when the balance is over $10000 and more than $300 has been withdrawn
 Given a bonus saver account with a end-of-month balance of 12000
 And a previous end-of-month balance of $12400
 When interest is calculated
 Then the monthly interest earned should be 15
  68. 68. “Scenario overload” 25
  69. 69. “Scenario overload” 25 Scenario Outline: Bonus saver account Given a bonus saver account with an end-of-month balance of <balance> And a previous end-of-month balance of <previous> When the interest is calculated Then the applicable interest rate should be <rate> And <interest-earned> should be deposited into the account Examples: balance | previous | rate| earned| rule 10000 | 10000 | 4 | 33.33 | 9000 | 9000 | 2 | 15.00 | Under 10000 earns 2% 10000 | 10300 | 4 | 33.33 | Over 10000 earns 4% 9000 | 9301 | 1 | 7.5 | Under $10000 with over 300 withdrawn earns 1% 10000 | 10301 | 2 | 16.67 | Over $10000 with over $300 withdraw earns 2%
  70. 70. “Scenario overload” 26
  71. 71. “Scenario overload” 26 Scenario Outline: Bonus saver account Given a bonus saver account with an end-of-month balance of <balance> And a previous end-of-month balance of <previous-balance> When the interest is calculated Then the applicable interest rate should be <percentage-interest> And <interest-earned> should be deposited into the account Examples: balance | previous-balance | percentage | earned | 10000 | 10000 | 4 | 33.33 | 10001 | 10000 | 4 | 33.34 | 1000 | 1000 | 2 | 1.67 | 9000 | 9000 | 2 | 15.00 | 10000 | 10300 | 4 | 33.33 | 20000 | 20000 | 4 | 100 | 10000 | 10301 | 2 | 16.67 | 9000 | 9301 | 1 | 7.5 | 20000 | 20301 | 1 | 50 | 100000 | 100301 | 1 | 250 |
  72. 72. “Cucumber test scripts” Antipattern #10
  73. 73. “Cucumber test scripts” 28
  74. 74. “Cucumber test scripts” 29
  75. 75. “Tech-speak Scenarios” Antipattern #11
  76. 76. “Techie Scenarios” 31 Scenario: Propose user branch when user logs in
 Given I am an authorized staff member
 When I log on using my valid credentials
 Then the following branches should be available in the branch drop-down
 | Branch name |
 | George Street |
 | Market Street |
 | Liverpool Street |
  77. 77. Feedback
  78. 78. “Incommunicado scenarios” Antipattern #12
  79. 79. “Incommunicado scenarios” 34
  80. 80. “Incommunicado scenarios” 35
  81. 81. “Incommunicado scenarios” 36
  82. 82. FeedbackPitch So keep your balance! Timing
  83. 83. Questions? John Ferguson Smart john.smart@wakaleo.com wakaleo http://www.wakaleo.com

×