SlideShare a Scribd company logo
SERVERLESSI N T E S T A U T O M AT I O N
2 0 1 8 O l e k s a n d r K h o t e m s k y i h t t p : / / x o t a b u 4 . g i t h u b . i o
Independent Contractor,
Software Developer Engineer in Test
Hello!
I Am Oleksandr Khotemskyi
Contacts: xotabu4.github.io
Test automation meets serverless
What is serverless?
Serverless architecture highlights
New world order?
Evolution of software architecture principles and programming styles
What is serverless?
1
Evolution of servers: Bare Metal
Evolution of servers: Virtualization
Evolution of servers: Containers
Evolution of servers: Serverless
Oleksandr Khotemskyi  - Serverless architecture and how to apply it in Automation Testing
You will fall in love or hate forever
Serverless architecture highlights
2
In a nutshell
• Code snippets
• Deployed to cloud
• Executed in response to some event
• Scaled on demand
• Costs nothing when idle
Serverless is using servers!
Load
Balancer
Function
invocations
requests
Nodes
Controller
Your code runs
according to
your logic
You will get
execution result
in HTTP
response
Invoke. For example -
just by sending HTTP
request
Upload to your
FaaS provider
Usage flow
Wrap your code
to special
“handler”
You don’t have single point of
failure. In case errors - only one
invocation is affected
Stability
Automatically start thousands and
millions of your code copies
Instant scaling
Just zip your code and upload. No
deploying to thousands of servers
with complex update process
Low deploy complexity
You don’t need to think about
hardware. Provider will automatically
add/remove machines for you
No servers managing
You do not pay for your idle
computer
No underconsumption
No race conditions, no multithreading.
Function is small piece of code that easy
to read. Developers are focusing on
business requirements
Simple developing
Benefits
Old solutions does not work
anymore. And again - lock to
vendor
Monitoring
There might be delay in
starting fresh deployed code
Warming up
Requires new approaches in
setting up secure backend
Security
Harder to debug, since your
code runs quickly, and not
clear where exactly
Debug
All communication is done
thru network (HTTP), which
is not the fastest way
Latency
Usually migrating from one
FaaS provider to another is
hard
Vendor lock
Tricky parts
AWS Lambda PRICE
• You pay only when your code is running
• Pricing calculated for megabytes/second
• Huge memory consumption - more expensive
• Long running code - more expensive
• Services usually offer free amount (AWS - 1 million
calls)
Table 1
Memory
(MB)
Free tier
seconds per
month
Price per 100ms
($)
128 3,200,000 0.000000208
512 800,000 0.000000834
1024 400,000 0.000001667
2048 200,000 0.000003334
3008 136,170 0.000004897
Best friends forever
Test automation meets serverless
3
Tests should be independent
one from another
Serverless architecture is absolutely stateless by
its nature. As your tests also should be. Each your
test runs in separate isolated environment.
Potentially even pre/postconditions can be isolated
Tests should run as quickly
as possible
• Each your single test CPU/RAM consumption won’t affect others
because of isolation (noticeable on huge test numbers)
• You can potentially have thousands and millions of threads. Your
test execution will take time of longest running test
Tests should be stable
• Serverless allows to avoid running code locally
• Different code versions can be used
• Retrying test - is just recursive invoking function by itself
• Clean runtime environment for each test gives additional stability
• Executor issues does not affect whole test run
Tests should be executed as
often as possible
• No limits on tests execution frequency. Single execution is cheap
• With unlimited parallelization thats possible to start tests for even
smallest code changes. Or even for many changes simultaneously
• Possible to run tests for multiple environments in the same time
• Running tests while developing won’t block your execution
Bright future of test automation. But even sun has sunspots
New world order?
3
Reporting on huge scale - Report Portal
Allure
Test runners
• Existing test runners were not intended for this tricks
• Possible execution flow can be as follows
Sending link to
report as final step
Tests are running,
and reporting
results to “Report
Portal”
Multiple recursive
invoke with test
names that will be
used for GREP
Invoke function-starter
that parses all tests, and
detects tests that should
be run
API tests
Small size of project
Simple environment
Test runner should be updated
This is looks like best way to start
using serverless for tests
Quick start, fast execution
!
Should not require special config
Performance tests as a bonus
• With theoretically unlimited test
threads, we can do huge load to Site-
Under-Test
• This can be used to see application
performance issues
• Bonus - reusing UI or API tests (or
both) for performance measurements
FaaS
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test Test Test
Test Test Test
Test Test Test
Test Test Test
Test
Test
Test
Test
Test
Test
Test Test Test
UI tests
Size of project can be big
Complicated environment
Test runner should be updated
Notice that some cloud providers might have function execution
timeout! Your test cannot run longer than it
Slow start, slow execution
!
Requires separate test farm cluster OR
start Chrome Headless inside function itself
!
!
!
!
Unit tests
Size of project usually big
Simple environment
Test runner should be updated
Potentially HTTP requests latency might be bigger
than test execution itself. Grouping by bigger chunks
help
Fast start, fast execution
!
Does not require some special config
!
More to read
Functional programming: https://habr.com/post/142351/
Code with lambda-selenium usage (Java, Node): https://github.com/blackboard/lambda-selenium
Framework for building serverless applications: https://serverless.com/framework/
WebdriverIO lambda runner: https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-lambda-
runner
Old, good, wikipedia: https://en.wikipedia.org/wiki/Serverless_computing
Martin Fowler about serverless: https://martinfowler.com/articles/serverless.html
Thanks!
You can find me at: xotabu4.github.io
Any questions?

More Related Content

PDF
Selenium Israel Meetup
PPTX
Automation testing of REST endpoints in a less coded way
PDF
ELK Stack
PPTX
Performance Tuning in the Trenches
PPTX
Final presentation
PDF
Software Architecture for DevOps and Continuous Delivery
PPTX
Performance testing with 100,000 concurrent users in AWS
PPTX
Integration Testing as Validation and Monitoring
Selenium Israel Meetup
Automation testing of REST endpoints in a less coded way
ELK Stack
Performance Tuning in the Trenches
Final presentation
Software Architecture for DevOps and Continuous Delivery
Performance testing with 100,000 concurrent users in AWS
Integration Testing as Validation and Monitoring

What's hot (20)

PPTX
Load-testing 101 for Startups with Artillery.io
PDF
BlazeMeter Presents at the High Performance Drupal Meetup
PDF
Zero to Test Driven Infrastructure
PPTX
Continuous Integration as a Way of Life
PPTX
Continuous Integration on AWS
PPTX
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
PPTX
ECS19 - Ingo Gegenwarth - Running Exchange in large environment
PPTX
Manage your environment with DSC
PPTX
Continuous database deployment
PPTX
Serverless testing-serverless-sydney-20181018
PDF
Speed up your Serverless development flow
PDF
Craftsmanship Workshop: Coding Kata
PPTX
How to practice TDD without shooting yourself in the foot
PDF
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
PDF
Serverless in java Lessons learnt
PDF
MongoDB World 2018: Tutorial - MongoDB Meets Chaos Monkey
PPTX
Elm - Could this be the Future of Web Dev?
PPT
Acquia presented at MassTLC event on automated testing
PPT
Extending Continuous Integration
PPTX
Sam Guckenheimer - Moving to One Engineering System
Load-testing 101 for Startups with Artillery.io
BlazeMeter Presents at the High Performance Drupal Meetup
Zero to Test Driven Infrastructure
Continuous Integration as a Way of Life
Continuous Integration on AWS
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
ECS19 - Ingo Gegenwarth - Running Exchange in large environment
Manage your environment with DSC
Continuous database deployment
Serverless testing-serverless-sydney-20181018
Speed up your Serverless development flow
Craftsmanship Workshop: Coding Kata
How to practice TDD without shooting yourself in the foot
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
Serverless in java Lessons learnt
MongoDB World 2018: Tutorial - MongoDB Meets Chaos Monkey
Elm - Could this be the Future of Web Dev?
Acquia presented at MassTLC event on automated testing
Extending Continuous Integration
Sam Guckenheimer - Moving to One Engineering System
Ad

Similar to Oleksandr Khotemskyi - Serverless architecture and how to apply it in Automation Testing (20)

PDF
Tools. Techniques. Trouble?
PPTX
Fastest Servlets in the West
PDF
Advanced web application architecture - Talk
PDF
Ssl Accelerator Test Bench
PDF
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
PDF
AWS Observability Made Simple
PPTX
Testing for Logic App Solutions | Integration Monday
PDF
Improving Batch-Process Testing Techniques with a Domain-Specific Language
PDF
Tech Talk on Cloud Computing
PPTX
Tech trends 2018 2019
PPTX
Terratest - Automation testing of infrastructure
PPTX
Testing Below the Application
PDF
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
PPTX
What's New in .Net 4.5
PDF
Aws-What You Need to Know_Simon Elisha
PPTX
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
PDF
AWS Lambda from the Trenches
PPTX
Serverless: The future of application delivery
PPTX
Helpful Automation Techniques - Selenium Camp 2014
PPTX
How to build webapps with tools
Tools. Techniques. Trouble?
Fastest Servlets in the West
Advanced web application architecture - Talk
Ssl Accelerator Test Bench
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
AWS Observability Made Simple
Testing for Logic App Solutions | Integration Monday
Improving Batch-Process Testing Techniques with a Domain-Specific Language
Tech Talk on Cloud Computing
Tech trends 2018 2019
Terratest - Automation testing of infrastructure
Testing Below the Application
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
What's New in .Net 4.5
Aws-What You Need to Know_Simon Elisha
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
AWS Lambda from the Trenches
Serverless: The future of application delivery
Helpful Automation Techniques - Selenium Camp 2014
How to build webapps with tools
Ad

More from Web Tech Fun (10)

PDF
Yevtushenko Alex - Microservices platform: transformation of Monolith.
PDF
Taras Slipets - Full-stack, Full-run, Full-test: pain reduction in practice
PDF
Denys iaremenko - Automation for mobile applications: WHYs and HOWs.
PDF
Богдан Отводенко - Модульные сетки без хаков CSS Grid Layout
PDF
Алексей Кулаков - Современные возможности ES-2015 (Promise, Generators, Proxy)
PDF
Владимир Логвинов - Rest-Assured - легкий способ автоматизации тестирования REST
PDF
Евгений Самоненко - Практическая оптимизация сервер сайд современные реалии
PDF
Антон Немцев - Что нам стоит дом построить
PDF
Александр Бадзым - CSS Переменные — настало ваше время!
PDF
Axel Nordfeldt (Beetroot Academy) - IT as a social instrument
Yevtushenko Alex - Microservices platform: transformation of Monolith.
Taras Slipets - Full-stack, Full-run, Full-test: pain reduction in practice
Denys iaremenko - Automation for mobile applications: WHYs and HOWs.
Богдан Отводенко - Модульные сетки без хаков CSS Grid Layout
Алексей Кулаков - Современные возможности ES-2015 (Promise, Generators, Proxy)
Владимир Логвинов - Rest-Assured - легкий способ автоматизации тестирования REST
Евгений Самоненко - Практическая оптимизация сервер сайд современные реалии
Антон Немцев - Что нам стоит дом построить
Александр Бадзым - CSS Переменные — настало ваше время!
Axel Nordfeldt (Beetroot Academy) - IT as a social instrument

Recently uploaded (20)

PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPT
Project quality management in manufacturing
PDF
Digital Logic Computer Design lecture notes
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Welding lecture in detail for understanding
PPTX
Sustainable Sites - Green Building Construction
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPT
Mechanical Engineering MATERIALS Selection
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
OOP with Java - Java Introduction (Basics)
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Project quality management in manufacturing
Digital Logic Computer Design lecture notes
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Foundation to blockchain - A guide to Blockchain Tech
Welding lecture in detail for understanding
Sustainable Sites - Green Building Construction
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Lecture Notes Electrical Wiring System Components
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Mechanical Engineering MATERIALS Selection

Oleksandr Khotemskyi - Serverless architecture and how to apply it in Automation Testing

  • 1. SERVERLESSI N T E S T A U T O M AT I O N 2 0 1 8 O l e k s a n d r K h o t e m s k y i h t t p : / / x o t a b u 4 . g i t h u b . i o
  • 2. Independent Contractor, Software Developer Engineer in Test Hello! I Am Oleksandr Khotemskyi Contacts: xotabu4.github.io
  • 3. Test automation meets serverless What is serverless? Serverless architecture highlights New world order?
  • 4. Evolution of software architecture principles and programming styles What is serverless? 1
  • 6. Evolution of servers: Virtualization
  • 10. You will fall in love or hate forever Serverless architecture highlights 2
  • 11. In a nutshell • Code snippets • Deployed to cloud • Executed in response to some event • Scaled on demand • Costs nothing when idle
  • 12. Serverless is using servers! Load Balancer Function invocations requests Nodes Controller
  • 13. Your code runs according to your logic You will get execution result in HTTP response Invoke. For example - just by sending HTTP request Upload to your FaaS provider Usage flow Wrap your code to special “handler”
  • 14. You don’t have single point of failure. In case errors - only one invocation is affected Stability Automatically start thousands and millions of your code copies Instant scaling Just zip your code and upload. No deploying to thousands of servers with complex update process Low deploy complexity You don’t need to think about hardware. Provider will automatically add/remove machines for you No servers managing You do not pay for your idle computer No underconsumption No race conditions, no multithreading. Function is small piece of code that easy to read. Developers are focusing on business requirements Simple developing Benefits
  • 15. Old solutions does not work anymore. And again - lock to vendor Monitoring There might be delay in starting fresh deployed code Warming up Requires new approaches in setting up secure backend Security Harder to debug, since your code runs quickly, and not clear where exactly Debug All communication is done thru network (HTTP), which is not the fastest way Latency Usually migrating from one FaaS provider to another is hard Vendor lock Tricky parts
  • 16. AWS Lambda PRICE • You pay only when your code is running • Pricing calculated for megabytes/second • Huge memory consumption - more expensive • Long running code - more expensive • Services usually offer free amount (AWS - 1 million calls) Table 1 Memory (MB) Free tier seconds per month Price per 100ms ($) 128 3,200,000 0.000000208 512 800,000 0.000000834 1024 400,000 0.000001667 2048 200,000 0.000003334 3008 136,170 0.000004897
  • 17. Best friends forever Test automation meets serverless 3
  • 18. Tests should be independent one from another Serverless architecture is absolutely stateless by its nature. As your tests also should be. Each your test runs in separate isolated environment. Potentially even pre/postconditions can be isolated
  • 19. Tests should run as quickly as possible • Each your single test CPU/RAM consumption won’t affect others because of isolation (noticeable on huge test numbers) • You can potentially have thousands and millions of threads. Your test execution will take time of longest running test
  • 20. Tests should be stable • Serverless allows to avoid running code locally • Different code versions can be used • Retrying test - is just recursive invoking function by itself • Clean runtime environment for each test gives additional stability • Executor issues does not affect whole test run
  • 21. Tests should be executed as often as possible • No limits on tests execution frequency. Single execution is cheap • With unlimited parallelization thats possible to start tests for even smallest code changes. Or even for many changes simultaneously • Possible to run tests for multiple environments in the same time • Running tests while developing won’t block your execution
  • 22. Bright future of test automation. But even sun has sunspots New world order? 3
  • 23. Reporting on huge scale - Report Portal
  • 25. Test runners • Existing test runners were not intended for this tricks • Possible execution flow can be as follows Sending link to report as final step Tests are running, and reporting results to “Report Portal” Multiple recursive invoke with test names that will be used for GREP Invoke function-starter that parses all tests, and detects tests that should be run
  • 26. API tests Small size of project Simple environment Test runner should be updated This is looks like best way to start using serverless for tests Quick start, fast execution ! Should not require special config
  • 27. Performance tests as a bonus • With theoretically unlimited test threads, we can do huge load to Site- Under-Test • This can be used to see application performance issues • Bonus - reusing UI or API tests (or both) for performance measurements FaaS Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
  • 28. UI tests Size of project can be big Complicated environment Test runner should be updated Notice that some cloud providers might have function execution timeout! Your test cannot run longer than it Slow start, slow execution ! Requires separate test farm cluster OR start Chrome Headless inside function itself ! ! ! !
  • 29. Unit tests Size of project usually big Simple environment Test runner should be updated Potentially HTTP requests latency might be bigger than test execution itself. Grouping by bigger chunks help Fast start, fast execution ! Does not require some special config !
  • 30. More to read Functional programming: https://habr.com/post/142351/ Code with lambda-selenium usage (Java, Node): https://github.com/blackboard/lambda-selenium Framework for building serverless applications: https://serverless.com/framework/ WebdriverIO lambda runner: https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-lambda- runner Old, good, wikipedia: https://en.wikipedia.org/wiki/Serverless_computing Martin Fowler about serverless: https://martinfowler.com/articles/serverless.html
  • 31. Thanks! You can find me at: xotabu4.github.io Any questions?