EMOS Framework Article.docx
《EMOS Framework Article.docx》由会员分享,可在线阅读,更多相关《EMOS Framework Article.docx(18页珍藏版)》请在冰豆网上搜索。
![EMOS Framework Article.docx](https://file1.bdocx.com/fileroot1/2023-2/4/ff4b9cfd-ee11-4d90-b10d-9b8a5c8b11d5/ff4b9cfd-ee11-4d90-b10d-9b8a5c8b11d51.gif)
EMOSFrameworkArticle
EMOSFramework:
FunctionalTestingBasedonGUI-Modelling
DeanRajovic
EMOSComputerConsultingGmbH
Oskar-Messter-Str.25
85737IsmaningbyMunich
Germany
ABSTRACT
InthispaperwediscusstheroleofGUI-modellingintheareaoffunctionaltestingandpresentaframeworkforthedevelopmentandexecutionofautomatedfunctionaltestsbasedonsuchmodelling.Themainissuesaddressedbytheframeworkare:
rapidtestdevelopment,intensiveinvolvementofnon-technicalpersonnelintestautomationandmaintainabilityofthetestenvironmentthatscaleswellforlargesystems.
ThemainfeaturesofourapproachtoGUI-modellingarereducingGUIoperationstotheirSET(enter)andCHK(verify)alternativesandcapturingthenavigationasanintrinsicpartofthetestdescription.Throughasimplelinkageconcept,anextremelyhighlevelofreusabilityoftestdataandtestcodeisachieved.
ThetechnicalimplementationisrealisedwiththepopulartesttoolWinRunner®fromMercuryInteractiveandisavailableundertheLesserGeneralPublicLicence(LGPL).Theconceptisapplicabletopracticallyanyapplicationdesignedforintensivedatamaintenancevia"standard"GUIobjects.Ithasbeensuccessfullyappliedtoseveralhighlycomplextestautomationendeavoursinbrancheslikeinsurance,bankingandtelecommunications.
KEYWORDS:
testing,testautomation,functionaltesting,testframework,WinRunner
1
INTRODUCTION
Therearemanychallengesintestingcomplexsystems.Automatingtestsinsuchenvironmentsreducessomeofthembutintroducesadditionalones.Testswhicharesuitableformanualtestingarenotnecessarilysuitablefortestautomation(providedtheyhavebeenspecified/writtenatall).Thesheeramountofpossibletestcasescanscareeventhemostexperiencedtestmanager/specialist.Especiallywhensuchtestsaretobecarriedoutwithhopelesslyunderstaffedtestteamsandwithinridiculoustimeframes...[5]Organisingnumeroustestartefactsintoamaintainablecomplexthatsurviveslongenoughtoproveitsusefulnessisaverychallengingtask[3,4,6,7,8].
Themostcommonapproachtofunctionaltestingisbyexercisingtheapplicationthroughitsuserinterface.AutomationoffunctionaltestssimplycannotignoretheGUI-orientedtesttoolsfromvendorssuchasMercuryInteractive,Rational,Segue,Compuware,etc.Althoughthesetoolsarecapableofimplementingverycomplexapproaches,advancedusersseemtobeleftalonetodiscovertheadvancedtechniquesontheirown.
ItdoesnottakemuchbrowsingthroughtheliteratureorintheInternettodiscoverthatmanypeoplefoundtheirownsolutions[1,2,3,8].Thesesolutionsalwaysseemtofollowthesamepath:
fromcapture/replay(record/playback)viascriptinganddata-driventestingtotestframeworks.Duetothelackoffirmtheoreticfundamentsthatcouldguaranteetheiruniversalapplicability(whichisprobablythereasonnoneoftheleadingtoolvendorsoffersuchframeworks),theseframeworkspairtheirowntestingmethodologywiththetechnicalsupportforit.Nevertheless,theyalltrytosolvethesameproblem:
makethetestautomationmoreeffectiveandmoreefficient.
Whenitcomestotestingviatheapplication'suserinterface,theseframeworksappeartousethesameapproach:
eachmodelsthetestdesigninitsownwayandprovidesaninterfacetoone(ormore)standardGUI-centredtesttoolthatexecutesthetests.ThemostinfluentialtestframeworksofarisprobablytheCMG'sTestFrame®[1].Thisisthepowerfulframeworkbasedonakeyword-drivenseparation(intheirterminology:
"actionwords")betweenthetestdata("testclusters")andthetestscripts.Themostimportantcommonpropertyofalmostalloftheapproachesatthismaturitylevelistheseparationofthetestdatafromthetestscripts.Themoreadvancedtheseparation,themoreadvancedtheconcept(e.g.simpledata-drivenversuskeyword-drivenapproach).
2THE“BUSINESSCASESYNDROME”
Advancedconceptsattempttoexpressthetestcasesintermsofbusinessprocesses:
thehigh-levelabstractionsthathidetheiractualimplementationasmuchaspossible.Thepromisedbenefitsofsuch"businessmodelling"includetheindependenceoftheparticularuserinterface,increasedcomprehensiontonon-programmersandimprovedrequirements/designcoverage.
Howevertheseparationofscriptsanddatahasitscosts.Thecloserwegettothe"businesslanguage",thebiggerthegaptotheactualtestimplementation.Underthepremisethatweattempttoignoretheparticularuserinterface,itbecomesincreasinglymoredifficulttofindreusablecodepatternsthatrelatetosuch"businesslanguage".Suchpatternshoweverarefundamentaltobridgingthegapbetweenbusinessmodelsandtheirimplementation.
Businessprocessesarerarelysimple.Theproblemisoften"solved"bychunkingbigtransactionsintosmallerpartsand/orbyreducingtheinformationthathasactuallybeentested.Weoftenseefunctionslikeenter_xxx(...),delete_xxx(...)andmodify_xxx(...)accompaniedwiththeclaimtheytestthegivenbusinessprocesses.Thequestionsiswhethertheyreallydo.
Thetestcodemustbeflexible.Amongotherthingsitshouldbeabletoenterandcheckvalidsituations,provokeerrors,takealternative,unusualorillegalpathsthroughtheapplication,handledynamic(context-sensitive)partsoftheapplicationandcheckthereactionoftheapplicationatmanydifferentplaces.Thepurposeofthiscodeistesting.Itshouldserveasa"playground"forimplementingtestideas.Itshouldbeabletomirrorthebehaviouroftherealhuman(anddestructive)testerasmuchaspossible.Thiscannotbeachievedwithacodeinwhichmanydecisionsarehardcoded.Whenanalternative"route"isneededorwhenthingsgetchanged(astheyinevitablydowithtesting)onemustmakeadaptationssomewheretogetthecodeworking.Questionsthatariseare:
∙Wheretoadapt?
∙Whocanadaptit?
∙Howmuchdoesitcost(time/money)toadapt?
Atestautomationexpert(testprogrammer,toolspecialist)ispermanentlyforcedtomakedecisionsaboutwhatinformationtomakepublic(i.e.makeita"businesscase")andwhatinformationto"bury"intothetestscripts.Thetradeoffisthattheinformationwhichismadepubliccan(usually)bechangedbynon-programmers(domainexperts,endusers,testers)whereasthe"buried"informationrequiresprogrammingexpertisetochange.Simplechangesintheapplication'suserinterfacecaneasilyaffectplenty(hundreds)oftestcasesiftheinformationisexposedoronlyafewlinesofcodeiftheinformationishidden.Obviously,acarefulbalancemustbefound.However,itisagamble!
Moreoftenthanwewouldlike,changesaffectbothexposedorhiddeninformationregardlessofour"clever"balancing.Thosewhoknowthetricksoftestautomationwillappeartobe"luckier"thantheothers.
Themainbenefitoftestframeworksisinprovidingguidelinesforthosewhousethem(testdesigners,testprogrammers,endusers,systemdesigners,etc.).Agoodtestframeworkprovidesgoodanswerstomanydifficultquestions.Theareathatstillrequiresplentyofresearchisinfindinganeffectivewayofexpressing(orevengenerating)testcasesthataresufficientlylegibleforhumansaswellasmachines.
3GUIHASITALL
Inourapproach,weconsciouslydigressfromthecommonlyacceptedpracticeofexpressingtestcasesinawaywhichis"independent"oftheparticularuserinterface.Tothecontrary,weconcentrateontheapplication'sinterfaceforthefollowingreasons:
∙itistheaspectthatnoneofthefunctionaltestautomationapproachescanignore,
∙itistheonlycommonplatformfordiscussionssuitabletoallparties,
∙itistheprimaryareaofinteresttomostexpertusersandtestmanagers,and
∙itisindeedsuitableforexpressing(functional)testcases.
Ourexperiencehasshownthatbymodellingtheuserinterfaceweareabletoexpressthe"businesscases"whilepreservingmostoftheotherbenefitsof"businessmodelling"(separationoftestsandscripts,increasedcomprehensiontonon-programmers,maintainability,scalability)andprovidefortheextremelyrapidandrobusttestautomation.Theapproachisparticularlywell-suitedforapplicationswithcomplexuserinterfacefocusedondatamaintenance.Thiscoversaverybroadrangeofbusinessapplicationsinpracticallyallbranches.
Thebasicobjectivesofourapproachare:
∙itmustbesetupquickly,
∙itmustrapidlyevolve(newtestcasesmustbeadoptedquickly),
∙itmusteventuallyscaletoaccommodatehugesystems,
∙itmustbeableto"live"long(maintainableovermanyproductcycles),and
∙itmustbeuseful(testwhatwasintendedtobetested).
OurGUI-modellingideaisbasedonaprettyhereticalhypothesis.Ifthereisaneditfieldontheapplication'sGUI,allthatafunctionaltestwilldowithitistoenter,retrieve/checkorignoreitscontent.(Onemayarguethatthefieldattributes(label,position,enabled/disabled,etc.)alsoneedtobechecked.Thismaybetrue.However,comparedtotheoperationsonthefield'scontent,theoperationsonfield'sattributesarerare.Forthisreason,weconcentrateonthecontent.Nevertheless,wedoknowhowtohandleboth.)
ThesameholdstrueformostoftheotherGUIobjecttypes.Forexample,apushbuttonwillbepressedorignored,acheckboxwillbesetorcheckedwhetheritisset,elementsoflistboxeswillbeselectedorcheckedfortheirpresence,etc.Inotherwords,foreveryGUIobjecttypethereareonlyafewoperationsthatneedtobeappliedinordertoperformmostofthefunctionaltesting.
ThefirstmostimportantconceptofEMOSframeworkisthattheGUIofanapplicationisexercisedwithoperationsineitherSE