Conquering the Testing Challenges of Serverless Applications - - PDF document

conquering the testing challenges of serverless
SMART_READER_LITE
LIVE PREVIEW

Conquering the Testing Challenges of Serverless Applications - - PDF document

W2 DevOps & The Cloud Wednesday, October 2nd, 2019 11:30 AM Conquering the Testing Challenges of Serverless Applications Presented by: Peter Varhol


slide-1
SLIDE 1

W2 ¡

DevOps ¡& ¡The ¡Cloud ¡ Wednesday, ¡October ¡2nd, ¡2019 ¡11:30 ¡AM ¡

Conquering ¡the ¡Testing ¡Challenges ¡of ¡ Serverless ¡Applications ¡

Presented ¡by: ¡

Peter ¡Varhol ¡& Gerie Owen

Technology ¡Strategy ¡Research ¡

Brought ¡to ¡you ¡by: ¡ ¡

888-­‑-­‑-­‑268-­‑-­‑-­‑8770 ¡·√·√ ¡904-­‑-­‑-­‑278-­‑-­‑-­‑0524 ¡-­‑ ¡info@techwell.com ¡-­‑ ¡http://www.starwest.techwell.com/ ¡

slide-2
SLIDE 2

Peter Varhol

Peter ¡Varhol ¡is ¡a ¡software ¡strategist ¡and ¡evangelist ¡who ¡closely ¡observes ¡the ¡testing ¡ industry ¡and ¡uses ¡his ¡knowledge ¡and ¡experience ¡to ¡identify ¡new ¡technologies ¡and ¡ help ¡companies ¡respond ¡to ¡those ¡trends. ¡His ¡diverse ¡technical ¡background ¡enables ¡ him ¡to ¡seamlessly ¡integrate ¡new ¡technologies ¡into ¡his ¡practices ¡and ¡provides ¡him ¡ with ¡a ¡unique ¡vision ¡of ¡how ¡to ¡adapt ¡and ¡succeed. ¡His ¡areas ¡of ¡research ¡and ¡practice ¡ include ¡team ¡communication, ¡machine ¡learning, ¡DevOps, ¡testing ¡and ¡test ¡ automation, ¡and ¡development ¡tools. ¡His ¡efforts ¡aim ¡to ¡use ¡the ¡latest ¡and ¡best ¡ technologies ¡to ¡address ¡real-­‑world ¡problems. ¡Peter ¡speaks ¡frequently ¡at ¡ conferences, ¡local ¡meetups, ¡and ¡webinars ¡on ¡software ¡development, ¡testing, ¡ machine ¡learning, ¡and ¡DevOps ¡topics. ¡Peter ¡blogs ¡at ¡Cutting ¡Edge ¡Computing, ¡and ¡ can ¡be ¡found ¡on ¡Twitter. ¡He ¡has ¡master's ¡degrees ¡in ¡computer ¡science, ¡applied ¡ mathematics, ¡and ¡psychology, ¡along ¡with ¡doctoral ¡work ¡in ¡information ¡systems. ¡

Gerie Owen

Gerie Owen is Testing Strategist and Evangelist at Technology Strategy Research. She is a Certified Scrum Master, Conference Presenter and Author on technology and testing topics. She enjoys mentoring new QA Leads and brings a cohesive team approach to testing. Gerie is the author of many articles on technology including Agile and DevOps topics. She recently developed a curriculum for DevOps 101

  • training. Gerie chooses her presentation topics based on her experiences in

technology, what she has learned from them and what she would like to do to improve them. Gerie can be reached through her website, her blog, Testing in the Trenches, @GerieOwen on Twitter, and on LinkedIn.

slide-3
SLIDE 3

Tes$ng ¡Serverless ¡ Applica$ons

¡ Peter ¡Varhol ¡and ¡Gerie ¡Owen ¡

slide-4
SLIDE 4

About ¡me

  • Interna$onal ¡speaker ¡and ¡writer
  • Graduate ¡degrees ¡in ¡Math, ¡CS, ¡Psychology
  • Technology ¡communicator
  • Former ¡university ¡professor, ¡tech ¡journalist
  • Cat ¡owner ¡and ¡distance ¡runner
  • peter@petervarhol.com
slide-5
SLIDE 5

Gerie Owen

3 ¡

¡

  • QA ¡Evangelist, ¡test ¡manager
  • Subject ¡maIer ¡expert ¡on ¡tes$ng ¡for ¡

TechTarget’s ¡SearchSoLwareQuality.com

  • Interna$onal ¡and ¡domes$c ¡conference ¡

presenter

  • Marathon ¡runner ¡& ¡running ¡coach

¡ ¡ gowen@qualitestgroup.com ¡

slide-6
SLIDE 6

Agenda

  • What ¡the ¡heck ¡is ¡serverless? ¡
  • Why ¡serverless ¡means ¡DevOps ¡
  • What ¡do ¡we ¡test? ¡
  • ShiB ¡leB ¡and ¡shiB ¡right ¡
  • TesDng ¡strategies ¡for ¡a ¡new ¡architecture ¡
  • Summary ¡
slide-7
SLIDE 7

What ¡the ¡Heck ¡is ¡Serverless?

  • A ¡cloud-­‑compuDng ¡execuDon ¡model ¡
  • You ¡supply ¡the ¡code ¡
  • Generally ¡back-­‑end ¡processing ¡
  • Prompted ¡by ¡an ¡event ¡from ¡the ¡UI ¡or ¡other ¡funcDon ¡
  • The ¡runDme ¡manages ¡resources ¡
  • OBen ¡event-­‑driven ¡
  • It ¡doesn’t ¡have ¡to ¡be ¡a ¡full ¡applicaDon ¡
slide-8
SLIDE 8

What ¡the ¡Heck ¡is ¡Serverless?

  • “Serverless” ¡is ¡a ¡misnomer ¡
  • You ¡actually ¡do ¡use ¡servers ¡
  • You ¡just ¡don’t ¡provision ¡servers ¡and ¡manage ¡infrastructure ¡
  • Other ¡names ¡are ¡more ¡appropriate ¡
  • FuncDon ¡as ¡a ¡Service ¡(FaaS) ¡is ¡one ¡name ¡
  • Event-­‑driven ¡compuDng ¡is ¡beUer ¡
  • What ¡do ¡we ¡mean ¡by ¡runDme? ¡
  • JVM ¡and ¡.NET ¡CLR ¡are ¡runDmes ¡
  • But ¡serverless ¡runDmes ¡do ¡much ¡less ¡
slide-9
SLIDE 9

About ¡Those ¡Run$mes

  • Most ¡serverless ¡vendors ¡offer ¡compute ¡runDmes ¡
  • ¡Execute ¡applicaDon ¡logic ¡but ¡do ¡not ¡store ¡data ¡
  • Examples ¡of ¡runDmes ¡
  • Amazon ¡Lambda ¡
  • IBM ¡OpenWhisk ¡
  • Azure ¡FuncDons ¡
  • RunDmes ¡only ¡execute ¡when ¡an ¡event ¡occurs ¡
  • Only ¡charged ¡when ¡the ¡runDme ¡is ¡execuDng ¡
slide-10
SLIDE 10

Language ¡Support ¡Depends ¡on ¡Run$me

  • AWS ¡Lambda ¡
  • AWS ¡Lambda ¡naDvely ¡supports ¡Java, ¡Go, ¡PowerShell, ¡Node.js, ¡C#, ¡Python, ¡and ¡

Ruby ¡code ¡

  • Provides ¡a ¡RunDme ¡API ¡which ¡allows ¡you ¡to ¡use ¡any ¡addiDonal ¡programming ¡

languages ¡to ¡author ¡your ¡funcDons. ¡

  • Azure ¡FuncDons ¡
  • C#, ¡JavaScript, ¡F#, ¡Java ¡supported ¡
  • Bash, ¡PowerShell, ¡Python, ¡PHP ¡experimental ¡
slide-11
SLIDE 11
slide-12
SLIDE 12

Why ¡Serverless ¡Means ¡DevOps

  • Cloud-­‑only ¡
  • On-­‑prem ¡may ¡be ¡possible ¡depending ¡on ¡the ¡runDme ¡
  • But ¡it ¡may ¡not ¡make ¡technical ¡sense ¡
  • ContainerizaDon ¡and ¡workflow ¡
  • FuncDons ¡and ¡runDme ¡can ¡be ¡encapsulated ¡into ¡Docker ¡containers ¡
  • Microservices ¡
  • Sizing ¡funcDons ¡can ¡be ¡a ¡challenge ¡
  • Cost ¡versus ¡service ¡definiDon ¡
slide-13
SLIDE 13

What ¡is ¡Different?

  • You ¡only ¡pay ¡when ¡your ¡code ¡is ¡execuDng ¡
  • There ¡is ¡an ¡economic ¡model ¡with ¡serverless ¡
  • Serverless ¡is ¡rarely ¡a ¡complete ¡applicaDon ¡
  • Back-­‑end ¡only ¡
  • No ¡UI, ¡no ¡database ¡
  • Serverless ¡is ¡stateless ¡
  • No ¡state ¡to ¡reset ¡between ¡tests ¡
  • Test ¡data ¡confined ¡to ¡sample ¡transacDons ¡
  • Workflow ¡means ¡all ¡data ¡is ¡elsewhere ¡
slide-14
SLIDE 14

Run$mes ¡Can ¡Execute ¡at ¡the ¡Edge

  • Limited-­‑purpose ¡runDmes ¡can ¡execute ¡small ¡amounts ¡of ¡code ¡on ¡IoT ¡

devices ¡

  • Real ¡Dme ¡compuDng ¡may ¡be ¡possible ¡
  • Data ¡collected ¡at ¡the ¡edge ¡
  • Then ¡sent ¡to ¡a ¡central ¡store ¡
  • Good ¡for ¡distributed ¡data ¡systems ¡(DDS) ¡
slide-15
SLIDE 15

Tes$ng ¡Strategies ¡for ¡Serverless ¡Applica$ons

  • Understand ¡the ¡relaDonship ¡between ¡the ¡code ¡and ¡the ¡runDme ¡
  • More ¡on ¡the ¡runDme ¡
  • ShiB ¡leB ¡
  • IntegraDon ¡tesDng ¡
  • ConDnuous ¡tesDng ¡
  • Performance ¡and ¡load ¡tesDng ¡
  • Security ¡tesDng ¡
slide-16
SLIDE 16

Understand ¡the ¡Rela$onship ¡Between ¡the ¡ Code ¡and ¡the ¡Run$me

  • The ¡cloud ¡vendor ¡provisions ¡the ¡servers ¡and ¡provides ¡the ¡runDme ¡
  • The ¡OS ¡doesn’t ¡maUer ¡
  • The ¡cloud ¡vendor ¡provides ¡security ¡up ¡to ¡the ¡runDme ¡
  • The ¡code ¡is ¡all ¡yours ¡
  • The ¡runDme ¡kicks ¡off ¡your ¡code ¡
  • And ¡does ¡nothing ¡else ¡
slide-17
SLIDE 17

Run$me ¡Implica$ons ¡to ¡Tes$ng

  • Only ¡code ¡needs ¡to ¡be ¡tested ¡
  • No ¡interacDons ¡with ¡runDme ¡
  • Everything ¡else ¡is ¡standard ¡
  • No ¡calls ¡into ¡runDme ¡or ¡OS ¡
  • Does ¡the ¡funcDon ¡work ¡with ¡other ¡funcDons? ¡
  • And ¡database, ¡UI ¡
slide-18
SLIDE 18

ShiL ¡LeL

  • Planning ¡and ¡design ¡
  • Understand ¡the ¡applicaDon ¡architecture ¡
  • Make ¡suggesDons ¡on ¡testability ¡
  • Unit ¡tesDng ¡
  • Depending ¡on ¡the ¡funcDon, ¡it ¡may ¡also ¡be ¡a ¡single ¡unit ¡
  • Map ¡out ¡integraDon ¡points ¡
slide-19
SLIDE 19

Integra$on ¡Tes$ng

  • All ¡funcDons ¡intended ¡to ¡execute ¡under ¡serverless ¡
  • All ¡services ¡used ¡by ¡the ¡serverless ¡funcDons ¡
  • Database, ¡UI, ¡Web ¡services ¡
  • Test ¡API ¡operaDon ¡
  • Send ¡and ¡receive ¡data ¡through ¡funcDon ¡APIs ¡
  • Compare ¡inputs ¡and ¡outputs ¡for ¡accuracy ¡
  • Full ¡system ¡test ¡with ¡simulated ¡workflows ¡
slide-20
SLIDE 20

Invoke ¡Run$me

  • Locally ¡
  • Prepare ¡sample ¡events ¡
  • Invoke ¡the ¡runDme ¡with ¡the ¡events ¡
  • Observe ¡outputs ¡
  • Invoking ¡the ¡runDme ¡
  • Run ¡the ¡funcDon ¡inside ¡a ¡custom ¡wrapper. ¡
  • Invoke ¡funcDons ¡locally ¡using ¡tools ¡
  • Serverless ¡framework ¡or ¡AWS ¡SAM ¡local ¡
  • Use ¡docker-­‑lambda ¡to ¡simulate ¡an ¡AWS ¡Lambda ¡environment ¡
  • Use ¡local-­‑stack ¡to ¡simulate ¡AWS ¡services ¡locally. ¡
slide-21
SLIDE 21

Invoke ¡Run$me

  • Local ¡invocaDon ¡doesn’t ¡replicate ¡the ¡producDon ¡environment ¡
  • In ¡the ¡cloud ¡
  • upload ¡funcDon ¡
  • Prepare ¡sample ¡events ¡
  • Invoke ¡the ¡runDme ¡with ¡the ¡events ¡
  • Observe ¡outputs ¡
slide-22
SLIDE 22

Con$nuous ¡Tes$ng ¡and ¡Serverless

An ¡approach ¡to ¡managing ¡risk ¡by ¡focusing ¡on ¡not ¡only ¡on ¡improving ¡ tesDng ¡efficiency ¡but ¡more ¡importantly, ¡increasing ¡the ¡effecDveness ¡of ¡

  • ur ¡test ¡processes. ¡Assessing ¡and ¡miDgaDng ¡business ¡risk ¡is ¡the ¡primary ¡
  • goal. ¡

A ¡focus ¡on ¡Quality ¡at ¡every ¡stage ¡of ¡the ¡ConDnuous ¡Delivery ¡process. ¡ ¡

slide-23
SLIDE 23

Con$nuous ¡Tes$ng ¡vs. ¡Test ¡Automa$on

ConDnuous ¡tesDng ¡requires ¡automaDon, ¡however, ¡it ¡encompasses ¡ much ¡more. ¡ ¡

slide-24
SLIDE 24

Why ¡Serverless ¡Needs ¡Con$nuous ¡Tes$ng

  • OrchestraDon ¡between ¡serverless ¡components ¡can ¡be ¡complex ¡
  • Are ¡they ¡calling ¡each ¡other? ¡
  • InteracDon ¡between ¡components ¡and ¡external ¡services ¡can ¡change ¡
  • Different ¡locaDons ¡
  • Expanded ¡calls ¡
  • Cloud ¡deployment ¡encourages ¡conDnuous ¡tesDng ¡
slide-25
SLIDE 25

Performance ¡and ¡Load

  • Each ¡funcDon ¡requires ¡separate ¡tesDng ¡
  • Average ¡Dme ¡to ¡execute ¡
  • Ability ¡to ¡execute ¡under ¡increased ¡load ¡
  • System ¡performance ¡and ¡load ¡tesDng ¡
  • Cloud ¡vendors ¡offer ¡performance ¡and ¡load ¡tools ¡
  • For ¡local ¡tesDng, ¡use ¡JMeter ¡or ¡commercial ¡product ¡
slide-26
SLIDE 26

Security

  • Each ¡funcDon ¡is ¡an ¡entry ¡point ¡to ¡the ¡applicaDon ¡
  • And ¡must ¡be ¡tested ¡for ¡security ¡
  • But ¡the ¡cloud ¡vendor ¡provides ¡security ¡through ¡the ¡runDme ¡
  • Your ¡applicaDon ¡likely ¡consists ¡of ¡mulDple ¡serverless ¡components ¡
  • Making ¡security ¡tesDng ¡a ¡complex ¡endeavor ¡
slide-27
SLIDE 27

ShiL ¡Right

  • Monitoring ¡
  • ApplicaDon ¡performance ¡and ¡availability ¡
  • SyntheDc ¡tests ¡
  • Workflow/features/performance ¡
  • Health ¡analyDcs ¡
  • Trend ¡analysis ¡
slide-28
SLIDE 28

Tes$ng ¡is ¡Easier ¡. ¡. ¡.

  • No ¡tesDng ¡on ¡different ¡OS ¡configuraDons ¡or ¡browsers ¡
  • Most ¡serverless ¡funcDons ¡are ¡relaDvely ¡simple ¡
  • Usually ¡a ¡single ¡feature ¡of ¡back-­‑end ¡processing ¡
  • Really ¡only ¡tesDng ¡APIs ¡and ¡workflow ¡
slide-29
SLIDE 29

And ¡Harder ¡. ¡. ¡.

  • It ¡depends ¡on ¡the ¡applicaDon ¡architecture ¡
  • Programmers ¡aren’t ¡familiar ¡with ¡event-­‑driven ¡systems ¡
  • Many ¡components ¡make ¡interacDons ¡difficult ¡to ¡test ¡
  • This ¡is ¡MVC, ¡but ¡on ¡steroids ¡
slide-30
SLIDE 30

Summary

  • Serverless ¡brings ¡a ¡wrinkle ¡to ¡cloud ¡compuDng ¡
  • TesDng ¡needs ¡to ¡adapt ¡to ¡serverless ¡realiDes ¡
  • TesDng ¡occurs ¡throughout ¡the ¡lifecycle ¡
  • TesDng ¡includes ¡monitoring ¡in ¡producDon ¡
  • TesDng ¡is ¡just ¡the ¡code ¡
  • Our ¡skills ¡sDll ¡apply, ¡as ¡long ¡as ¡we ¡know ¡the ¡differences ¡
slide-31
SLIDE 31

Ques$ons?