SlideShare une entreprise Scribd logo
1  sur  21
Test Automation Pyramid
T. Alexander Lystad, Chief QA Architect, VESD
Test Automation
Why?
Allows you to test more with less effort
Allows you to deploy/release more quickly and more frequently
Higher quality software
How?
As a natural part of the development process
A story is not done until appropriate automated tests are passing
Test Automation Pyramid
Shows different technical levels on which
you can have automated tests
A model
Going up
Scope increases
Execution time increases
Effort increases
Guideline for relative distribution of your
testing effort
Unit Tests
Testing smallest possible parts of the system
in isolation
Use of test doubles to replace dependencies
Dummies, stubs, spies, fakes, mocks
Smallest scope
Easier to locate and understand errors
Best performance
Execute early and often
Won’t catch all defects
Component Integration Tests
● Testing that multiple components work
together
● Test doubles are not used for the integration(s)
you want to test
● Varying scope
● Good performance
● Won’t catch all defects
API Tests
Testing that your APIs behave as expected
REST
SOAP
...
Big scope
Involves many components
Decent performance
Won’t catch all defects
UI Tests
End-to-end testing
Maximum scope
Can catch many problems
Worst performance
Don't use UI for setup and teardown
Parallelize
Can be brittle, flaky and a lot of work to maintain
Test critical user workflows
Won’t catch all defects
Exploratory Testing
Manual testing
Not regression testing
Experience + creativity
Used to learn about the system, discover defects
and to improve automated testing
Can be based on a mission/test charter or persona
Test for accurate and helpful error messages when registering
an expense incorrectly
Test for unexpected results
when configuring company
details in two different tabs
Impatient manager new to the system
Where is…?
● Acceptance testing
● BDD
● Smoke testing
● Security testing
● Performance testing
● System testing
● System integration testing
● …
What should I aim for?
Depends, discuss in your team
As an example, Google suggests
70% unit tests
20% integration tests
10% end-to-end tests
Tools
Selenium WebDriver (VAFT)
JAutomate, Sikuli
SoapUI, RestSharp
JIRA Capture
Hour-glassIce cream cone
Anti-patterns
Other Test Automation Pyramids
Testing Week Task
Confluence: Test Automation Pyramid - Testing Week 2015
How does your team's test automation effort fit into the Test Automation Pyramid,
how does your pyramid look today, and how can it improve going forward?
Example workflow
Idea → Production
Example workflow
Design process
Acceptance criteria drafted
Example workflow
Refinement process
3 amigos: PO/BA + dev +
QA/tester
Acceptance criteria finalized
Acceptance tests finalized
Risks and mitigation
What should be tested, on
which level
Example workflow
Implementation
Developers have a clear picture
of what is expected
Decided automated tests are
implemented as part of story
development
Example workflow: Test execution
Balance between quick feedback
and discovering problems early
During implementation
After implementation
At the beginning of your delivery
pipeline (CI server)
After deployments
Internal Test
User Acceptance
Production
Exploratory testing
Summary
The test automation pyramid is a useful thinking tool and discussion reference
Make conscious decisions about what to test on which level, and also where you
run which tests
Try to distribute your tests optimally
High quality
High velocity
Medium effort
Discuss with your team
Do the Testing Week task
Questions or comments?

Contenu connexe

Tendances

Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
nickokiss
 

Tendances (20)

Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
Introduction to Agile Testing
Introduction to Agile TestingIntroduction to Agile Testing
Introduction to Agile Testing
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Automation testing & Unit testing
Automation testing & Unit testingAutomation testing & Unit testing
Automation testing & Unit testing
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 
Test Automation and Selenium
Test Automation and SeleniumTest Automation and Selenium
Test Automation and Selenium
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
test_automation_POC
test_automation_POCtest_automation_POC
test_automation_POC
 
Test Automation Best Practices (with SOA test approach)
Test Automation Best Practices (with SOA test approach)Test Automation Best Practices (with SOA test approach)
Test Automation Best Practices (with SOA test approach)
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
TDD and BDD and ATDD
TDD and BDD and ATDDTDD and BDD and ATDD
TDD and BDD and ATDD
 

En vedette

Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
Naresh Jain
 
JavaScript as a First Class Language
JavaScript as a First Class LanguageJavaScript as a First Class Language
JavaScript as a First Class Language
fabiopereirame
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
Docker, Inc.
 

En vedette (20)

Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
 
JavaScript as a First Class Language
JavaScript as a First Class LanguageJavaScript as a First Class Language
JavaScript as a First Class Language
 
Deliver anything, anywhere, anytime
Deliver anything, anywhere, anytimeDeliver anything, anywhere, anytime
Deliver anything, anywhere, anytime
 
Test pyramid
Test pyramidTest pyramid
Test pyramid
 
Test Driven Development via Agile Testing
Test Driven Development via Agile TestingTest Driven Development via Agile Testing
Test Driven Development via Agile Testing
 
Inverting Test Pyramid - A First Hand Experience Report
Inverting Test Pyramid - A First Hand Experience ReportInverting Test Pyramid - A First Hand Experience Report
Inverting Test Pyramid - A First Hand Experience Report
 
The Test Pyramid
The Test PyramidThe Test Pyramid
The Test Pyramid
 
Testing Frameworks
Testing FrameworksTesting Frameworks
Testing Frameworks
 
Build And Test Automation - Shortening the Feedback Loop
Build And Test Automation - Shortening the Feedback LoopBuild And Test Automation - Shortening the Feedback Loop
Build And Test Automation - Shortening the Feedback Loop
 
Anand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in AgileAnand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in Agile
 
Agile Testing Dilemmas
Agile Testing DilemmasAgile Testing Dilemmas
Agile Testing Dilemmas
 
Differences between Testing in Waterfall and Agile
Differences between Testing in Waterfall and AgileDifferences between Testing in Waterfall and Agile
Differences between Testing in Waterfall and Agile
 
Transforming Organizations with CI/CD
Transforming Organizations with CI/CDTransforming Organizations with CI/CD
Transforming Organizations with CI/CD
 
Docker in a big company
Docker in a big companyDocker in a big company
Docker in a big company
 
Jenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous DeliveryJenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous Delivery
 
Reduce DevOps Friction with Docker & Jenkins by Andy Pemberton, Cloudbees
Reduce DevOps Friction with Docker & Jenkins by Andy Pemberton, CloudbeesReduce DevOps Friction with Docker & Jenkins by Andy Pemberton, Cloudbees
Reduce DevOps Friction with Docker & Jenkins by Andy Pemberton, Cloudbees
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 

Similaire à Test Automation Pyramid

Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
Quontra Solutions
 

Similaire à Test Automation Pyramid (20)

Agile testing
Agile testingAgile testing
Agile testing
 
Future of QA
Future of QAFuture of QA
Future of QA
 
Futureofqa
FutureofqaFutureofqa
Futureofqa
 
Testing in agile
Testing in agileTesting in agile
Testing in agile
 
Designing Self-maintaining UI Tests for Web Applications
Designing Self-maintaining UI Tests for Web ApplicationsDesigning Self-maintaining UI Tests for Web Applications
Designing Self-maintaining UI Tests for Web Applications
 
Enhancing Software Quality
Enhancing Software QualityEnhancing Software Quality
Enhancing Software Quality
 
E2 e test with testcafe
E2 e test with testcafeE2 e test with testcafe
E2 e test with testcafe
 
Test automation within a scrum process
Test automation within a scrum processTest automation within a scrum process
Test automation within a scrum process
 
Lightning Talks by Globant - Automation (This app runs by itself )
Lightning Talks by Globant -  Automation (This app runs by itself ) Lightning Talks by Globant -  Automation (This app runs by itself )
Lightning Talks by Globant - Automation (This app runs by itself )
 
QAorHighway2016
QAorHighway2016QAorHighway2016
QAorHighway2016
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Overview of Lab Management and TFS
Overview of Lab Management and TFSOverview of Lab Management and TFS
Overview of Lab Management and TFS
 
Automation Concepts
Automation ConceptsAutomation Concepts
Automation Concepts
 
Making the Unstable Stable - An Intro To Testing
Making the Unstable Stable - An Intro To TestingMaking the Unstable Stable - An Intro To Testing
Making the Unstable Stable - An Intro To Testing
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 
Class 01.pptx
Class 01.pptxClass 01.pptx
Class 01.pptx
 
Relieving the Testing Bottle Neck in Your Projects | cPrime + QASymphony
Relieving the Testing Bottle Neck in Your Projects | cPrime + QASymphonyRelieving the Testing Bottle Neck in Your Projects | cPrime + QASymphony
Relieving the Testing Bottle Neck in Your Projects | cPrime + QASymphony
 
Relieveing the Testing Bottle Neck - Webinar
Relieveing the Testing Bottle Neck - WebinarRelieveing the Testing Bottle Neck - Webinar
Relieveing the Testing Bottle Neck - Webinar
 
Software Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsSoftware Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails Applications
 
Are Your Continuous Tests Too Fragile for Agile?
Are Your Continuous Tests Too Fragile for Agile?Are Your Continuous Tests Too Fragile for Agile?
Are Your Continuous Tests Too Fragile for Agile?
 

Plus de T. Alexander Lystad

Plus de T. Alexander Lystad (7)

Lichess.org: Serving 5 Million Chess Games a Day with 125 Volunteers and €5 D...
Lichess.org: Serving 5 Million Chess Games a Day with 125 Volunteers and €5 D...Lichess.org: Serving 5 Million Chess Games a Day with 125 Volunteers and €5 D...
Lichess.org: Serving 5 Million Chess Games a Day with 125 Volunteers and €5 D...
 
3 types of monitoring for 2020
3 types of monitoring for 20203 types of monitoring for 2020
3 types of monitoring for 2020
 
Best practices for running Windows workloads on AWS - AWS Summit Stockholm (M...
Best practices for running Windows workloads on AWS - AWS Summit Stockholm (M...Best practices for running Windows workloads on AWS - AWS Summit Stockholm (M...
Best practices for running Windows workloads on AWS - AWS Summit Stockholm (M...
 
AWS in Visma 2015-2018: Lessons Learned
AWS in Visma 2015-2018: Lessons LearnedAWS in Visma 2015-2018: Lessons Learned
AWS in Visma 2015-2018: Lessons Learned
 
Visma Cloud Delivery Model - 3 years and 40 teams later (DevOpsDays Oslo 2018)
Visma Cloud Delivery Model - 3 years and 40 teams later (DevOpsDays Oslo 2018)Visma Cloud Delivery Model - 3 years and 40 teams later (DevOpsDays Oslo 2018)
Visma Cloud Delivery Model - 3 years and 40 teams later (DevOpsDays Oslo 2018)
 
Feature toggling
Feature togglingFeature toggling
Feature toggling
 
Agility in 2016
Agility in 2016Agility in 2016
Agility in 2016
 

Dernier

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Dernier (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 

Test Automation Pyramid

  • 1. Test Automation Pyramid T. Alexander Lystad, Chief QA Architect, VESD
  • 2. Test Automation Why? Allows you to test more with less effort Allows you to deploy/release more quickly and more frequently Higher quality software How? As a natural part of the development process A story is not done until appropriate automated tests are passing
  • 3. Test Automation Pyramid Shows different technical levels on which you can have automated tests A model Going up Scope increases Execution time increases Effort increases Guideline for relative distribution of your testing effort
  • 4. Unit Tests Testing smallest possible parts of the system in isolation Use of test doubles to replace dependencies Dummies, stubs, spies, fakes, mocks Smallest scope Easier to locate and understand errors Best performance Execute early and often Won’t catch all defects
  • 5. Component Integration Tests ● Testing that multiple components work together ● Test doubles are not used for the integration(s) you want to test ● Varying scope ● Good performance ● Won’t catch all defects
  • 6. API Tests Testing that your APIs behave as expected REST SOAP ... Big scope Involves many components Decent performance Won’t catch all defects
  • 7. UI Tests End-to-end testing Maximum scope Can catch many problems Worst performance Don't use UI for setup and teardown Parallelize Can be brittle, flaky and a lot of work to maintain Test critical user workflows Won’t catch all defects
  • 8. Exploratory Testing Manual testing Not regression testing Experience + creativity Used to learn about the system, discover defects and to improve automated testing Can be based on a mission/test charter or persona Test for accurate and helpful error messages when registering an expense incorrectly Test for unexpected results when configuring company details in two different tabs Impatient manager new to the system
  • 9. Where is…? ● Acceptance testing ● BDD ● Smoke testing ● Security testing ● Performance testing ● System testing ● System integration testing ● …
  • 10. What should I aim for? Depends, discuss in your team As an example, Google suggests 70% unit tests 20% integration tests 10% end-to-end tests
  • 11. Tools Selenium WebDriver (VAFT) JAutomate, Sikuli SoapUI, RestSharp JIRA Capture
  • 14. Testing Week Task Confluence: Test Automation Pyramid - Testing Week 2015 How does your team's test automation effort fit into the Test Automation Pyramid, how does your pyramid look today, and how can it improve going forward?
  • 17. Example workflow Refinement process 3 amigos: PO/BA + dev + QA/tester Acceptance criteria finalized Acceptance tests finalized Risks and mitigation What should be tested, on which level
  • 18. Example workflow Implementation Developers have a clear picture of what is expected Decided automated tests are implemented as part of story development
  • 19. Example workflow: Test execution Balance between quick feedback and discovering problems early During implementation After implementation At the beginning of your delivery pipeline (CI server) After deployments Internal Test User Acceptance Production Exploratory testing
  • 20. Summary The test automation pyramid is a useful thinking tool and discussion reference Make conscious decisions about what to test on which level, and also where you run which tests Try to distribute your tests optimally High quality High velocity Medium effort Discuss with your team Do the Testing Week task

Notes de l'éditeur

  1. My name is Alexander, and I’m usually one floor above, working on Quality Assurance stuff, although I am here quite often as well I want to give an introduction to the test automation pyramid, a concept which I think it is useful for everyone involved in the development process to know about, so hopefully we have many different roles in the audience Im going to start off with some observations about test automation in general
  2. When you boil it all down, we usually do test automation because it allows us to test more with less effort You invest some time into designing, implementing and maintaining your automated tests, and from that investment you get certain benefits: Don’t need to spend time and effort to do manual testing, at least not regression testing We can test things that are not possible or practical to do manually In some ways, automated tests are more accurate and more reliable Run tests all the time, continuous verification and quick feedback on that your service works as expect while we are constantly changing it When more and more of your test effort is automated, you can release in a shorter amount of time, and also more frequently which should be a goal in itself Result hopefully, is higher software quality Test automation should be done as a natural part of the development process, and not as an afterthought or something to be done when you have time If you do that, you will accumulate technical debt, that you will suffer for later A story is not done until appropriate automated tests are passing What is appropriate? That depends on many different factors, which is why it should be discussed in the team prior to implementation of a user story In that discussion you can use the test automation pyramid
  3. Shows different technical levels on which you can have automated tests: Unit Tests, Component Integration Tests, ... An important thing to mention is that this is a model. It is a thinking tool, something to be used as a reference, and it is imperfect by definition. You can create a pyramid like this in many different ways, and I will show you some examples of that later. As you move up in the pyramid, the scope of the tests increase, and their execution time, and the effort needed to create/run/maintain them Model argues that you should probably have more unit tests than component integration tests, more component integration tests than API tests, more UI tests than API tests, and so on. We’ll get into why as we go through the layers.
  4. With unit tests you want to test the smallest possible parts of the system in isolation To achieve that you replace dependencies with test doubles Dummies, stubs, spies, fakes, mocks An example for those who are not developers: If you’re creating a unit test for unit A, and unit A depends on unit B. In your unit test, you replace unit B with a test double that you create and control. So your unit test for unit A is not relying on unit B at all. Because we have replaced the dependencies that to unit B, our unit test has a very small scope. If it fails, we know exactly where the problem is - in unit A. The small scope is also why unit tests have the best performance in the pyramid. When you replace all the dependencies, so you are not writing to hard drive, talking to a database or integrating with an external system, and so on But even with a great unit test suite, you need another line of defense
  5. We already know that our units work as we expect them to, in isolation, now we want to make sure that they work in combination Which is why we don’t use test doubles, at least not for the integrations that we are interesting in testing So in my previous example, we would test unit A and B together, without using a test double You can have small component integration test like that, testing only two components, or you have bigger component integration tests, involving a bigger part of the system So the scope of these tests vary, but in general the performance is still pretty good, even though unit tests are faster
  6. Most services expose a lot of important functionality through APIs As an example, you might have a REST API that is used by your front-end, used by your mobile app, and used by external systems integrating with your system Now, you could consider API tests as being very large component integration tests, because the API relies on many different components on lower levels But when you are testing APIs, you have a different focus You are testing the system from more of a business and user perspective, thinking about how your API will be used You want to guarantee that your API can be used in a certain way, and that it behaves as it should Generally, API tests have a large scope, but they are still pretty fast, at least much faster than UI Tests If you know that your UI relies on a solid API, you don’t need a huge number of UI tests, which brings us to the next level
  7. Here I want to stress that I mean using the UI to test the application end-to-end, possibly with integrations to other systems. We are not about unit tests or component integration tests in JavaScript - that would be the bottom layer. By definition, these end-to-end tests have the largest scope compared to the other layers, which is Good because they can catch many different types of problems But you need to spend a little bit of time to figure out where the error actually is The large scope is also one reason for UI tests having the worst performance As an example, let's say you are using Selenium WebDriver which allows you to test web applications by automating the browser. In that case you automatically start a browser, download resources, execute JavaScript, the browser makes multiple calls to your REST API, then the backend makes multiple calls to the database, and possibly to other systems But to improve the performance of your UI tests you can Prepare or clean up test data with other means that perform better Run the tests in parallel, but doing that can be a big challenge in itself (tests, application, test infrastructure) Brittle, flaky and a lot of work to maintain: Because the scope of the test is so large. Brittle, meaning that they fail easily. Many things can impact the test, even though you didn’t intend to. Flakey, meaning that they fail inconsistently, for instance because you have a bigger test infrastructure involved that could randomly crash Rant: A flakey test is worse than having no test at all. If a test can fail when nothing is wrong, you will stop taking that test seriously. You will also waste a lot of time, running and re-running the test, investigating the results and so on. If you have flakey tests, address the root cause, and if you can't, delete the test, or switch to another technology. To get back on track: To avoid having too many UI tests you want to identify the most important user workflows in your application, and create tests that emulate a user using going through those workflows In general: Very valuable, but costly (for the same reason)
  8. Not a part of the pyramid itself, because it is manual testing but not regression testing Combine experience with the system, and experience as a tester, with creativity to explore the system, looking at the system from new angles, discovering new defects, and using what you learn to improve your automated tests Often, exploratory testing is based on a mission, test charter or persona <some examples> Example: Let’s say you act as this impatient manager, not filling out all the input fields you should and double and triple clicking all the buttons, and you discover a problem when clicking the Save button repeatedly Then you can investigate that, see if you have similar problems elsewhere and if you should have automated tests for catching these problems.
  9. So we have covered all the layers, but I am sure someone has been thinking where is this and that form of testing? The pyramid concerns itself with different technical levels of testing, while these examples here are either different motivations for testing, or certain properties you want to test for, and can be done on all or several of these technical levels
  10. I wanted to illustrate that there is no silver bullet. You can’t use one single tool for test automation. If you do, you might get this →
  11. This is what you don’t want. Ice cream cone: Mostly manual testing, started with Selenium WebDriver. Too many UI tests, so you start with SoapUI to create API tests. Completely opposite of what you want. Hour-glass: Developers write unit tests. Other people who write UI tests. No cooperation. Something to be cognizant of, and to avoid.
  12. Here are the test automation pyramids I promised you earlier. As you can see, there are many ways of creating a test automation pyramid. Maybe your system doesn’t have a UI. Or maybe you have some good arguments for why you should have more API tests than component integration tests, which then of course would be fine. It’s not really possible to have one ideal test automation pyramid for everyone, which is why there is a special Testing Week task for this
  13. Go to this page on Confluence. Use my example, or create your own pyramid. Make sure you have a common understanding within your team. Try figure how your test effort is distributed today, and how you can improve
  14. I want to talk about where the test automation pyramid is relevant in the development process Example workflow from someone having an idea until the idea has been implemented and deployed to Production QP: Where the team builds quality into the product DP: Where you verify quality QP: Quality increases, maximum quality when you push to mainline DP: Confidence increases, maximum confidence when you deploy to Production
  15. When the PO or BA is designing a user story they might draft some acceptance criteria - when A, B, and C are true, I consider the story to be fully implemented
  16. Then, during refinement/grooming/breakout, different roles collaborate closely, sometimes referred to as the 3 amigos Of course you can have more than 3 people, but all roles should be represented. So you might have a PO/BA, the person with the vision for the user story, a developer, and a QA/tester They make sure they have a common understanding of the story, they finalize the acceptance criteria, they finalize the acceptance tests, and they discuss risks and how to mitigate them In that discussion they plan what should be tested, on which level, and the concept of the pyramid can be very useful
  17. If you have done a good job in the refinement phase, developers should have a pretty clear picture of what is expected both in terms of functionality and automated tests Automated tests are implemented as part of the user story
  18. Assuming we have a good process for creating automated tests, where and when do we execute the tests? Typically unit tests and component integration tests are executed by developers during implementation, and before they push their changes to the mainline Then, you run the same tests on a CI server, in case someone forgot to run them locally, ‘ to make sure the tests pass on other machines as well, and as the last line of defence before you deploy that new change to the first test environment But then, which tests do you run in the different environments In this example we have 3 test environments, and they have different objectives In the internal test environment, all integrations are mocked, so our system is completely isolated. Because all the integrations are mocked, we are able to run all our API tests and our UI tests, verifying that this version works as expected and won’t cause problems when we promote it to the User Acceptance environment which is where we have real integrations In the User Acceptance environment can run the API and UI tests again, to make sure the system still works with but now with real integrations In the Production environment you probably only run a smoke test Exploratory testing In all environments Developers can do exploratory testing during/after implementation in their development environment QA/testers, or PO/BA can do it in any test environment. You can put a manual step anywhere in this automated delivery pipeline, so it is really up to you to see what fits you Some people are even doing exploratory testing in Production, using feature toggles to turn on a new feature only for internal users who do exploratory testing in Production
  19. A quick summary, to wrap up. The test automation pyramid is a useful thinking tool and discussion reference Make conscious decisions about what to test on which level, and also where you run which tests Try to distribute your tests optimally High quality High velocity Medium effort Discuss with your team Do the Testing Week task That’s it for me, do you have any questions or comments?
  20. REPEAT THE QUESTION