GUICat:GUITestingasaServiceLinCheng,JialiangChang,ZijiangYangDepartmentofComputerScienceWesternMichiganUniversityKalamazoo,MI,USAChaoWangDepartmentofComputerScienceUniversityofSouthernCaliforniaLosAngeles,CA,USAABSTRACTGUIsareevent-drivenapplicationswheretheowofthepro-gramisdeterminedbyuseractionssuchasmouseclicksandkeypresses.
GUItestingisachallengingtasknotonlybe-causeofthecombinatorialexplosioninthenumberofeventsequences,butalsobecauseofthedifcultytocoverthelargenumberofdatavalues.
WeproposeGUICat,therstcloud-basedGUItestingframeworkthatsimultaneouslygenerateseventsequencesanddatavalues.
Itisawhite-boxGUItest-ingtoolthataugmentstraditionalsequencegenerationtech-niqueswithconcolicexecution.
Wealsoproposeacloud-basedparallelalgorithmformitigatingbotheventsequenceexplosionanddatavalueexplosion,bydistributingthecon-colicexecutiontasksoverpubliccloudssuchasAmazonEC2.
WehaveevaluatedthetoolonstandardGUItestingbench-marksandshowedthatGUICatsignicantlyoutperformsstate-of-the-artGUItestingtools.
ThevideodemoURLishttps://youtu.
be/rfnnQOmZqj4.
CCSConceptsSoftwareanditsengineering→Softwarevericationandvalidation;Softwaretestinganddebugging;KeywordsSymbolicexecution,Testgeneration,GUItesting,Cloud1.
INTRODUCTIONGraphicalUserInterfaces(GUIs)provideaconvenientwayfortheusertointeractwiththecomputer.
Theyareevent-drivenapplicationswheretheowoftheprogramisdeter-minedbyuseractionssuchasmouseclicksandkeypresses.
Incontrasttoconsoleapplicationswhoseonlypointofin-teractionisatthebeginning,GUIshaveapotentiallylargenumberofinteractionpoints,eachofwhichmaybeassoci-atedwithadifferentstate.
Thesefeaturesoftenmaketra-ditionalsoftwaretestingtechniquesineffective.
Specically,Correspondingauthor(Email:zijiang.
yang@wmich.
edu)GUItestinghastwosignicantchallenges.
First,coveringallpossibleeventsequencesofaGUIapplicationisdifcultduetothecombinatorialexplosion,i.
e.
,thenumberofpossiblewaysofclickingkbuttonscanbeaslargeask!
.
Second,GUIbehaviorsdependnotonlyontheeventsequencebutalsoonthedatavaluesofwidgetssuchastext-boxes,edit-boxes,andcombo-boxes,thusleadingtoanextremelylargeinputspace.
Forexample,coveringallpossiblevaluesofak-characterin-putstringrequires26ktestcases.
AlthoughexistingGUItest-ingtools[9–11,13]haveaddressedthechallengeofgener-atinghigh-qualityeventsequences,theyhavenotaddressedthechallengeofsimultaneouslygeneratinghigh-qualitydatavalues.
Assuch,data-dependentGUIbehaviorsareoftenin-adequatelytested.
WeproposeGUICat,acloud-basedGUItestingframeworkthatgeneratesbothhigh-qualityeventsequencesandhigh-qualitydatavalues,byaugmentingstate-of-the-arteventse-quencegenerationtechniqueswithconcolicexecution.
Theresultisawhite-boxGUItestingtoolthatuniformlyexplorestheeventowaswellasthedataow.
Wealsoproposeaparallelconcolicexecutionalgorithmformitigatingthedatavalueexplosion,bydistributingthecomputationtasksoverworkersonprivateclustersaswellaspubliccloudssuchasAmazonEC2[3].
ItprovidesanillusionofrunningGUICatonapowerfulsupercomputerandthusallowsittohandlesignicantlylargerapplicationsthanpreviouslypossible.
WehaveimplementedGUICatbasedonanumberofopen-sourcetools,includingGUITAR[10]forgeneratingtheinitialeventsequences,ASM[1]forJavabytecodeinstrumentation,Catg[12]forconcolicexecution,andJaCoCo[2]forcomput-ingcodecoverage.
Unlikepriortechniques,GUICatisfullyautomatedinmodelingGUIwidgets.
Thatis,itdoesnotre-quiredeveloperstomanuallymodelthesewidgets.
Thisisimportantbecausemanualmodelingisnotonlylaborinten-siveanderrorpronebutalsohardtosustaininthelongrunduetofrequentwidgetupdates.
WehaveevaluatedGUICatonAmazonEC2forasetofGUItestingbenchmarks.
GUICatachievesscalabilitythroughthedistributionofsymbolicexecutiontasksTheremainderofthepaperisorganizedasfollows.
WeillustratethemainideabehindGUICatusingmotivatingex-amplesinSection2.
WepresentouralgorithminSection3,whichisfollowedbyourexperimentalresultsinSection4.
WediscusstherelatedworkinSection5.
Finally,wegiveourconclusionsinSection6.
2.
MOTIVATINGEXAMPLESFigure1showsaGUIexampleforcomputingticketfarebasedonuserinputsincludingName,AgeLevel,Distance,andCoupons.
OncetheBuybuttonisclicked,theapplica-Permissiontomakedigitalorhardcopiesofallorpartofthisworkforpersonalorclassroomuseisgrantedwithoutfeeprovidedthatcopiesarenotmadeordistributedforprotorcommercialadvantageandthatcopiesbearthisnoticeandthefullcitationontherstpage.
CopyrightsforcomponentsofthisworkownedbyothersthanACMmustbehonored.
Abstractingwithcreditispermitted.
Tocopyotherwise,orrepublish,topostonserversortoredistributetolists,requirespriorspecicpermissionand/orafee.
RequestpermissionsfromPermissions@acm.
org.
ASE'16,September3–7,2016,Singapore,Singaporec2016ACM.
978-1-4503-3845-5/16/09.
.
.
$15.
00http://dx.
doi.
org/10.
1145/2970276.
2970294858name,JTextField,getText,String,supermandistance,JTextField,getText,int,100AgeLevel,JComboBox,getSelectedIndex,int,0:1$100,JComboBox,isSelected,int,0:1$200,JComboBox,isSelected,int,0:1$400,JComboBox,isSelected,int,0:1Figure1:AGUIexampleandGUICat'scongurationle.
OnClickComputePrice(){intcoupon=0;Stringage=(String)ageComboBox.
getSelectedItem();Stringsdistance=distanceTextField.
getText();intdistance=Integer.
parseInt(sdistance);if(d100CheckBox.
isSelected())coupon+=100;if(d200CheckBox.
isSelected())coupon+=200;if(d400CheckBox.
isSelected())coupon+=400;if(age.
equals(Child)){coeffienct=1;}else{coeffienct=2;}if(distance0);infoField.
setText(price);}Figure2:Codesnippetforcomputingtheticketprice.
tioncomputesandthendisplaysticketprice,usingacoef-cientassociatedwiththechosenagelevel.
ToallowGUICattogeneratetestcases,theusermustprovideacongurationlethatspeciesthenameandtypeofthesymbolicvariablesasshowninFigure1(right).
Eachentry(line)ofthecongu-rationleconsistsofthewidgetname,widgettype,methodforobtaininguserinput(e.
g.
,getText),typeofuserinput,andthedefaultvalue(e.
g.
,superman).
Here,0:1meansthedefaultvalueisofenumtypewithtwovalues0and1.
Figure2showsthecodeforcomputingtheticketprice.
Ithasabugthatcanleadtonegativeticketprices.
Forexample,ifauserhasthreecoupons,thenpurchasingachildticketforadistanceof60mileswouldresultinthepricebeing-40dol-lars.
However,sinceanegativepricerequiresaspeciccom-binationofwidgetvalues,suchbugisdifculttodetectusingstate-of-the-artGUItestingtoolssuchasGUITAR[10].
ThisisbecauseGUITARfocusesprimarilyongeneratingeventse-quencesasopposedtogeneratingadiversesetofwidgetval-ues.
OurnewtoolGUICat,incontrast,canquicklygenerateacombinationofeventsequencesandwidgetvaluestoexposethisassertionfailure.
GUICatgeneratesthetestcasesasfollows.
First,itusesGUITARtogeneratetheinitialsetofeventsequencesuptoaboundedlength.
Then,foreacheventsequence,itcreatesaninstrumentedGUIwheresomevariablesaremarkedassymbolicbasedonthecongurationle.
Next,itconductssymbolicexecutionoftheinstrumentedGUIoverthecloud.
Finally,itusesJaCoCotogeneratethecoveragereport.
Now,weexplaineachstepinmoredetail.
Step1.
WeuseGUITARtogenerateeventsequencesofaboundedlength.
Assumetheboundis2,andeventse1,e7denotenameTextField,distanceTextField,AgeComboBox,100Dol-larCheckbox,200DollarCheckbox,400DollarCheckbox,andBuy-Button.
AfterrunningGUITAR,wehavethefollowingsevenlength-2eventsequences:(e1,e7),(e2,e7),(e3,e7),(e4,e7),(e5,e7),(e6,e7),and(e7,e7).
Inthisexamplealltheboundedsequencesendine7becauseotherwisenoactioncanbetakenattheendoftheuserinteraction.
Consider(e2,e7)asanex-ample.
Itmeanstheuserspeciesadistance(e2)beforeclick-ingtheBuyButton(e7).
Althoughlogicallymeaningless,thisparticulareventsequenceisfeasible.
Step2.
ForeacheventsequenceproducedbyGUITAR,wegeneratemoresequencesbyenumeratethevaluesofwidgetswithenumtypes.
Forexample,in(e3,e7),weknowJCom-boBoxisassociatedwithe3andithasanenumtype.
There-fore,weenumerateallpossiblevaluesofJComboBoxtopro-ducethenewsequences(e03,e7)and(e13,e7),whereei3meansthevalueiischosenforevente3.
Wealsoenumeratethevaluesofotherwidgetswithenumtypes,includingAgeCom-boBox,100DollarCheckBox,200DollarCheckBox,400DollarCheck-Box.
Sincetheseselectablewidgetshavealimitednumberofdatavalues,enumeratingthemisoftenmoreefcientthangeneratingthevaluesusingconcolicexecution.
Step3.
ForeacheventsequencegeneratedinStep2,weinstrumenttheGUIapplicationbymarkingcertainvariablesassymbolic.
Considertheguicat-confleinFigure1(right),wherethelastfourwidgetsareofenumtypesbutthersttwoarenot.
Thus,wemarkthersttwowidgetsassym-bolic.
Thatis,weuseCATG.
readString("superman")tocreateasymbolicstringanduseCATG.
readString(100)tocreateasymbolicinteger.
Here"superman"and100arethedefaultconcretevaluesforthesymbolicvariables.
Step4.
WeuseCatgtoexecuteeachinstrumentedGUIap-plicationsymbolicallyfollowingthespeciceventsequence.
Consider(e13,e7)again,wheree7isassociatedwithbranchesofanifstatement.
Symbolicexecutionwillleadtothecre-ationofnewvaluesfornameanddistance,e.
g.
,name=supermananddistance=50.
Mappingthevaluesbacktotheeventse-quencewillresultin(esuperman1,e502,e13,e7),wherethersttwoeventsareaddedtosetthevaluesofthewidgets.
Step5.
Aftergeneratingalltheeventsequencesanddatavaluesusingconcolicexecution,weuseJaCoCotocomputethecoveragereport.
JaCoCoisanopen-sourcecodecover-agelibraryforJava,whoseoutputisformulatedasanHTMLpagetoshowthecoveragestatistics.
3.
ARCHITECTUREFigure3showsthearchitectureofGUICat.
GivenaGUIprogramPasinput,GUICatrstinvokesGUITARtogener-ateeventsequences.
Then,itinstrumentstheprogrambasedoneachsequenceandthesymbolicvariablesspeciedingui-cat-conf.
Next,itinvokesthedistributedalgorithmtoconductsymbolicexecutionoftheinstrumentedprogramonacloudnode.
Finally,thetestcasesgeneratedbyallinstrumentedprogramsarecollectedandthenusedbyJaCoCotocomputethecoveragereport.
Inthedistributedsymbolicexecutionalgorithm,N0istheloadbalancerandN1.
.
.
Nkarethekworkersonthecloud.
N0distributesthesetEofinstrumentedGUIprograms,onepereventsequence,overthekworkers.
Theworkersthenconductsymbolicexecutionontheirshareoftasks.
Initially,eachworkerreceivesroughlythesamenumberoftasks.
How-859guicat-confBytecodeInstrumentationeventsequencesEventSeq.
Gen.
(GUITAR)Program(P)instrumentedGUIDistributedSym.
Exec.
(Catg)testcasesCoverageGen.
(JaCoCo)coveragereportFigure3:ThearchitectureofourGUICattool.
Algorithm1SymbolicExecutiononaWorker.
1:E=T=;2:whiletruedo3:ifreceivingtasksetE′then4:E=E∪E′;5:send(N0,|E|);6:elseifrequestingtasksonbehalfofNithen7:send(Ni,E[0.
.
|E|/2]);8:send(N0,|E|);9:elseifcollectingtestcasesthen10:send(N0,T);11:terminate;12:endif13:foralle∈Edo14:Pe=instrument(P,e,cfg)15:Te=Catg'.
execute(Pe);16:send(N0,|E|);17:T=T∪Te;18:endfor19:endwhileever,sincethecostofsymbolicexecutionvariesforeacheventsequence,someworkersmaynishtheirsymbolicexecutiontaskssoonerthanothers.
N0detectssuchimbalanceandre-questsaworkerwiththelargestworkloadtoshareitstaskswiththeidleworker.
Afterallworkerscompletetheirtasks,theloadbalancerN0collectsthetestcases.
Algorithm1showsthesymbolicexecutionprocedureforeachindividualworker.
Initially,thesetEoftasksandtestcasesTarebothempty.
Then,theworkerkeepscheckingmessagesfromN0andconductinglocalsymbolicexecution.
IfitreceivesasetE′oftasks(fromN0oranotherworker),thenewtasksareaddedtothelocalset.
Sincethenumberoftasksischanged,itupdatesN0withitscurrentnumberoftasks.
ThisalsooccursatLines8and16.
Withsuchupdates,N0knowsthenumberoftaskstobeprocessedattheworkers.
IftheworkerreceivesamessagefromN0thatrequestsmoretasksonbehalfofanotherworkerNi,itsendshalfofitstaskstoNi(Line7).
AsignalofterminationisreceivedifN0asksforitstestcases,andinsuchcase,thecurrentworkersendsthelocallygeneratedtestcasesandthenterminates.
Symbolicexecutionisconductedforeachindividualeventsequencee∈E.
Essentially,itallowsustoexecutetheevent-drivenapplicationasifitisasequentialJavaprogram.
WeleveragetheCatgconcolicexecutiontool,whichmaintainstwoexecutionstacks:oneforconcreteexecutionandtheotherforsymbolicexecution.
WhenCatgexecutesanunknownmethod,forexample,Integer.
parseInt(),thesymbolicexecu-tionstackwouldnotbeupdated,wehavemodiedCatgtohandleunknownmethods.
LoadbalancerWorker1Worker2Worker3Worker4Worker5Figure4:ArchitectureofGUICat'sdistributedalgorithm.
forworkerin$(workers);doscp-r${AUTDIR}.
tar.
gz{worker}:~/gui/guicat/log/done.
.
.
forworkerin$(workers);doscp${worker}:~/gui/guicat/${AUTDIR}/report.
tar.
gz.
/${AUTDIR}/${worker}.
tar.
gzdoneFigure5:Communicationfromloadbalancertoworkers.
ThedistributedalgorithminGUICathasbeenimplementedonAmazonEC2asaCloudservice.
WedivideEC2instancesintotheloadbalancerandtheworkers.
Theloadbalancerisamulti-processorEC2instancethatgenerateseventsequences,distributestaskstotheworkers,andcollectsthetestcasesgeneratedbytheworkers.
Eachworkerisasingle-processorEC2instancethatsymbolicallyexecutesaneventsequencetogeneratetestcases.
GUICatallowstheusertocustomizetheCloudservice,suchasthenumberofworkersandtheircom-putationcapabilities,basedoncustomerrequirementssuchaswhetherabudget-rsttestingispreferredoveraspeed-rsttesting,orwhetherbranchcoverageispreferredoverinstructioncoverage.
Toalloweasycustomization,weimplementGUICatbyfollowingthestartopologyshowninFigure4,wheretheloadbalancergeneratesanddistributeseventsequencestotheworkers,andtheworkersconductconcolicexecutionwithrespecttotheeventsequenceinisolation,beforesendingtestcasesbacktotheloadbalancer.
Figure5illustrateshoweventsequencesaredistributedtotheworkersandhowtestcasesarecollectedfromtheworkers.
Fornow,distributedlesys-temlibrariesareusedtoimplementthetransferofeventse-quencesandtestcasesbetweentheloadbalancerandwork-ers.
Themainadvantageofthisarchitectureisefciencysincethereisnocommunicationbetweentheworkers.
4.
EXPERIMENTALEVALUATIONWehaveimplementedGUICatusinganumberofopen-sourcetools,includingGUITARforgeneratingtheinitialeventsequences,ASMforinstrumentingtheJavabytecode,Catgforimplementingthedistributedparallelconcolicexecution,andJaCoCoforcomputingthecodecoveragereport.
WehaveevaluatedGUICatonseveralGUItestingbench-marks.
Inallexperiments,wehaveusedtheAmazonEC2cloudcomputinginfrastructure,wheretheloadbalancerisdeployedasamulti-processorEC2instanceandeachworkerisdeployedasasingle-processorEC2instance.
Intheremainderofthissection,wereporttheresultsoftwocasestudies:aticketsellerandaworkoutgenerator.
Ineachcasestudy,ourexperimentconsistsofthefollowingsteps.
First,wecreateacongurationlefortheapplica-tionundertest.
Then,wegeneratetheeventsequencesusing860Figure6:TicketSellerGUITAR[10].
Next,wedistributetheeventsequencesfromtheloadbalancertoworkersonAmazonEC2.
TheinitialdistributionisstaticanddividesthetasksevenlytotheEC2instances.
Afterreceivingtheeventsequences,eachworkerconductsconcolicexecutionusingCatg;asaresult,testcasesaregeneratedfortheseeventsequences.
Whenallworkersnished,theloadbalancercollectstheirtestcasesandthenusesJaCoCotocomputethecoveragereport.
4.
1TheTicketSellerFigure6showstheuserinterfaceofamoresophisticatedticketsellerthantheoneshowninFigure1.
ItallowstheusertoprovidepassengerinformationsuchastheName,ID,startdistance(From),enddistance(To),AgeLevel,ClassLevel,andtheCoupon.
WhentheuserclickstheBuyTicketbutton,theapplicationstoresthepassengerinformationtoanobjectnamedTicketModel,checksforconsistencyusingthemethodcheckModel(),andcomputesthepriceusingthemethodcom-putePrice().
TherearevedifferenttypesofGUIwidgetsinFigure6:fourofJTextFieldtype,oneofJComboBoxtype,oneofJRa-dioButtontype,oneofJCheckBoxtype,andtwoofJButtontype.
ThersttwoJTextFieldwidgetscollectthevaluesofNameandIDbyinvokingJTextField.
getText(),thecombinationofwhichmayleadtobuggybehaviors.
Wemarkbotheldsassymbolic.
Thatis,whenloadingtherelatedJavaclass,weusethebytecoderewritingtoolASMtoinstrumenttheprogramonthey,toreplaceinvocationsofgetText()withinvocationsofsGetText(),amethodthatwedeveloptoreturnasymbolicvalue.
ThesymbolicvaluesforNameandIDareusedduringthesubsequentsymbolicexecutionstep.
ThenexttwoJTextFieldwidgetscollectthevaluesofFromandTobyrstinvokingJTextField.
getText()andtheninvokingInteger.
parseInttocastthestringsintointegers.
Sincethesym-bolicexecutionengineCatgdoesnotsupportsuchcasting,wehavemodiedCatgtoconvertthesestringsintointegersbeforeusingtheminthesubsequentlogic.
AsfortheselectablewidgetsJComboBox,andJCheckbox,weenumerateallpossiblevaluesoftheenumtypes.
Wechooseenumerationoversymbolicexecutionfortheseselectablewid-getsduetoefciencyandeaseofimplementation.
First,se-lectablewidgetsdonothavemanydifferentvalues.
Second,theexistingsymbolicexecutionengineoftenhastroublehan-dlingthem.
Forexample,JComboBoxhastwomethodsgetS-electedIndex()andgetSelectItem()thatreturnvaluesofacus-tomizedObjecttype,whichcannotbeeasilycasttostringsorintegersinsideCatg.
Tosummarize,weusedGUITARtogeneratetheinitialeventsequencestogetherwiththeinitialparameters/states.
Then,weaddtheenumeratedvaluesforselectablewidgets,be-foreconductingsymbolicexecutiontogeneratethevaluesforwidgetsofothertypes.
IftheinitialeventsequenceisTable1:Resultsontheticketseller(length=2,node=1).
ToolButtonBranchesCoverageInstructionsCoverageGUITARcheckModel633.
3%5653.
5%computePrice3423.
5%17230.
8%GUICatcheckModel6100%56100%computePrice34100%172100%Table2:Resultsonticketseller:thetestcasesgeneratedinadditiontoGUITARandtheuniquepathscovered.
ToollengthTestCase(TC)enumTCconcolicTCpathscoveredGUITAR211--43110--7GUICat211132869631101563212190tooshorttocontainallwidgetsofJTextFieldtypeneeded,weremovethestatelessJTextFieldeventandthenappendmorestatefulJTextFieldeventtothebeginningoftheeventsequence,thusincreasingthelengthofthesequence.
Weanalyzedtheticketsellerwithseveralcongurations.
Table1showstheresultsofgeneratingthelength-2testcases.
Columns1-2showthetoolnameandthenameofthebuttonclicked.
Columns3-4showthetotalnumberofbranchesandthepercentageofbranchescovered.
Columns5-6showthetotalnumberofinstructionsandthepercentageofinstruc-tionscovered.
TheresultsshowthatGUICatcanachievefullbranchandinstructioncoverageevenwithlength-2testcases,whereasGUITARcanonlyachieve33.
3%branchcov-erageand53.
5%instructioncoverageforcheckModel,23.
5%branchcoverageand30.
8%instructioncoverageforcompute-Price.
Table2comparesGUICatandGUITARintermsofthenum-berofpathscovered.
Column1showsthetoolname.
Col-umn2showsthelengthofthetestsequences.
Column3showsthetotalnumberoftestcasesgeneratedbyGUITAR.
Column4showsthenumberofadditionaltestcasesgener-atedbyGUICatafterenumeratingthevaluesofselectablewidgets.
Column5showsthenumberoftestcasesgener-atedbyGUICatafterconcolicexecution.
Column6showsthepathcoverage.
Toaccuratelycomputethenumberofpathscovered,wemanuallyaddedcodeintotheprogram.
Specically,weusedavectornamedpath,whereeachelementwasmappedtoanif-statement.
Forexample,theagecombo-boxcorrespondstoanif-statementwherewesetpath[0]=0inthethenbranchandpath[0]=1intheelsebranch.
Eachtimetheprogramter-minates,wewillobtainauniquevectorpaththatactsasthepathidentier.
ThesevectorsarestoredandthenusedtocomputethepathcoverageafterGUICatterminates.
Ourresultshowsthat,overall,GUICatachievedsigni-cantlyhigherpathcoveragethanGUITAR.
Forlength-2testsequences,inparticular,GUICathad96/4=24timeshigherpathcoverage,whereasforlength-3testsequences,GUICathad190/7=27timeshigherpathcoverage.
GUICatalsosuccessfullydetectedtwobugsinticketseller.
OnebugisaNullPointerExceptioncausedbytheracecondi-tionbetweenclickingofthesavebuttonandclickingofthebuybuttonasshowninFigures7and8.
Theotherbugisthefailureofanassertionduetothecomputedpricebeinglessthanzero.
4.
2TheWorkoutGeneratorFigure9showstheuserinterfaceoftheworkoutgenerator,whichistakenfromBarad[6].
Itgeneratesaworkoutplanbasedontheuserinput,includingtheGender,Metabolism,861buyButton.
addActionListener(newActionListener(){publicvoidactionPerformed(ActionEvente){ticketModel.
name=nameInput.
getText();if(ticketModel.
checkModel()){ticketModel.
computePrice();assertticketModel.
price>0:@Bug:price<=0!
;}}});saveButton.
addActionListener(newActionListener(){publicvoidactionPerformed(ActionEvente){.
.
.
ticketModel=null;}});Figure7:Thebuggycodesnippetinticketseller.
[AWT-EventQueue-0]ERRORUncaughtexceptionjava.
lang.
NullPointerExceptionatexamples.
ticket.
BaradTicket$1.
actionPerformed(BaradTicket.
java:177).
.
.
[AWT-EventQueue-0]ERRORUncaughtexceptionjava.
lang.
AssertionError:@Bug:price<=0!
atexamples.
ticket.
BaradTicket$1.
actionPerformed(BaradTicket.
java:235)Figure8:TheticketsellerbugdetectedbyGUICat.
Figure9:WorkoutGeneratorExperience,Age,Height,andWeight.
ThecomputationstartswhentheuserclickstheGeneratebutton.
Dependingontheuserinformation,thecomputationgoesthroughdifferentex-ecutionpathsthatusedifferentcardiocoefcients.
TherearethreeJTextFieldwidgetsandthreeJComboBoxwid-gets.
TheJTextFieldwidgetsreturnstringvaluesofAge,Height,andWeightusingthemethodJTextField.
getText(),beforecast-ingthemtointegersusingInteger.
parseInt().
Basedonthecongurationleprovidedbytheuser,GUICatcreatesthreesymbolicvariablesforthesethreewidgets,andreplacesget-Text()withsGetText(Object)soitcanreturnsymbolicvalues.
TheJComboBoxwidgetsreturnvaluesofGender,Metabolism,andExperience.
Sincetheyareselectablewidgets,weuseenu-merationtocreatethevaluecombinations.
Table3showstheresultsofapplyingGUICattoworkoutgeneratorwiththelengthoftestsequencessetto1and3.
Columns1-2showthetoolnameandthelengthofthetestsequences.
Columns3-4showthenumberofbranchescov-eredandthepercentageofbranchescovered.
Columns5-6showthenumberofinstructionscoveredandthepercentageofinstructionscovered.
Again,GUICatsignicantlyoutper-formedGUITARintermsofbothpathcoverageandinstruc-tioncoverage.
Neithertoolwasabletoreachfullpathandinstructioncoveragewithlength-2testsequences,becausetherearethreeselectablewidgets,whichrequiresthelengthoftestsequencesbeingtobelargerthan2.
Withlength-3testsequences,GUICatwasabletoachieve100%instructioncoverageand97.
4%branchcoverage.
Incontrast,GUITARdidnotshowsignicantimprovementinTable3:Resultsonworkoutgenerator(node=1).
ToolLengthBranchesCoverageInstructionsCoverageGUITAR215413.
0%242542.
3%315413.
0%242542.
3%GUICat215468.
9%242585.
7%315497.
4%2425100%Table4:Resultsonworkoutgenerator:thetestcasesgener-atedinadditiontoGUITARandtheuniquepathscovered.
ToollengthTestCase(TC)enumTCconcolicTCpathscoveredGUITAR29--1372--2GUICat2914692437218290956branch/instructioncoverage.
ThereasonisthatGUITARonlyusedthedefaultvaluesofthewidgets,andthuscannotex-plorealternativepathsevenwithalongereventsequence.
Incontrast,GUICatusedbothenumerationandsymbolicexe-cutiontodiversifythevaluesofthewidgets.
Table4comparesGUICatandGUITARintermsofthenum-berofpathscovered.
Column1showsthetoolname.
Col-umn2showsthelengthofthetestsequencesusedintheex-periments.
Column3showsthenumberoftestcasesgen-eratedbyGUITAR.
Column4showsthenumberofaddi-tionaltestcasesgeneratedbyGUICatafterenumeratingthevaluesofselectablewidgets.
Column5showsthenumberoftestcasesgeneratedbyGUICatafterconcolicexecution.
Column6showsthenumberofpathscovered.
Ourresultdemonstratesthat,overall,GUICatcanachievesignicantlyhigherpathcoveragethanGUITAR.
Forlength-2testsequences,inparticular,GUICatreached24/1=24timeshigherpathcov-erage,whereasforlength-3testsequences,GUICatreached56/2=28timeshigherpathcoverage.
WealsoobservedthatGUICatgeneratedmanymoretestcasesthanthepathscovered.
Forexample,withthelengthsetto3,GUICatgenerated909testcasestocover56uniquepaths,whichmeanssomeofthesetestcaseshaveledtothesamepaths.
Ifwecould,forexample,identifyandelimi-natetheseredundanttestcases,theperformanceofGUICatwouldbefurtherimproved.
However,weleavethepruningoftheseredundanttestcasesforfuturework.
4.
3EffectofCloudComputingFigure10showstheeffectivenessofdistributingthetest-ingoftheticketseller(a)andtheworkoutgenerator(b)overAmazonEC2.
Thex-axisdenotethenumberofworkers,rangingfrom1to16,andthey-axisdenotethetimeusageinsecond.
Thesolid,dashedanddottedlinesrepresenttheboundedlengthof2,3and4,respectively.
Duetothein-herentparallelisminsymbolicexecutionofdifferenteventsequences,thespeedupisalmostlinear.
5.
RELATEDWORKGUITAR[10]istherstframeworkcapableofperformingthewholeprocessoftestgeneration,execution,andresultas-sessmentforGUIs.
Sinceitsrstpublicationtherehavebeenmultipleimprovements(e.
g.
[14]).
Thisframeworkgeneratestestsaseventsequencesuptoagivenbound.
Foremulatinguserinputaspecicationbasedapproachisadopted,i.
e.
,us-ingvaluesfromaprelleddatabase.
SinceGUITARdoesnotprovideamechanismforreasoningaboutinputvaluesfordatawidgets,GUICatofferscomplementaryandmorecom-prehensivetesting.
862(a)ticketseller(b)workoutgeneratorFigure10:Timereductionachievedbycloudcomputing.
TheworkclosesttooursisBarad[6]thatalsoexploitssymbolicexecutiontocomputeinputvaluesfordatawid-gets.
ItmanuallycreatessymbolicmirrorofjavaGUIlibrary,soitsreleasedsourcecodecontainsalargesymbolicjavaGUIlibrary.
Manualmodelingiserrorproneandhardtosus-tain.
Infact,wedownloadedthetoolbutfailedtomakeitworkonourbenchmarks.
Weemployadifferenttestgener-ationalgorithmandsymbolicanalysismethodforobtaininginputs.
Anotherlineofworkistoapplymodelcheckingtech-niques.
Forexample,jfp-awt[8]isanextensionoftheJavaPathFinderforGUIapplications.
PerformanceenhancementofGUItestinghastraditionallyfocusedonminimizingeventsequences[9,13].
Baradgen-eratestestcasesaschainsofeventlistenermethodinvoca-tionsandmapsthesechainstoeventsequencesthatforcetheexecutionoftheseinvocations.
Suchapproachprunestheeventinputspacebecauseitdoesnotneedtoconsidereventswheretherearenoeventlisteners.
Morerecentworkstartstoapplyeventdependencyanalysis[4],programslicing[5]orpartialorderreduction[7]toimprovetheperformance.
Ourperformanceimprovementisobtainedbyexploitingmassivehardwareresourceavailableoncloud.
Thereforeourapproachisorthogonaltotheexistingalgorithmicapproaches.
6.
CONCLUSIONWehavepresentGUICat,therstcloud-basedGUItest-ingtoolforsimultaneouslygeneratinghigh-qualityeventse-quencesaswellashigh-qualitydatavalues.
Internally,GUICatleveragesGUITARtogeneratetheinitialsetofeventsequences,andthenusesacombinationofvalueenumerationandsym-bolicexecutiontogeneratedatavaluesofthewidgets.
GUICatalsoleveragesthecloudcomputationinfrastructuretospeedupthetestgeneration,bydistributingindependentconcolicexecutiontaskstoEC2nodes.
WehaveimplementedGUICatandevaluateditonasetofGUItestingbenchmarks.
OurexperimentsshowthatGUICatcansignicantlyoutperformGUITARonstandardGUItestingbenchmarksintermsofbothbranchcoverageandinstructioncoverage.
7.
ACKNOWLEDGMENTSThisworkwasprimarilysupportedbyNSFundergrantsDGE-1522883andCCF-1500365.
Partialsupportwaspro-videdbyCCF-1149454,CCF-1405697,andCCF-1500024.
8.
REFERENCES[1]ASM.
http://asm.
ow2.
org/.
[2]JaCoCo.
http://eclemma.
org/jacoco/.
[3]Amazon.
Amazonelasticcomputecloud.
http://aws.
amazon.
com/ec2/.
[4]S.
Arlt,A.
Podelski,C.
Bertolini,M.
Schf,I.
Banerjee,andA.
M.
Memon.
LightweightstaticanalysisforGUItesting.
InInternationalSymposiumonSoftwareReliabilityEngineering,2012.
[5]S.
Arlt,A.
Podelski,andM.
Wehrle.
ReducingGUItestsuitesviaprogramslicing.
InInternationalSymposiumonSoftwareTestingandAnalysis,2014.
[6]S.
Ganov,C.
Killmar,S.
Khurshid,andD.
E.
Perry.
EventlisteneranalysisandsymbolicexecutionfortestingGUIapplications.
FormalMethodsandSoftwareEngineering,2009.
[7]P.
Maiya,R.
Gupta,A.
Kanade,andR.
Majumdar.
Partialorderreductionforevent-drivenmulti-threadedprograms.
InToolsandAlgorithmsfortheConstructionandAnalysisofSystem,pages680–697,2016.
[8]P.
Mehlitz,O.
Tkachuk,andM.
Ujma.
JPF-AWT:ModelcheckingGUIapplications.
ASE,2011.
[9]A.
Memon,I.
Banerjee,N.
Hashmi,andA.
Nagarajan.
DART:Aframeworkforregressiontesting"nightly/-dailybuilds"ofGUIapplications.
InInternationalCon-ferenceonSoftwareMaintenance,2003.
[10]B.
N.
Nguyen,B.
Robbins,I.
Banerjee,andA.
Memon.
GUITAR:aninnovativetoolforautomatedtestingofGUI-drivensoftware.
AutomatedSoftwareEngineering,2014.
[11]R.
K.
ShehadyandD.
P.
Siewiorek.
Amethodtoau-tomateuserinterfacetestingusingvariablenitestatemachines.
InInternationalSymposiumonFault-TolerantComputing,1997.
[12]H.
Tanno,X.
Zhang,T.
Hoshino,andK.
Sen.
TesMaandCATG:automatedtestgenerationtoolsformodelsofenterpriseapplications.
InternationalConferenceonSoft-wareEngineering,2015.
[13]L.
WhiteandH.
Almezen.
GeneratingtestcasesforGUIresponsibilitiesusingcompleteinteractionsequences.
InInternationalSymposiumonSoftwareReliabilityEngi-neering,2000.
[14]Q.
XieandA.
M.
Memon.
UsingapilotstudytoderiveaGUImodelforautomatedtesting.
ACMTrans.
Softw.
Eng.
Methodol.
,18(2):7:1–7:35,Nov.
2008.
863
HostKvm也发布了开年促销方案,针对香港国际和美国洛杉矶两个机房的VPS主机提供7折优惠码,其他机房业务提供8折优惠码。商家成立于2013年,提供基于KVM架构的VPS主机,可选数据中心包括日本、新加坡、韩国、美国、中国香港等多个地区机房,均为国内直连或优化线路,延迟较低,适合建站或者远程办公等。下面列出几款主机配置信息。美国洛杉矶套餐:美国 US-Plan1CPU:1core内存:2GB硬盘...
PIGYun是成立于2019年的国人商家,提供香港、韩国和美西CUVIP-9929等机房线路基于KVM架构的VPS主机,本月商家针对韩国首尔、美国洛杉矶CUVIP-AS29、GIA回程带防御等多条线路VPS提供6-8.5折优惠码,优惠后韩国首尔CN2混合BGP特惠型/美国洛杉矶GIA回程带10Gbps攻击防御VPS主机最低每月14.4元起。下面列出几款不同机房VPS主机配置信息,请留意不同优惠码。...
Webhosting24宣布自7月1日起开始对日本机房的VPS进行NVMe和流量大升级,几乎是翻倍了硬盘和流量,价格依旧不变。目前来看,日本VPS国内过去走的是NTT直连,服务器托管机房应该是CDN77*(也就是datapacket.com),加上高性能平台(AMD Ryzen 9 3900X+NVMe),还是有相当大的性价比的。此外在6月30日,又新增了洛杉矶机房,CPU为AMD Ryzen 9...
dengjiagui为你推荐
关于企业邮箱使用与管理的暂行规定操作httpphpadmin下载求张艺兴《莲》mp3下载苹果appstore宕机苹果appstore打不开怎么办中国企业在线一般都在哪里找企业信息啊?163yeah请问163油箱和yeah邮箱的区别,已经和163其他邮箱的区别!sqlserver2000挂起安装sqlserver2000时总提示有挂起操作!阅读http加多宝和王老吉王老吉和加多宝的关系?温州商标注册温州代理注册个商标是怎么收费的?
北京vps 免费com域名申请 过期已备案域名 naning9韩国官网 香港bgp机房 sub-process 双12活动 一点优惠网 日本空间 权嘉云 免费吧 789电视剧 空间购买 国外的代理服务器 广州虚拟主机 中国linux 谷歌台湾 iki 阿里dns 带宽测试 更多