+ All Categories
Home > Documents > Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a...

Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a...

Date post: 14-Jul-2020
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
36
Test Driving an Organisation Paul O’Keeffe Shaun Loh
Transcript
Page 1: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Test Driving an Organisation

Paul O’Keeffe

Shaun Loh

Page 2: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

We Have a Problem • Coreapplications• Businessideasslowtogettomarket

• Manualtestingtimesdominatedthereleasecycle

• Longtailtestcyclesdelayingrelease

• Defectdetectionlateintheprocess

• Somedefectsgettingtoproduction

• Multipleindependenttestteamssharinglittle

• Lackoftrustintestsduetoinconsistentcoverageandexecution

Page 3: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Quality / Speed Delivery • Qualityinitiative• Morphedinto“SpeedDelivery”

• Cycletimeisperhapsthemostimportantmetricinsoftwaredevelopment

• Reducethetimebetweenchangerequestandproductiondelivery

Page 4: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect
Page 5: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

GUI Test Automation • Webapplications

• Desktopapplication

• Tightcouplingbetweenapplications• Initiallybuildasafetynet

• Thenbuildoutapplicationcoverage

• BusinesslogicintheGUIswasrifesowecouldn’tsensiblytestattheAPIlevelorevenattheHTTPlevel

Page 6: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

What Test Pyramid? • Thetestpyramidminusthebaseandmiddle;◦  andthetop

• Webuildthetop,becausethebaseandmiddlecouldn’tbe

• Codewasnotdesignedtobetestable◦  Frameworks!

• Swisscheesepyramid

• Normally,buildingafewhappydaysscenariosatthetopofthepyramidistherightapproach,butwithoutagoodbaseormiddle,fragilityisworse

• Somanythingswouldbreaktests•  Who/whattoblame?

Page 7: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

What Could Possibly Go Wrong? • Infrastructure• Environment

• Data• Applications

• Everything…

• StabilisingaGUItestautomationsuiteisincrediblyhardwork

Page 8: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Infrastructure • Cloud(AWS)

• Butproductionstillonpremise,sodifferent

• Longlivedsnowflakes• Provisioningwasgraduallybeingautomated

• Bothfortestingandapplicationinfrastructure

Page 9: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Controllable Environment • Naildownenvironmentonbuildagentsprecisely

• Spreadoutintonailingdowneverythingexternalwhichischangingand/orcouldcauseproblems•  Hardwarespecs•  Manualtesterssharingenvironments•  Batchjobs•  Softwareupdates

• Limitedduetoownershipbyotherteams•  Separationofacceptancetestingfromdevelopmentteams

Page 10: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Data • Don’trelyonacopyofproductiondata•  Becauseyoucan’trelyonit

• Alwaysgeneratethedatayouneedforatest• Productiondataandbatchjobstakingtoolongtoruninunderspecifiedenvironments

Page 11: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Test Isolation • Creatinganewmemberforeachtest

• Naturalisolation•  Datawascompletelyscopedbymember

• Ensureseachtestiscompletelyisolatedfromanyother

Page 12: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Applications (with Real Users) • Usersareapologistsforpoorapplicationbehavior•  Robotsaren’t

• Realusersseemedtohavebeentrainedtohaveahightoleranceforslowapplicationresponses

• Synchronousbusinessprocessesbuiltontopofasynchronoussystems

• Usersjustrefreshuntilthingshavefinished• Realusersworkedaroundapplicationerrorsliketheevery10thindexproblem

• Doesn’tmaketestautomationanyeasier,though

Page 13: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Application Driver Layer • Applicationmodels

• Pagemodels

• Growthisasyouneeditforthetestsyou’vewritten• Don’tputahardcaponittoosoon◦  Cucumber/Gherkin◦  Commercialtools◦  Otheropensourcetools(whoshallremainnameless)

• Domain,notUI

Page 14: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Application Driver Layer • Mosttoolsputahardcaponapplicationmodelling,usuallyatthepagelevel

• Needmoreflexibility.Noteverythingisshapedlikeacucumber

• Renewalsmodelisagoodexample

• Coderetainstheflexibility,sinceithasthenecessarymechanismsforabstraction

• Askyourselfwhetheryourtoolcancompetewithcodeonthisfront?

Page 15: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Page Models • Disappointinglackoffreetoolstodobasicpagemodellingascode

• LearnedalotabouthowtodogoodpagemodellinginJavaandC#

• SomeadvancesonthecurrentlyacceptedstateoftheartIMHO

• DesignofpagemodelDSLpreventedrun-timeerrorsandenabledautocompletion

• Projectcomingsoonwithsomeofourdesigns

• DSLsforAPIsandGUIs.Sometimesthesameonesowecouldswitchthetwoeasily

Page 16: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Asynchronous Behaviour • Nofixeddelays(sleeps!)• Pollingloops

• Events

Page 17: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Weapon of Mass Destruction

Page 18: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Effect on Systems Under Test • Weaponofmassdestruction

• Unexpectedloads/greaterscale•  Runningourtestscausedahigherloadthanproduction•  Duetohaving30buildagentsallrunningtestsfasterthannormalusers

• Buttestenvironmentsaremuchscaleddownversionsofproductiontocutcosts

• Singleserverratherthanclusters(multicastproblem)

• Datasizes?•  Insignificantcomparedtoproduction•  Butgrowthovertimewithoutresetcausedissues

Page 19: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Impact • Manualtestingisusuallyprettylowimpact

• Automatedtestingishighimpact

• ContinuousIntegrationisevenmoreimpact

• Existingsystemsmayonlybedesignedtohandlemanualtests

• Testingperformance/scaledemandsmaybehigherthanproduction!!!•  Especiallyifyouwantfastdevelopmentcycles

• Forcerestoftheorganisationtochange/improve

Page 20: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Test Execution • NeedatoolwiththerightgranularityforGUItestautomation.

• Runeachtestandcollectresultswouldbeaboutright.

• CIservertocoarse.Runalltestsinonebuild.• Testgridtoofine.RuneachUIactionremotelyfromacentralcontroller.

• BrokethingsupbyhavingabuildpertestonCIserver,butnotwellsupported.

Page 21: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Continuous Integration Server • Asopposedtothepracticeofcontinuousintegration• Supportforlongrunningacceptancetests

• Scalabilityofconfiguration• Newgeneration:pipelineascode(oratleastbetterconfiguration)◦  GUIshamperthis

Page 22: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

MSHTA • TheUncannyValleyofwebapplications• MSHTAapplicationsareapaintotest

• Nearlyawebappbutnotquitesoyouneedspecialtools• Frameworkdidn’tallowapplicationtoberuninabrowserjustfortesting

• WouldbegoodtohaveafreetoolwhichcoulddothisaswellasSeleniumdoesforweb

• MSHTAhavesomedifferences•  Oftenmoredialogwindowwizards•  Lockeddownbrowser•  Fewercontrols

• Testautomationforcesorganisationawayfromthisstyleofapplication

Page 23: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Recording Evidence • Videorecording>• Sequenceofscreenshots>

• Finalscreenshot>• Logsonly>

• Nothing

• Someproblemsarehardtoreproducejustbyrunningthetestagain

• Observability

• Convincingevidenceforotherswithintheorganization• Otherbenefits

Page 24: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Licensing • Permachinelicensingschemesarepainfulfordesktoptestdevelopment,butmoresoforagridofbuildagentsinthecloud

• Donotbuytoolswithlicenceswhichdiscouragethenumberofpotentialenvironments

• Sitelicencesarefine

Page 25: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Results • Shortenedreleasecyclesbymanyweeks

• Increasedconfidencetoperformreleases,wheretheymightnototherwisehavebeenattempted

• Butotherchangesareslow

Page 26: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

New State

Page 27: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Test Driving the Organisation • TDDawholeorganisation•  Conway'sLaw,sortof•  Canmakemovesandreorganisemoreeasilywiththesafetynet

• Removalofredundantdelivery/testingphases

• Smallenvironments

• Fastercycletimes•  Eachchangemakesthisalmostmorepossible•  Loweroverhead•  Costsaving•  Earliertesting•  ShiftLeft

Page 28: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Opportunity: Data Load • Builttoolsformanualtesterstosetupdataforexploratorytesting

• Alsoforothermanualtestswehadn’tyetautomated

• Removeddependenceonproductiondataandfindingappropriateexamples

• Wherepossible,usedAPIsfordataloadinourtestsetup

• Chickenandegg•  Nolongeranyneedforproductiondata,sowechangedtheorganisationinawaywhichsolvedourownproblemandseveralothers

• LearningandDevelopment(trainingdata)

• PusheddevelopmentteamstoopenupAPIs

Page 29: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Automate (Almost) Everything • AnalysistoolslikeDashyandHelpy.• Don’tjustautomateyourtests,automateyouranalysisandanythingelserepetitiveyouhavetodo.

Page 30: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Test Execution • Runyourtestsallthetime?•  Tradeoffs

• Atleastwhenanythingchanges,whichinourcasewasprettymuchallthetime

Page 31: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Deployment and Other Automation • Startedpushingthingstowardsautomateddeployments

• Wewouldhelpoutwiththis,sincewehadautomationskills

• Softwaredevelopmentskillsofteamflowedoverintosmallproductdevelopment

• RobotProcessAutomation(RPA)

Page 32: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Think Different • Developerviewoftestautomation

• Fresheyes

• Embracecode

• Improvedqualityoftestcode

• Bringtestinganddevelopmentclosertogether

Page 33: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Way of Working • Agile,butonlywithinoursmallpartoftheSDLC

• Collaborative

• Pairingondemand◦  Moarpairing!!!◦  Particularlywhereincreaseskillsorshareknowledge,wheretheyareunevenlydistributedwithintheteam

• Honestretrospectives• Continuousimprovementactionsactuallyactedupon

• Attemptedtoinfluenceotherteams

• Asfaraswecouldgowithintheconstraintsoftheorganization

Page 34: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Invest in your People • Super-interns• Andotherswithcomplementaryskillsfromelsewhereintheorganisation• Limitedbudget• Negotiatedtogetreallygoodinternsandthentrainthemwell

• Peopledon'tneedtobeanexactmatchforrequiredskills• Someprogrammingabilityiswelcome,butnoneedforlots• CancomefromotherITbackground•  Goodtohavealternativeperspectives(e.g.support)

• Needtobekeentolearn• Cangetfantasticleverageatlowcost.Wedid.

Page 35: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Invest in your People • Axesoflearning/growth•  Maturesoftwaredevelopment•  Automatedtesting•  Enterprisetraining/constraints

• Highlycollaborativeenvironment/team•  Workwithotherswithdevelopment/testing/domain/applicationexperience•  Balanceofperhaps50%ofteamalreadyexperienced

Page 36: Test Driving an Organisation - ANZTB Driving an Organisation v2_0.pdf · Test Execution • Need a tool with the right granularity for GUI test automation. • Run each test and collect

Invest in Your People • Freedomtofailandlearn•  Psychologicalsafety•  Givespeopleconfidencetotrynewthingsearlier

• Handsonimmediately

• Internsbecamethementors

• Growexistingpeoplefromtheorganisation•  Graftthemontoanewplanttoreignitetheirmotivationandgrownewskills

• Chocolate


Recommended