SlideShare a Scribd company logo
1 of 31
Download to read offline
Functional  
Testing  Pa0erns	
    Premanand Chandrasekaran
        ThoughtWorks, Inc.
   premanand@thoughtworks.com
Types  of  Tests	
                                                     Business  Facing	
Support  Programming	




                                   Functional  Tests	
                 Showcases	
                                   Acceptance  Tests	
                 Exploratory  Tests	




                                                                                                     Critique  Product	
                                                                       Usability  Tests	




                                   Unit  Tests	
                       Performance  Tests	
                                   Component  Tests	
                  Stress  Tests	
                                   System  Tests	
                     Security  Tests	


                                                    Technology  Facing	

                         h0p://www.exampler.com/old-­‐‑blog/2003/08/21/#agile-­‐‑testing-­‐‑project-­‐‑1	
© 2012 ThoughtWorks, Inc.                                                                                                  2
Functional  Tests  -­‐‑  The  Pitch	
•  What Are Functional Tests?
   o Verification that business requirements are
     met
   o Black Box
   o Automated
•  Why Functional Tests?
   o Maintain (high) external quality
   o Allow team to be bolder
   o Allow team to go faster

© 2012 ThoughtWorks, Inc.                          3
Functional  Tests  –  The  Reality	
•  Flaky
•  Take long time to run
•  Cumbersome to maintain
•  Don’t catch many bugs
•  Some things are hard to automate
•  Don’t quite give you the feedback
   you were hoping for
© 2012 ThoughtWorks, Inc.          4
Consequences	
•  Low confidence in automation
•  Over-reliance on manual testing




•  Slipped Deadlines AND/OR
•  Lesser Testing AND/OR
•  Testing in Production :-)

© 2012 ThoughtWorks, Inc.              5
How  To  Get  Be0er?	
                                        Technology	




                            Process	




                                                   People	




© 2012 ThoughtWorks, Inc.                                     6
Process	



© 2012 ThoughtWorks, Inc.               7
Functional  Test  –  Example	



© 2012 ThoughtWorks, Inc.   8
Example  -­‐‑  Specification	




© 2012 ThoughtWorks, Inc.                   9
Example  –  Implementation	




© 2012 ThoughtWorks, Inc.                10
Implementation  Problems?	
•  No correlation between specification
   and implementation
•  Intent lost in translation
•  Easy to write, hard to read, maintain
•  Too monolithic, lacks abstraction

•  Causes non-technical domain experts
   to tune out of the process
© 2012 ThoughtWorks, Inc.                  11
Executable  Specifications	
   Specification  Step	
                                                                                    
                                                                              	



                                                                     Tight  Correlation	
Implementation  Step	
                                                                         
                                                                   	




  © 2012 ThoughtWorks, Inc.                                                                 12
Functional  Test  -­‐‑  Specification	




© 2012 ThoughtWorks, Inc.              13
More  useful  information	
        in  failure  reports	




© 2012 ThoughtWorks, Inc.             14
Acceptance  Criteria  DSL	
•      Given some initial context
•      When an event occurs
•      Then ensure outcome
•      Example –




     © 2012 ThoughtWorks, Inc.      15
Functional  Test  –  New  Implementation	




© 2012 ThoughtWorks, Inc.               16
Good  Acceptance  Criteria	
Scenario: Advanced Search for a hat!
!
Given I am searching on "http://www.etsy.com"!
When I click on the select box with css class "select.handmade"!
And I select "Knitting"!
And I click on the text box with id "#search_query"!
And type in "hat"!
Then there are search results!
	
                                   Focus  on  WHAT,  not  HOW	

          Scenario: Advanced Search for a hat!
          !
          Given I am searching on Etsy.com!
          And I am not logged in!
          And I specify the Knitting sub category!
          And I search for hat!                       Be@er	
          Then there are search results!
          !
    © 2012 ThoughtWorks, Inc.                                   17
How  Many  Tests?	
                                  Manual  Testing	


                                                                          10%	
                                    Functional	
                                      Tests	


                                Integration  Tests	
                      20%	




                                    Unit  Tests	
                         70%	



             h0p://blog.mountaingoatsoftware.com/tag/agile-­‐‑testing	
© 2012 ThoughtWorks, Inc.                                                  18
What  About  Legacy  Systems?	
•  Start with functional tests
•  Cover with unit tests for new
   functionality
•  Be on the lookout to replace
   functional tests more fine-grained tests
   at every given opportunity



© 2012 ThoughtWorks, Inc.                     19
What  To  Automate?	
•  The MOST important scenarios
   o  End-To-End system level scenarios
   o  Happy paths


•  Avoid automating individual feature-
   level acceptance criteria
•  Make a distinction between
   “ephemeral” and “long-standing”
   tests
© 2012 ThoughtWorks, Inc.                 20
When  do  these  tests  run?	
•  After every check-in

•  As part of CI build pipeline
   o Unit à Smoke à Regression à Deploy


•  Incubator Test Suites

© 2012 ThoughtWorks, Inc.                    21
Workflow	
•  Sprint [N -1]
    o  Feature elaboration with entry level acceptance criteria


•  Sprint [N]
    o  Feature kick-off meeting
    o  Developers implement feature
    o  Testers (optionally) add additional acceptance criteria


•  Sprint[N, N + 1]
    o  Testers verify all acceptance criteria to be satisfied
    o  Testers refactor functional test suite
    o  Feature marked complete

 © 2012 ThoughtWorks, Inc.                                        22
Technology	




© 2012 ThoughtWorks, Inc.                  23
Test  Characteristics	
•  Be idempotent
    o  At least re-runnable
    o  Keep tests isolated from one another
•  Be runnable in parallel
    o  No inter-dependencies between tests
•  Be deterministic
    o  Quarantine/eradicate non-deterministic tests
    o  Don’t “sleep”
          •  Prefer callbacks or at least poll for asynchronous responses
    o  Consider mocking remote third-party services
          •  Have separate tests to verify interaction with remote services
    o  Consider using relative dates/times or mock the system clock
    o  http://martinfowler.com/articles/nonDeterminism.html


 © 2012 ThoughtWorks, Inc.                                                    24
Test  Sources	
•  Don’t have any dependencies on
   production sources
•  Treat as first-class citizens
   o  Keep DRY
   o  Run static analysis metrics
•  Leverage design patterns like
   o  Page Objects
   o  Compound Steps
•  Consider the use of terser languages
   o  Groovy, Ruby etc.

© 2012 ThoughtWorks, Inc.                     25
Test  Data	
•  Use application to create test data
•  Use test data creation steps
   o  Frameworks like DBUnit
•  Use anonymized production data subsets
   o  Requires lot of time and effort
•  Use anonymized production data copies
   o  Huge data volumes may make it prohibitive
•  Avoid the shared database anti-pattern
•  Consider mocking remote third-party
   services
© 2012 ThoughtWorks, Inc.                         26
Test  Infrastructure	
•  Invest in fast build hardware
   o  CI servers support multiple remote agents

•  Use same software configuration as
   production in all environments
•  Consider running tests on the cloud
   o  http://www.saucelabs.com




© 2012 ThoughtWorks, Inc.                         27
People	


© 2012 ThoughtWorks, Inc.              28
Who  Writes/Owns  The  Tests?	
•  The specifications – acceptance
   criteria?
   o  Domain Experts
•  Step implementations?
   o  Developers & Testers


•  The functional suite?
   o  The Team
   o  Day-to-Day – Testers

© 2012 ThoughtWorks, Inc.            29
Team  Dynamics	
•  Fix broken builds and tests immediately
   o  OK to occasionally break the build
   o  Not OK to leave the build broken for long


•  Do not allow check-ins over a broken build
   o  Unless check-in is being made to fix the build


•  Co-locate teams as much as possible
   o  At least create fully formed remote teams

© 2012 ThoughtWorks, Inc.                              30
Questions?	

         premanand@thoughtworks.com


                            Thank You!


© 2012 ThoughtWorks, Inc.                  31

More Related Content

What's hot

What's hot (20)

Basic Guide to Manual Testing
Basic Guide to Manual TestingBasic Guide to Manual Testing
Basic Guide to Manual Testing
 
Manual Testing Notes
Manual Testing NotesManual Testing Notes
Manual Testing Notes
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Manual testing ppt
Manual testing pptManual testing ppt
Manual testing ppt
 
Software testing
Software testingSoftware testing
Software testing
 
xUnit
xUnitxUnit
xUnit
 
Manual testing concepts course 1
Manual testing concepts course 1Manual testing concepts course 1
Manual testing concepts course 1
 
SDLC vs STLC
SDLC vs STLCSDLC vs STLC
SDLC vs STLC
 
ISTQB - What's testing
ISTQB - What's testingISTQB - What's testing
ISTQB - What's testing
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Software Testing Life Cycle – A Beginner’s Guide
Software Testing Life Cycle – A Beginner’s GuideSoftware Testing Life Cycle – A Beginner’s Guide
Software Testing Life Cycle – A Beginner’s Guide
 
Software Quality Assurance
Software Quality AssuranceSoftware Quality Assurance
Software Quality Assurance
 
Istqb foundation level day 1
Istqb foundation level   day 1Istqb foundation level   day 1
Istqb foundation level day 1
 
A Taste of Exploratory Testing
A Taste of Exploratory TestingA Taste of Exploratory Testing
A Taste of Exploratory Testing
 
Software testing
Software testingSoftware testing
Software testing
 
Test cases
Test casesTest cases
Test cases
 
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
 
Interview questions for manual testing technology.
Interview questions for manual testing technology.Interview questions for manual testing technology.
Interview questions for manual testing technology.
 
Manual testing
Manual testingManual testing
Manual testing
 
Software testing
Software testingSoftware testing
Software testing
 

Viewers also liked

Structural testing
Structural testingStructural testing
Structural testingSlideshare
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testingHimanshu
 
functional testing
functional testing functional testing
functional testing bharathanche
 
GCSE ICT TESTING
GCSE ICT TESTING GCSE ICT TESTING
GCSE ICT TESTING morgan98
 
Effective Strategies for Distributed Testing
Effective Strategies for Distributed TestingEffective Strategies for Distributed Testing
Effective Strategies for Distributed TestingAnand Bagmar
 
Boundary value analysis
Boundary value analysisBoundary value analysis
Boundary value analysisVadym Muliavka
 
Introduzione al Testing
Introduzione al TestingIntroduzione al Testing
Introduzione al TestingDotNetMarche
 
Test Funzionale
Test FunzionaleTest Funzionale
Test FunzionaleIxmaSoft
 
Clean Unit Test Patterns
Clean Unit Test PatternsClean Unit Test Patterns
Clean Unit Test PatternsFrank Appel
 
Design brief & specification
Design brief & specificationDesign brief & specification
Design brief & specificationhaobinliu
 
Teorie e tecniche dei test
Teorie e tecniche dei testTeorie e tecniche dei test
Teorie e tecniche dei testOlaudio Bia
 
Software Test Patterns: Successes and Challenges
Software Test Patterns: Successes and ChallengesSoftware Test Patterns: Successes and Challenges
Software Test Patterns: Successes and ChallengesBob Binder
 
Importance of software quality metrics
Importance of software quality metricsImportance of software quality metrics
Importance of software quality metricsPiyush Sohaney
 
Design patterns in web testing automation with WebDriver
Design patterns in web testing automation with WebDriverDesign patterns in web testing automation with WebDriver
Design patterns in web testing automation with WebDriverMikalai Alimenkou
 
Software Testing & Test Driven Development
Software Testing & Test Driven DevelopmentSoftware Testing & Test Driven Development
Software Testing & Test Driven DevelopmentSergio Santoro
 
Quality Metrics
Quality Metrics Quality Metrics
Quality Metrics Haroon Abbu
 

Viewers also liked (20)

Structural testing
Structural testingStructural testing
Structural testing
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testing
 
functional testing
functional testing functional testing
functional testing
 
GCSE ICT TESTING
GCSE ICT TESTING GCSE ICT TESTING
GCSE ICT TESTING
 
Effective Strategies for Distributed Testing
Effective Strategies for Distributed TestingEffective Strategies for Distributed Testing
Effective Strategies for Distributed Testing
 
Tw specifications for-testing1
Tw specifications for-testing1Tw specifications for-testing1
Tw specifications for-testing1
 
Boundary value analysis
Boundary value analysisBoundary value analysis
Boundary value analysis
 
Introduzione al Testing
Introduzione al TestingIntroduzione al Testing
Introduzione al Testing
 
Functional Programming in Java
Functional Programming in JavaFunctional Programming in Java
Functional Programming in Java
 
Test Funzionale
Test FunzionaleTest Funzionale
Test Funzionale
 
Clean Unit Test Patterns
Clean Unit Test PatternsClean Unit Test Patterns
Clean Unit Test Patterns
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Design brief & specification
Design brief & specificationDesign brief & specification
Design brief & specification
 
Teorie e tecniche dei test
Teorie e tecniche dei testTeorie e tecniche dei test
Teorie e tecniche dei test
 
Software Test Patterns: Successes and Challenges
Software Test Patterns: Successes and ChallengesSoftware Test Patterns: Successes and Challenges
Software Test Patterns: Successes and Challenges
 
Importance of software quality metrics
Importance of software quality metricsImportance of software quality metrics
Importance of software quality metrics
 
Design patterns in web testing automation with WebDriver
Design patterns in web testing automation with WebDriverDesign patterns in web testing automation with WebDriver
Design patterns in web testing automation with WebDriver
 
Defect Life Cycle
Defect Life CycleDefect Life Cycle
Defect Life Cycle
 
Software Testing & Test Driven Development
Software Testing & Test Driven DevelopmentSoftware Testing & Test Driven Development
Software Testing & Test Driven Development
 
Quality Metrics
Quality Metrics Quality Metrics
Quality Metrics
 

Similar to Functional testing patterns

QA Role In Agile Teams - by Michael Hall
QA Role In Agile Teams - by Michael HallQA Role In Agile Teams - by Michael Hall
QA Role In Agile Teams - by Michael HallSynerzip
 
How BDD enables True CI/CD
How BDD enables True CI/CDHow BDD enables True CI/CD
How BDD enables True CI/CDRoger Turnau
 
Testing on Android
Testing on AndroidTesting on Android
Testing on AndroidAri Lacenski
 
John Fodeh - Adventures in Test Automation-Breaking the Boundaries of Regress...
John Fodeh - Adventures in Test Automation-Breaking the Boundaries of Regress...John Fodeh - Adventures in Test Automation-Breaking the Boundaries of Regress...
John Fodeh - Adventures in Test Automation-Breaking the Boundaries of Regress...TEST Huddle
 
John Fodeh Adventures in Test Automation - EuroSTAR 2013
John Fodeh Adventures in Test Automation - EuroSTAR 2013John Fodeh Adventures in Test Automation - EuroSTAR 2013
John Fodeh Adventures in Test Automation - EuroSTAR 2013TEST Huddle
 
Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.
Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.
Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.Tieturi Oy
 
Testaus 2014: Paul Gerrard - The Changing Role of Testers'
Testaus 2014: Paul Gerrard - The Changing Role of Testers'Testaus 2014: Paul Gerrard - The Changing Role of Testers'
Testaus 2014: Paul Gerrard - The Changing Role of Testers'Tieturi Oy
 
Requirements Engineering - The need for a solution - Marcel Overeem
Requirements Engineering - The need for a solution - Marcel OvereemRequirements Engineering - The need for a solution - Marcel Overeem
Requirements Engineering - The need for a solution - Marcel OvereemVisure Solutions
 
Paul Gerrard - The Redistribution of Testing – Where to Innovate and What to ...
Paul Gerrard - The Redistribution of Testing – Where to Innovate and What to ...Paul Gerrard - The Redistribution of Testing – Where to Innovate and What to ...
Paul Gerrard - The Redistribution of Testing – Where to Innovate and What to ...TEST Huddle
 
Презентация
ПрезентацияПрезентация
Презентацияguest22d71d
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven developmentEinar Ingebrigtsen
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnitsatejsahu
 
Test driven development v1.0
Test driven development v1.0Test driven development v1.0
Test driven development v1.0Ganesh Kondal
 
Automated Exploratory Tests
Automated Exploratory TestsAutomated Exploratory Tests
Automated Exploratory TestsZbyszek Mockun
 
STPCon fall 2012: The Testing Renaissance Has Arrived
STPCon fall 2012: The Testing Renaissance Has ArrivedSTPCon fall 2012: The Testing Renaissance Has Arrived
STPCon fall 2012: The Testing Renaissance Has ArrivedSOASTA
 

Similar to Functional testing patterns (20)

Agile testing
Agile testingAgile testing
Agile testing
 
Android testing
Android testingAndroid testing
Android testing
 
QA Role In Agile Teams - by Michael Hall
QA Role In Agile Teams - by Michael HallQA Role In Agile Teams - by Michael Hall
QA Role In Agile Teams - by Michael Hall
 
CNUG TDD June 2014
CNUG TDD June 2014CNUG TDD June 2014
CNUG TDD June 2014
 
How BDD enables True CI/CD
How BDD enables True CI/CDHow BDD enables True CI/CD
How BDD enables True CI/CD
 
Testing on Android
Testing on AndroidTesting on Android
Testing on Android
 
John Fodeh - Adventures in Test Automation-Breaking the Boundaries of Regress...
John Fodeh - Adventures in Test Automation-Breaking the Boundaries of Regress...John Fodeh - Adventures in Test Automation-Breaking the Boundaries of Regress...
John Fodeh - Adventures in Test Automation-Breaking the Boundaries of Regress...
 
John Fodeh Adventures in Test Automation - EuroSTAR 2013
John Fodeh Adventures in Test Automation - EuroSTAR 2013John Fodeh Adventures in Test Automation - EuroSTAR 2013
John Fodeh Adventures in Test Automation - EuroSTAR 2013
 
Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.
Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.
Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.
 
Testaus 2014: Paul Gerrard - The Changing Role of Testers'
Testaus 2014: Paul Gerrard - The Changing Role of Testers'Testaus 2014: Paul Gerrard - The Changing Role of Testers'
Testaus 2014: Paul Gerrard - The Changing Role of Testers'
 
Requirements Engineering - The need for a solution - Marcel Overeem
Requirements Engineering - The need for a solution - Marcel OvereemRequirements Engineering - The need for a solution - Marcel Overeem
Requirements Engineering - The need for a solution - Marcel Overeem
 
Test Policy and Practices
Test Policy and PracticesTest Policy and Practices
Test Policy and Practices
 
Kku2011
Kku2011Kku2011
Kku2011
 
Paul Gerrard - The Redistribution of Testing – Where to Innovate and What to ...
Paul Gerrard - The Redistribution of Testing – Where to Innovate and What to ...Paul Gerrard - The Redistribution of Testing – Where to Innovate and What to ...
Paul Gerrard - The Redistribution of Testing – Where to Innovate and What to ...
 
Презентация
ПрезентацияПрезентация
Презентация
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven development
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnit
 
Test driven development v1.0
Test driven development v1.0Test driven development v1.0
Test driven development v1.0
 
Automated Exploratory Tests
Automated Exploratory TestsAutomated Exploratory Tests
Automated Exploratory Tests
 
STPCon fall 2012: The Testing Renaissance Has Arrived
STPCon fall 2012: The Testing Renaissance Has ArrivedSTPCon fall 2012: The Testing Renaissance Has Arrived
STPCon fall 2012: The Testing Renaissance Has Arrived
 

Recently uploaded

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 MenDelhi Call girls
 
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...Neo4j
 
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 Nanonetsnaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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?Antenna Manufacturer Coco
 
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...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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.pptxHampshireHUG
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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 SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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 MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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 textsMaria Levchenko
 

Recently uploaded (20)

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
 
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...
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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?
 
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...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 

Functional testing patterns

  • 1. Functional   Testing  Pa0erns Premanand Chandrasekaran ThoughtWorks, Inc. premanand@thoughtworks.com
  • 2. Types  of  Tests Business  Facing Support  Programming Functional  Tests Showcases Acceptance  Tests Exploratory  Tests Critique  Product Usability  Tests Unit  Tests Performance  Tests Component  Tests Stress  Tests System  Tests Security  Tests Technology  Facing h0p://www.exampler.com/old-­‐‑blog/2003/08/21/#agile-­‐‑testing-­‐‑project-­‐‑1 © 2012 ThoughtWorks, Inc. 2
  • 3. Functional  Tests  -­‐‑  The  Pitch •  What Are Functional Tests? o Verification that business requirements are met o Black Box o Automated •  Why Functional Tests? o Maintain (high) external quality o Allow team to be bolder o Allow team to go faster © 2012 ThoughtWorks, Inc. 3
  • 4. Functional  Tests  –  The  Reality •  Flaky •  Take long time to run •  Cumbersome to maintain •  Don’t catch many bugs •  Some things are hard to automate •  Don’t quite give you the feedback you were hoping for © 2012 ThoughtWorks, Inc. 4
  • 5. Consequences •  Low confidence in automation •  Over-reliance on manual testing •  Slipped Deadlines AND/OR •  Lesser Testing AND/OR •  Testing in Production :-) © 2012 ThoughtWorks, Inc. 5
  • 6. How  To  Get  Be0er? Technology Process People © 2012 ThoughtWorks, Inc. 6
  • 8. Functional  Test  –  Example © 2012 ThoughtWorks, Inc. 8
  • 9. Example  -­‐‑  Specification © 2012 ThoughtWorks, Inc. 9
  • 10. Example  –  Implementation © 2012 ThoughtWorks, Inc. 10
  • 11. Implementation  Problems? •  No correlation between specification and implementation •  Intent lost in translation •  Easy to write, hard to read, maintain •  Too monolithic, lacks abstraction •  Causes non-technical domain experts to tune out of the process © 2012 ThoughtWorks, Inc. 11
  • 12. Executable  Specifications Specification  Step                                                       Tight  Correlation Implementation  Step                                     © 2012 ThoughtWorks, Inc. 12
  • 13. Functional  Test  -­‐‑  Specification © 2012 ThoughtWorks, Inc. 13
  • 14. More  useful  information in  failure  reports © 2012 ThoughtWorks, Inc. 14
  • 15. Acceptance  Criteria  DSL •  Given some initial context •  When an event occurs •  Then ensure outcome •  Example – © 2012 ThoughtWorks, Inc. 15
  • 16. Functional  Test  –  New  Implementation © 2012 ThoughtWorks, Inc. 16
  • 17. Good  Acceptance  Criteria Scenario: Advanced Search for a hat! ! Given I am searching on "http://www.etsy.com"! When I click on the select box with css class "select.handmade"! And I select "Knitting"! And I click on the text box with id "#search_query"! And type in "hat"! Then there are search results! Focus  on  WHAT,  not  HOW Scenario: Advanced Search for a hat! ! Given I am searching on Etsy.com! And I am not logged in! And I specify the Knitting sub category! And I search for hat! Be@er Then there are search results! ! © 2012 ThoughtWorks, Inc. 17
  • 18. How  Many  Tests? Manual  Testing 10% Functional Tests Integration  Tests 20% Unit  Tests 70% h0p://blog.mountaingoatsoftware.com/tag/agile-­‐‑testing © 2012 ThoughtWorks, Inc. 18
  • 19. What  About  Legacy  Systems? •  Start with functional tests •  Cover with unit tests for new functionality •  Be on the lookout to replace functional tests more fine-grained tests at every given opportunity © 2012 ThoughtWorks, Inc. 19
  • 20. What  To  Automate? •  The MOST important scenarios o  End-To-End system level scenarios o  Happy paths •  Avoid automating individual feature- level acceptance criteria •  Make a distinction between “ephemeral” and “long-standing” tests © 2012 ThoughtWorks, Inc. 20
  • 21. When  do  these  tests  run? •  After every check-in •  As part of CI build pipeline o Unit à Smoke à Regression à Deploy •  Incubator Test Suites © 2012 ThoughtWorks, Inc. 21
  • 22. Workflow •  Sprint [N -1] o  Feature elaboration with entry level acceptance criteria •  Sprint [N] o  Feature kick-off meeting o  Developers implement feature o  Testers (optionally) add additional acceptance criteria •  Sprint[N, N + 1] o  Testers verify all acceptance criteria to be satisfied o  Testers refactor functional test suite o  Feature marked complete © 2012 ThoughtWorks, Inc. 22
  • 24. Test  Characteristics •  Be idempotent o  At least re-runnable o  Keep tests isolated from one another •  Be runnable in parallel o  No inter-dependencies between tests •  Be deterministic o  Quarantine/eradicate non-deterministic tests o  Don’t “sleep” •  Prefer callbacks or at least poll for asynchronous responses o  Consider mocking remote third-party services •  Have separate tests to verify interaction with remote services o  Consider using relative dates/times or mock the system clock o  http://martinfowler.com/articles/nonDeterminism.html © 2012 ThoughtWorks, Inc. 24
  • 25. Test  Sources •  Don’t have any dependencies on production sources •  Treat as first-class citizens o  Keep DRY o  Run static analysis metrics •  Leverage design patterns like o  Page Objects o  Compound Steps •  Consider the use of terser languages o  Groovy, Ruby etc. © 2012 ThoughtWorks, Inc. 25
  • 26. Test  Data •  Use application to create test data •  Use test data creation steps o  Frameworks like DBUnit •  Use anonymized production data subsets o  Requires lot of time and effort •  Use anonymized production data copies o  Huge data volumes may make it prohibitive •  Avoid the shared database anti-pattern •  Consider mocking remote third-party services © 2012 ThoughtWorks, Inc. 26
  • 27. Test  Infrastructure •  Invest in fast build hardware o  CI servers support multiple remote agents •  Use same software configuration as production in all environments •  Consider running tests on the cloud o  http://www.saucelabs.com © 2012 ThoughtWorks, Inc. 27
  • 29. Who  Writes/Owns  The  Tests? •  The specifications – acceptance criteria? o  Domain Experts •  Step implementations? o  Developers & Testers •  The functional suite? o  The Team o  Day-to-Day – Testers © 2012 ThoughtWorks, Inc. 29
  • 30. Team  Dynamics •  Fix broken builds and tests immediately o  OK to occasionally break the build o  Not OK to leave the build broken for long •  Do not allow check-ins over a broken build o  Unless check-in is being made to fix the build •  Co-locate teams as much as possible o  At least create fully formed remote teams © 2012 ThoughtWorks, Inc. 30
  • 31. Questions? premanand@thoughtworks.com Thank You! © 2012 ThoughtWorks, Inc. 31