SlideShare a Scribd company logo
Automated
Functional
Testing
John Ferguson Smart
Consultant
Trainer
Mentor
Author
Speaker
Coder
Technical Agile Practices
Test Driven Development
Continuous Integration/Delivery
Automated
Acceptance Criteria
Refactoring
Pair
Programming
“Without	
  these	
  technical	
  prac1ces,	
  your	
  agile	
  adop1on	
  is	
  hollow”
-­‐	
  Ma6	
  Wynne
Technical Agile Practices
Test Driven Development
Continuous Integration/Delivery
Automated
Acceptance Criteria
Refactoring
Pair
Programming
“Without	
  these	
  technical	
  prac1ces,	
  your	
  agile	
  adop1on	
  is	
  hollow”
-­‐	
  Ma6	
  Wynne
A	
  good	
  func<onal	
  test	
  tells	
  a	
  story
Practices
Tools
QA loses its potential if only done
at the end of the project
The Three Amigos
Living Documentation - test results that serve everyone
So show me the tools!
The Record-Replay Scam
in theory
in practice
The Record-Replay Scam
What do ogres and good functional tests have in common?
(This test is not like an ogre)
Remember...good automated acceptance tests have layers
Start off with the business objectives
Business-­‐level	
  requirements
Describe the business flow
High-­‐level	
  steps	
  
(business	
  flow)
Describe the page interactions
Page-­‐level	
  interac<ons
Page implementation details
HTML	
  details	
  go	
  here
Business	
  Rules
Business	
  Flow
Page/Component	
  
interac<ons
Page/Component	
  
details
Good automated acceptance tests have layers
Come on - can we see the tools now?
Unit	
  tes<ng	
  BDD	
  tools	
  (39%)
Given/When/Then	
  (40%)
Tabular	
  (13%)
WebDriver / Selenium 2
Mature	
  browser	
  automa<on
Wide	
  adop<on
Cross-­‐browser	
  support
Cross-­‐browser	
  support
...or	
  use	
  Selenium	
  Hub
appium
Uses	
  the	
  WebDriver	
  API
Can	
  run	
  on	
  SauceLabs	
  (with	
  some	
  limita<ons)
Watir
Web Application Testing in Ruby
browser.goto 'http://bit.ly/watir-example'
browser.text_field(:name => 'entry.0.single').set 'Watir'
browser.checkbox(:value => 'Ruby').set
Ruby	
  DSL	
  for	
  web	
  tes<ng
WebDriver-­‐based
Fluent	
  and	
  readable
No	
  na<ve	
  support	
  for	
  
Page	
  Objects?
Geb
Groovy Browser Automation
Browser.drive	
  {
	
  	
  	
  	
  go	
  "http://myapp.com/login"
	
  	
  	
  	
  	
  
	
  	
  	
  	
  assert	
  $("h1").text()	
  ==	
  "Please	
  Login"
	
  	
  	
  	
  	
  
	
  	
  	
  	
  $("form.login").with	
  {
	
  	
  	
  	
  	
  	
  	
  	
  username	
  =	
  "admin"
	
  	
  	
  	
  	
  	
  	
  	
  password	
  =	
  "password"
	
  	
  	
  	
  	
  	
  	
  	
  login().click()
	
  	
  	
  	
  }
	
  	
  	
  	
  	
  
	
  	
  	
  	
  assert	
  $("h1").text()	
  ==	
  "Admin	
  Section"
}
Groovy	
  DSL	
  for	
  web	
  tes<ng
WebDriver-­‐based
Fluent	
  and	
  readable
Supports	
  Page	
  Objects
28
High level BDD
Many	
  tools	
  are	
  available
29
Narrative:
In order to increase sales of advertised articles
As a seller
I want buyers to be able to easily find ads for articles they want
to buy
Scenario: Searching by keyword and location
Given Sally wants to buy a puppy for her son
When she looks for 'puppy' in the 'Pets and Animals' category
Then she should obtain a list of ads for puppies for sale.
search_by_keyword_and_location.story
Business-­‐friendly	
  specifica<ons
An	
  example	
  in	
  JBehave
30
Scenario: Searching by keyword and location
Given Sally wants to buy a puppy for her son
When she looks for 'puppy' in the 'Pets and Animals' category
Then she should obtain a list of ads for puppies for sale.
search_by_keyword_and_location.story
Scenario: Searching by keyword and location
Given Sally wants to buy a <present> for her son
When she looks for '<present>' in the '<category>' category
Then she should obtain a list of ads for <expected> for sale.
Examples:
|present |category |expected|
|puppy |Pets & Animals | puppies|
|kitten |Pets & Animals | kittens|
|seiko |Jewellery & Watches| watch |
Tabular	
  examples
31
Scenario: Searching by keyword and location
Given Sally wants to buy a puppy for her son
When she looks for 'puppy' in the 'Pets and Animals' category
Then she should obtain a list of puppy ads
search_by_keyword_and_location.story
public class SearchAdsSteps {
    @Steps
    BuyerSteps buyer;
    @Given("Sally wants to buy a $present for her son")
    public void buyingAPresent(String present) {
        buyer.opens_home_page();
    }
    @When("she looks for $keyword in the $category category")
    public void adSearchByCategoryAndKeyword(String category, String keyword) {
        buyer.chooses_category_and_keywords(category, keyword);
        buyer.performs_search();
    }
    @Then("she should obtain a list of $keyword ads")
    public void shouldOnlySeeAdsContainingKeyword(String keyword) {
        buyer.should_only_see_results_with_titles_containing(keyword);
    }
}
Step	
  implementa<ons	
  in	
  your	
  
favorite	
  language
32
From web tests to living
documentation
33
(Think “Two-CDs”)
34
2 Automate your acceptance criteria
1 Discover your acceptance criteria
4 Execute your acceptance tests
3 Implement your acceptance criteria
35
1 Discover your acceptance criteria
Feature: Browse Catalog
In order to find items that I would like to buy
As a customer
I want to be able to browse through the catalog
Story: Browse by category
In order to find items more easily
As a customer
I want to be able to browse through the product categories
Acceptance Criteria
See all the top-level categories
Browse through the category hierarchy
Should display the correct products for each category
Each category should have the correct sub-categories
Define	
  acceptance	
  criteria	
  for	
  each	
  story
36
1 Discover your acceptance criteria
Acceptance Criteria
See all the top-level categories
Browse through the category hierarchy
Should display the correct products for each category
Each category should have the correct sub-categories
Scenario: See all top-level categories
Given I want to browse the catalog
When I am on the home page
Then I should see the following product categories: Clothing, Accessories, Shoes
Clarify	
  the	
  acceptance	
  criteria	
  with	
  examples
37
2 Automate your acceptance criteria
Story: Browse by category
In order to find items more easily
As a customer
I want to be able to browse through the product categories
Acceptance Criteria
See all the top-level categories
Browse through the category hierarchy
Should display the correct products for each category
Each category should have the correct sub-categories
Scenario: See all top-level categories
Given I want to browse the catalog
When I am on the home page
Then I should see the following product categories: Clothing, Accessories, Shoes
Narrative:
In order to find items more easily
As a customer
I want to be able to see what product categories exist
Scenario: See all top-level categories
Given I want to browse the catalog
When I am on the home page
Then I should see the following product categories: Clothing, Accessories, Shoes
We	
  now	
  have	
  executable	
  specifica<ons
38
2 Automate your acceptance criteria
...but	
  they	
  are	
  reported	
  
as	
  ‘pending’
39
3 Implement your acceptance criteria
Narrative:
In order to find items more easily
As a customer
I want to be able to see what product categories exist
Scenario: See all top-level categories
Given I want to browse the catalog
When I am on the home page
Then I should see the following product categories: Clothing, Accessories, Shoes
40
4 Execute your acceptance tests
What	
  tests	
  have	
  been	
  run
41
What	
  requirements	
  
have	
  been	
  tested?
4 Execute your acceptance tests
42
4 Execute your acceptance tests
How	
  did	
  we	
  show	
  that	
  a	
  
par<cular	
  requirement	
  
worked?
43
4 Execute your acceptance tests
How	
  did	
  we	
  show	
  that	
  a	
  
par<cular	
  requirement	
  
worked?
Demo
time!
hYp://wakaleo.com
hYp://thucydides.info
Want	
  to	
  learn	
  more?
John	
  Ferguson	
  Smart
Thank you

More Related Content

PDF
BDD - Collaborate like you mean it!
PDF
BDD Anti-patterns
PDF
CukeUp 2016 Agile Product Planning Workshop
PDF
Beyond Given/When/Then - why diving into Cucumber is the wrong approach to ad...
PPTX
My Reading Specs - Refactoring Patterns for Gherkin Scenarios
PDF
It's Testing, Jim, but not as we know it - BDD for Testers
PDF
Engage! Bringing teams together to deliver software that makes a difference
PDF
Beyond Given/When/Then - why diving into Cucumber is the wrong approach to ad...
BDD - Collaborate like you mean it!
BDD Anti-patterns
CukeUp 2016 Agile Product Planning Workshop
Beyond Given/When/Then - why diving into Cucumber is the wrong approach to ad...
My Reading Specs - Refactoring Patterns for Gherkin Scenarios
It's Testing, Jim, but not as we know it - BDD for Testers
Engage! Bringing teams together to deliver software that makes a difference
Beyond Given/When/Then - why diving into Cucumber is the wrong approach to ad...

Viewers also liked (20)

PDF
Test Automation Framework Design | www.idexcel.com
PDF
PDF
Functional and Non-functional Test automation
PPTX
Building the Test Automation Framework - Jenkins for Testers
PPTX
functional testing
PDF
T-Mobile Customer Presentation
PPT
Automation testing IBM RFT - Rational Functional Tester
PDF
Introduction to Test Automation - Technology and Tools
PPT
Automation testing strategy, approach & planning
PPT
How can insurers benefit from using ISO Electronic Rating Content?
PDF
Watir web automated tests
PPT
Selenium Primer
PPT
Watir
PPT
Keyword Driven Framework using WATIR
PPT
Functionality testing techniqu
PPTX
Introduction to Automation Testing
PDF
Measuring your way_to_successful_automation_webinar
PPTX
Automation testing
PDF
Serenity and the Journey Pattern
PPTX
Selenium Webdriver
Test Automation Framework Design | www.idexcel.com
Functional and Non-functional Test automation
Building the Test Automation Framework - Jenkins for Testers
functional testing
T-Mobile Customer Presentation
Automation testing IBM RFT - Rational Functional Tester
Introduction to Test Automation - Technology and Tools
Automation testing strategy, approach & planning
How can insurers benefit from using ISO Electronic Rating Content?
Watir web automated tests
Selenium Primer
Watir
Keyword Driven Framework using WATIR
Functionality testing techniqu
Introduction to Automation Testing
Measuring your way_to_successful_automation_webinar
Automation testing
Serenity and the Journey Pattern
Selenium Webdriver
Ad

Similar to Functional testing the_good_the_bad_and_the_ugly (20)

PDF
To atdd-and-beyond
PPTX
1501 meetup
PDF
ATDD BY Example With Cucumber
PDF
Behavior Driven Development and Automation Testing Using Cucumber
PPTX
Automated integration tests for ajax applications (с. карпушин, auriga)
PDF
The LAZY Developer's Guide to BDD (with Cucumber)
PPT
My experience in Software QA
DOCX
Resume
PPTX
Implementing Test Automation in Agile Projects
PDF
Ecommerce Website Testing Checklist
PDF
Reliable Ecommerce Website Testing
PDF
Isset Presentation @ EECI2009
PDF
Building the "right" regression suite using Behavior Driven Testing (BDT)
PDF
Tutorial: Implementing Specification-By-Example with Gherkin
PPTX
Modeling Requirements Using Examples
PPTX
01_Team_03_CS_591_Project
PDF
Finding the Right Testing Tool for the Job
PDF
Writing Requirements Right
PDF
Growing Manual Testers into Automators
PDF
Implementing Test Automation in Agile Projects
To atdd-and-beyond
1501 meetup
ATDD BY Example With Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
Automated integration tests for ajax applications (с. карпушин, auriga)
The LAZY Developer's Guide to BDD (with Cucumber)
My experience in Software QA
Resume
Implementing Test Automation in Agile Projects
Ecommerce Website Testing Checklist
Reliable Ecommerce Website Testing
Isset Presentation @ EECI2009
Building the "right" regression suite using Behavior Driven Testing (BDT)
Tutorial: Implementing Specification-By-Example with Gherkin
Modeling Requirements Using Examples
01_Team_03_CS_591_Project
Finding the Right Testing Tool for the Job
Writing Requirements Right
Growing Manual Testers into Automators
Implementing Test Automation in Agile Projects
Ad

More from John Ferguson Smart Limited (20)

PDF
Artisti e Condotierri - How can your team become artists of the 21st century ...
PDF
Engage! Bringing teams together to deliver software that makes a difference
PDF
BE A POD OF DOLPHINS, NOT A DANCING ELEPHANT
PDF
Sustainable Test Automation with Serenity BDD and Screenplay
PDF
Feature Mapping Workshop
PDF
Shift left-devoxx-pl
PDF
Screenplay - Next generation automated acceptance testing
PDF
Cucumber and Spock Primer
PDF
All the world's a stage – the next step in automated testing practices
PDF
BDD-Driven Microservices
PDF
BDD Anti-patterns
PDF
BDD in Action - Automated Web Testing with WebDriver and Serenity
PDF
BDD in Action - Devoxx 2014
PDF
BDD in Action: Building Software Right and Building the Right Software
PDF
BDD: The unit test of the product owner
PDF
Its testing-jim-but-not-as-we-know-it-devoxx
PDF
BDD in Action - building software that matters
PDF
BDD in Action – principles, practices and real-world application
PDF
TDD and BDD in Java 8 - what's in it for me?
PDF
Continuous Integration 101
Artisti e Condotierri - How can your team become artists of the 21st century ...
Engage! Bringing teams together to deliver software that makes a difference
BE A POD OF DOLPHINS, NOT A DANCING ELEPHANT
Sustainable Test Automation with Serenity BDD and Screenplay
Feature Mapping Workshop
Shift left-devoxx-pl
Screenplay - Next generation automated acceptance testing
Cucumber and Spock Primer
All the world's a stage – the next step in automated testing practices
BDD-Driven Microservices
BDD Anti-patterns
BDD in Action - Automated Web Testing with WebDriver and Serenity
BDD in Action - Devoxx 2014
BDD in Action: Building Software Right and Building the Right Software
BDD: The unit test of the product owner
Its testing-jim-but-not-as-we-know-it-devoxx
BDD in Action - building software that matters
BDD in Action – principles, practices and real-world application
TDD and BDD in Java 8 - what's in it for me?
Continuous Integration 101

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPT
Teaching material agriculture food technology
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Empathic Computing: Creating Shared Understanding
Big Data Technologies - Introduction.pptx
NewMind AI Monthly Chronicles - July 2025
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Sensors and Actuators in IoT Systems using pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
“AI and Expert System Decision Support & Business Intelligence Systems”
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Teaching material agriculture food technology
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Per capita expenditure prediction using model stacking based on satellite ima...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf

Functional testing the_good_the_bad_and_the_ugly

  • 3. Technical Agile Practices Test Driven Development Continuous Integration/Delivery Automated Acceptance Criteria Refactoring Pair Programming “Without  these  technical  prac1ces,  your  agile  adop1on  is  hollow” -­‐  Ma6  Wynne
  • 4. Technical Agile Practices Test Driven Development Continuous Integration/Delivery Automated Acceptance Criteria Refactoring Pair Programming “Without  these  technical  prac1ces,  your  agile  adop1on  is  hollow” -­‐  Ma6  Wynne
  • 5. A  good  func<onal  test  tells  a  story
  • 7. QA loses its potential if only done at the end of the project
  • 9. Living Documentation - test results that serve everyone
  • 10. So show me the tools!
  • 12. in theory in practice The Record-Replay Scam
  • 13. What do ogres and good functional tests have in common?
  • 14. (This test is not like an ogre)
  • 16. Start off with the business objectives Business-­‐level  requirements
  • 17. Describe the business flow High-­‐level  steps   (business  flow)
  • 18. Describe the page interactions Page-­‐level  interac<ons
  • 19. Page implementation details HTML  details  go  here
  • 20. Business  Rules Business  Flow Page/Component   interac<ons Page/Component   details Good automated acceptance tests have layers
  • 21. Come on - can we see the tools now?
  • 22. Unit  tes<ng  BDD  tools  (39%) Given/When/Then  (40%) Tabular  (13%)
  • 23. WebDriver / Selenium 2 Mature  browser  automa<on Wide  adop<on Cross-­‐browser  support Cross-­‐browser  support
  • 25. appium Uses  the  WebDriver  API Can  run  on  SauceLabs  (with  some  limita<ons)
  • 26. Watir Web Application Testing in Ruby browser.goto 'http://bit.ly/watir-example' browser.text_field(:name => 'entry.0.single').set 'Watir' browser.checkbox(:value => 'Ruby').set Ruby  DSL  for  web  tes<ng WebDriver-­‐based Fluent  and  readable No  na<ve  support  for   Page  Objects?
  • 27. Geb Groovy Browser Automation Browser.drive  {        go  "http://myapp.com/login"                  assert  $("h1").text()  ==  "Please  Login"                  $("form.login").with  {                username  =  "admin"                password  =  "password"                login().click()        }                  assert  $("h1").text()  ==  "Admin  Section" } Groovy  DSL  for  web  tes<ng WebDriver-­‐based Fluent  and  readable Supports  Page  Objects
  • 28. 28 High level BDD Many  tools  are  available
  • 29. 29 Narrative: In order to increase sales of advertised articles As a seller I want buyers to be able to easily find ads for articles they want to buy Scenario: Searching by keyword and location Given Sally wants to buy a puppy for her son When she looks for 'puppy' in the 'Pets and Animals' category Then she should obtain a list of ads for puppies for sale. search_by_keyword_and_location.story Business-­‐friendly  specifica<ons An  example  in  JBehave
  • 30. 30 Scenario: Searching by keyword and location Given Sally wants to buy a puppy for her son When she looks for 'puppy' in the 'Pets and Animals' category Then she should obtain a list of ads for puppies for sale. search_by_keyword_and_location.story Scenario: Searching by keyword and location Given Sally wants to buy a <present> for her son When she looks for '<present>' in the '<category>' category Then she should obtain a list of ads for <expected> for sale. Examples: |present |category |expected| |puppy |Pets & Animals | puppies| |kitten |Pets & Animals | kittens| |seiko |Jewellery & Watches| watch | Tabular  examples
  • 31. 31 Scenario: Searching by keyword and location Given Sally wants to buy a puppy for her son When she looks for 'puppy' in the 'Pets and Animals' category Then she should obtain a list of puppy ads search_by_keyword_and_location.story public class SearchAdsSteps {     @Steps     BuyerSteps buyer;     @Given("Sally wants to buy a $present for her son")     public void buyingAPresent(String present) {         buyer.opens_home_page();     }     @When("she looks for $keyword in the $category category")     public void adSearchByCategoryAndKeyword(String category, String keyword) {         buyer.chooses_category_and_keywords(category, keyword);         buyer.performs_search();     }     @Then("she should obtain a list of $keyword ads")     public void shouldOnlySeeAdsContainingKeyword(String keyword) {         buyer.should_only_see_results_with_titles_containing(keyword);     } } Step  implementa<ons  in  your   favorite  language
  • 32. 32 From web tests to living documentation
  • 34. 34 2 Automate your acceptance criteria 1 Discover your acceptance criteria 4 Execute your acceptance tests 3 Implement your acceptance criteria
  • 35. 35 1 Discover your acceptance criteria Feature: Browse Catalog In order to find items that I would like to buy As a customer I want to be able to browse through the catalog Story: Browse by category In order to find items more easily As a customer I want to be able to browse through the product categories Acceptance Criteria See all the top-level categories Browse through the category hierarchy Should display the correct products for each category Each category should have the correct sub-categories Define  acceptance  criteria  for  each  story
  • 36. 36 1 Discover your acceptance criteria Acceptance Criteria See all the top-level categories Browse through the category hierarchy Should display the correct products for each category Each category should have the correct sub-categories Scenario: See all top-level categories Given I want to browse the catalog When I am on the home page Then I should see the following product categories: Clothing, Accessories, Shoes Clarify  the  acceptance  criteria  with  examples
  • 37. 37 2 Automate your acceptance criteria Story: Browse by category In order to find items more easily As a customer I want to be able to browse through the product categories Acceptance Criteria See all the top-level categories Browse through the category hierarchy Should display the correct products for each category Each category should have the correct sub-categories Scenario: See all top-level categories Given I want to browse the catalog When I am on the home page Then I should see the following product categories: Clothing, Accessories, Shoes Narrative: In order to find items more easily As a customer I want to be able to see what product categories exist Scenario: See all top-level categories Given I want to browse the catalog When I am on the home page Then I should see the following product categories: Clothing, Accessories, Shoes We  now  have  executable  specifica<ons
  • 38. 38 2 Automate your acceptance criteria ...but  they  are  reported   as  ‘pending’
  • 39. 39 3 Implement your acceptance criteria Narrative: In order to find items more easily As a customer I want to be able to see what product categories exist Scenario: See all top-level categories Given I want to browse the catalog When I am on the home page Then I should see the following product categories: Clothing, Accessories, Shoes
  • 40. 40 4 Execute your acceptance tests What  tests  have  been  run
  • 41. 41 What  requirements   have  been  tested? 4 Execute your acceptance tests
  • 42. 42 4 Execute your acceptance tests How  did  we  show  that  a   par<cular  requirement   worked?
  • 43. 43 4 Execute your acceptance tests How  did  we  show  that  a   par<cular  requirement   worked?