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

Test case techniques
Test case techniquesTest case techniques
Test case techniquesPina Parmar
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-conceptsmedsherb
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Ankit Prajapati
 
Acceptance testing
Acceptance testingAcceptance testing
Acceptance testingCOEPD HR
 
Software testing
Software testingSoftware testing
Software testingmkn3009
 
functional testing
functional testing functional testing
functional testing bharathanche
 
Test Automation
Test AutomationTest Automation
Test Automationrockoder
 
Fundamentals of Software Testing
Fundamentals of Software TestingFundamentals of Software Testing
Fundamentals of Software TestingSagar Joshi
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts pptRathna Priya
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual TestingDirecti Group
 
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 GuideSyed Hassan Raza
 

What's hot (20)

Test case techniques
Test case techniquesTest case techniques
Test case techniques
 
Testing fundamentals
Testing fundamentalsTesting fundamentals
Testing fundamentals
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-concepts
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
 
Software testing
Software testingSoftware testing
Software testing
 
Types of testing
Types of testingTypes of testing
Types of testing
 
Software testing
Software testingSoftware testing
Software testing
 
Agile testing
Agile testingAgile testing
Agile testing
 
Acceptance testing
Acceptance testingAcceptance testing
Acceptance testing
 
Software testing
Software testingSoftware testing
Software testing
 
functional testing
functional testing functional testing
functional testing
 
Test Automation
Test AutomationTest Automation
Test Automation
 
SOFTWARE TESTING
SOFTWARE TESTINGSOFTWARE TESTING
SOFTWARE TESTING
 
Software testing
Software testingSoftware testing
Software testing
 
Fundamentals of Software Testing
Fundamentals of Software TestingFundamentals of Software Testing
Fundamentals of Software Testing
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
 
Software testing
Software testingSoftware testing
Software testing
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
 
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
 
Unit testing
Unit testing Unit testing
Unit 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
 
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
 
Test design techniques
Test design techniquesTest design techniques
Test design techniquesQA Guards
 

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
 
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
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 

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

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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