SlideShare a Scribd company logo
1 of 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?

More Related Content

What's hot

Role Of Qa And Testing In Agile 1225221397167302 8
Role Of Qa And Testing In Agile 1225221397167302 8Role Of Qa And Testing In Agile 1225221397167302 8
Role Of Qa And Testing In Agile 1225221397167302 8
a34sharm
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
SivaprasanthRentala1975
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.ppt
Komal Garg
 
How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy
Impetus Technologies
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
Rathna Priya
 

What's hot (20)

Scrum Testing Methodology
Scrum Testing MethodologyScrum Testing Methodology
Scrum Testing Methodology
 
Role Of Qa And Testing In Agile 1225221397167302 8
Role Of Qa And Testing In Agile 1225221397167302 8Role Of Qa And Testing In Agile 1225221397167302 8
Role Of Qa And Testing In Agile 1225221397167302 8
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
 
Automated Test Framework with Cucumber
Automated Test Framework with CucumberAutomated Test Framework with Cucumber
Automated Test Framework with Cucumber
 
Automation testing introduction for FujiNet
Automation testing introduction for FujiNetAutomation testing introduction for FujiNet
Automation testing introduction for FujiNet
 
Agile QA presentation
Agile QA presentationAgile QA presentation
Agile QA presentation
 
End to end testing - strategies
End to end testing - strategiesEnd to end testing - strategies
End to end testing - strategies
 
Selenium Automation Framework
Selenium Automation  FrameworkSelenium Automation  Framework
Selenium Automation Framework
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
 
Agile Testing: The Role Of The Agile Tester
Agile Testing: The Role Of The Agile TesterAgile Testing: The Role Of The Agile Tester
Agile Testing: The Role Of The Agile Tester
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.ppt
 
Agile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User GroupAgile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User Group
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy
 
Testing in Agile Projects
Testing in Agile ProjectsTesting in Agile Projects
Testing in Agile Projects
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
 
QA Best Practices in Agile World_new
QA Best Practices in Agile World_newQA Best Practices in Agile World_new
QA Best Practices in Agile World_new
 
New trends in testing automation
New trends in testing automationNew trends in testing automation
New trends in testing automation
 
What is Shift Left Testing.pdf
What is Shift Left Testing.pdfWhat is Shift Left Testing.pdf
What is Shift Left Testing.pdf
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 

Viewers also liked

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.
 

Viewers also liked (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
 

Similar to 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
 

Similar to 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?
 

More from T. Alexander Lystad

More from 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
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
+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
 

Recently uploaded (20)

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
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
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...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
+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...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

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

Editor's Notes

  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