Proceedingsofthe3rdInternationalConferenceonComputingandInformatics,ICOCI2011,8-9June,2011Bandung,IndonesiaPaperNo.
021226ANIMPROVEDALGORITHMINTESTCASEGENERATIONFROMUMLACTIVITYDIAGRAMUSINGACTIVITYPATHNorLailyHashim1,YasirD.
Salman21UniversitiUtaraMalaysia,Malaysia,laily@uum.
edu.
my2UniversitiUtaraMalaysia,Malaysia,s820400@uum.
edu.
myABSTRACT.
ThispaperproposedanimprovedalgorithmtoautomaticallygeneratetestcasesdirectlyfromUMLactivitydiagramusinganactivitygraph.
ThisalgorithmhasbeenimplementedasaprototypeusingUMLactivitydiagramsasinputstogeneratetestcases.
Thesegeneratedtestcasesaregeneratedautomaticallyarecomparedtotestcasesthataregeneratedmanuallyinordertoevaluatethealgorithm'susabilityandreliability.
Theresultshowsthatthetestcasesgeneratedbythedevelopedtestcasegeneratorprogramarethesameastheonemanuallyderived.
Keywords:testcasegeneration,automatedgeneration,testcaseINTRODUCTIONTestcasegenerationisoneofthemostimportantelementsforthetestingeffortsforprogramsandapplications(Linzhangetal.
,2004).
Itisespeciallycomplicatedwhenasystemcontainssimultaneouslyexecutingparticipants,sinceasystemlikethatcanshowdifferentresponsesdependingonthesimultaneousoccurrenceconditions.
AUnifiedModellingLanguage(UML)activitydiagramisasuitablemodellinglanguagefordescribinginteractionsbetweensystemobjectsgiventhatanactivitydiagramcanbeconvenientlyusedtocapturebusinessprocesses,workflowsandinteractionscenarios(Kimetal.
,2007).
ManyhavegeneratedtestcasesfromUMLactivitydiagramsbygeneratingthemmanuallytotestthesystem(Linzhangetal.
,2004;Kundu&Samanta,2009;Kimetal.
,2007).
Manygeneratetestcasesautomaticallyusingdifferentmethods(Chenetal.
,2009;Javed,Strooper&Watson,2009),howevernoneofthesestudieshasrevealedthealgorithmthattheyhaveused.
Kundu&Samanth(2009)havedevelopedanalgorithmtogeneratetestcasesusingactivitypaths.
Theiralgorithmhasneverbeenimplementedandthisalgorithmneedsanactivitygraphthathasbeengeneratedmanuallyfromtheactivitydiagram.
Theiralgorithmalsoneedstoenterthetypeofeachnodemanuallyandapplysomerulestogettheresultpaths.
ThispaperfocusesonextendingKundu&Samanth(2009)'salgorithmusedingeneratingtestcasesusingUMLactivitydiagrambyapplyingactivitypathapproach,inwhichthetestcasesaregeneratedautomaticallygenerated.
Theactivitypathisamethodtocalculateallpossiblepathsfromtheactivitydiagrams,convertedeachnumberinthepathtoitsoriginaldata,andfromtherewillgeneratethetestcases.
Proceedingsofthe3rdInternationalConferenceonComputingandInformatics,ICOCI2011,8-9June,2011Bandung,IndonesiaPaperNo.
021227BACKGROUNDThefollowingarethemainconceptsappliedinthisstudy.
UMLActivityDiagramUMLisastandardthatcontainsalargesetofmodellingconceptsthatarerelatedincomplexways.
SinceUMLbecameastandardofOMGin1997,UMLmodelshavebecomemainclassofartefactsinsoftwaredevelopmentprocesses.
UMLprovidesanumberofdiagramstodescribedifferentaspectsofsoftwareartefacts.
UMLactivitydiagramsillustratethesequentialcontrolflowsofactivities.
Theycanbeusedtorepresentcontrolflowofanoperationormodelthedynamicaspectsofagroupofobjects,whichformakindofdesignspecificationsforprograms(Chenatal.
,2009).
Inordertodirectlyreusetheactivitydiagramsmodelingofanoperationasatestmodeltogeneratetestcases,itisnecessarytofollowthetestabilityrequirement.
Anactivitydiagramshouldonlyhaveoneinitialactivitystate,pairofbranchesandmerges,pairofforksandjoins.
Theownerobjectofeachactivitystateshouldbelabeledbyswimlanes,orbelabeledinthenameofactivitystate.
Everynodeotherthantheinitialnodeandfinalnodehasatleastoneoutgoingedgeandoneincomingedge,whichmeansallnodesarereachable.
Anyforknodeonlyhastwoexitedges.
Concurrentactivitystateswillnotaccessthesameobjectandonlyexecuteasynchronously(Linzhangetal.
,2004).
ActivitygraphAnactivitygraphisadirectedgraphwhileitsconstructisrepresentedbyeachnodeintheactivitygraph(initialnode,decisionnode,flowfinalnode,guardcondition,joinnode,forknode,etc.
),andfromthateachborderoftheactivitygraphsymbolizesthestreamintheactivitydiagram.
Furthermore,theactivitygraphasshowninFigure1summarizesassembleofanactivitydiagraminanorganizedwaywhichcanbeusedforfurtherautomation(Kundu&Samanta,2009).
Thesenodesareusedfortestcasegenerationduetotheircapabilityfordetectingmorefaultsinthesynchronizationandloopfaultsthantheotherapproaches.
Inadditiontheabilitytoidentifylocationofthefaultswillhelptoreducetestingaffordandhavingmodel-basedtestcasegenerationtoimproveanddevelopdesignquality.
Furthermore,ithasapossibilitytobuiltautomaticallyprototypefortheactivitygraph.
ThealgorithmbyKundu&Samanta(2009)hastakentheactivitygraphasaninputandtheoutputfromitwillbetheactivitypath.
Furthermore,thegeneratedpathswillneedsomeofrulestoapplyontheresultpathstogetallthepossiblepathsthatwillbeneededtogeneratethetestcases.
Figure1.
ActivityGraphforloginscreenProceedingsofthe3rdInternationalConferenceonComputingandInformatics,ICOCI2011,8-9June,2011Bandung,IndonesiaPaperNo.
021228TestCaseGenerationTestcasegenerationhasattractedmoreandmoreresearchattention(Cartaxo,Neto&Machado,2007;Chenatal.
,2009;Heumann,2001;Javed,Strooper,&Watson,2007;Kimetal.
,2007;Kundu&Samanta,2009;Linzhangatal.
,2004;Mingsong,Xiaokang,&Xuandong,2006).
LargenumberofthemfocusedonUMLactivitydiagramasabasedtogeneratethetestcase(Chen,atal,2009;Kundu&Samanta,2009;Kim,Kang,Baik,&Ko,2007;Linzhangatal.
,2004;Mingsong,Xiaokang,&Xuandong,2006),andnoneofthemrevealtheirproposedapproachesoralgorithms,orsharetheirtestingimplementationconductedduringthetesting.
Atestcasespecifiesasetoftestinputs,expectedresults,andexecutionconditionsdevelopedtoverifyobservancewithaspecificrequirementorimplementaparticularprogrampath(Lilly&G,2010).
PROPOSEDALGORITHMFORGENERATINGTESTCASESThefollowingalgorithmwillgenerateallthepossiblepathsfromtheactivitydiagram,andfromtheresultpaths,testcaseswillbegenerated.
Thisalgorithmisevaluatedintermsofitsusabilityandreliabilitybycomparingmanualtestcaseswithtestcasesautomaticallygeneratedfromtheprototypeofthisalgorithm.
ThemanualtestcasesareobtainedfromAlshammari(2010),wherefourtestcasesforstudentfunctionalitiesfromUniversitiUtaraMalaysialearningmanagementsystemcalled,LearningZoneareused.
Thefunctionsarelogin,downloadassignment,changepassword,andforumsearch.
Duetospacelimitation,onlyoneLoginfunctionisusedandpresentedinthispaper.
Algorithm1:GenerateTestCasePartA:variablesusedintheAlgorithmInput:anactivitydiagramOutput:testcaseTofindthenumberofpaths,thefollowingarethevariablesused:TDN-thenumberofnodewhichhastwodirections.
RNN-thenumberofreturnnode.
TDNI-thenumberoftwodirectionsinsideeachreturnnode.
RNNI-thenumberofreturnnodeinsideeachreturnnode.
Basicpathswiththereturnpathsnumber(BPR)=TDN+1Basicpathsnumber(BP)=BPR-RNNNumberofpathsafterreturn(PAR)=TDNI-RNNIThenumberofallpaths(AP)=BP+PAR(s)PartB:Pseudocodeofmethodssupportedinthealgorithm1.
Tofindthebasicpathswiththereturnpaths,thefollowingarethevariablesused:a.
Node-toputthenodesb.
LoopFlag-tokeeptrackoftheloopc.
N1-forthefirstnextofthenodesd.
N2-forthesecondnextofthenodese.
Nodeflag–forkeepingtrackofthevisitednodesf.
End–forknowtheendofthepathBeginLoopFlag=TDN,Node=firstnode,Nodeflag=0,End=trueWhileLoopFlagisnotemptydoWhileEndistruedoProceedingsofthe3rdInternationalConferenceonComputingandInformatics,ICOCI2011,8-9June,2011Bandung,IndonesiaPaperNo.
021229If(it'sthefirstnode)thenputthefirstnodeinthepath;PutthenodefirstnextinN1anditssecondnextinN2;If(N1=0)thenputendtotrue;If(NodeFlag=0andN2=0)thenputN1forthenextnodeinthepath;Elseif(NodeFlag=0andN2!
=0)thenputN1forthenextnodeinthepathandputNodeFlag=1,putNodeFlag=NodeFlag–thenumberoftwodirectionnodebeforeit;Elseif(NodeFlag=1andN2!
=0)thenputN2forthenextnodeinthepathandputNodeFlag=2;Putthenextnodeofthepathasthecurrentnode;EndPutthepathinarray;End2.
Tofoundallthepaths(AP)DuplicatethepathsthathavewithoutEndtothe(TDNI+RNNI)number;Putthereturnpathsinsideittocontinueittothenumberofpathsinsidethereturnpath;Finisheachonefromthesizebasicpaths;Thatwillgeneratethepossiblepaths.
3.
Fromthesaveinformationofeachnode,printoutthedetailsofeachpathtothelastone,whatwillgiveusthetestcase.
AutomaticgenerateforthetestcasefromtheloginactivitydiagramFirst:Usetheactivitydiagram,asshowninFigure2togeneratethetestcasefromit.
Figure2.
ActivityDiagramfor"Login"Usingthealgorithmexplainedearlier,theprototypewillgeneratethefollowingresultasshowninFigure3No.
ofTimes>N>Y>>Proceedingsofthe3rdInternationalConferenceonComputingandInformatics,ICOCI2011,8-9June,2011Bandung,IndonesiaPaperNo.
021230Figure3.
Theprogramresultforthe"login"activitydiagramThisresultcontainsallpossiblepathsthataregeneratedfromthealgorithmbasedongivenactivitydiagramasshowninFigure3.
Thedetailforeachpathtogetherwithsavednodesisusedtogeneratethetestcases.
ThetestcasesgeneratedforLoginactivitydiagramcanbeseeninTable1inthelastcolumn.
Columntwoshowsthebranchconditionsthateachpathfollows.
Table1.
Thegeneratedtestcasesfor"Login"TestcaseSequenceofBranchConditionsActivitySequence1RegID=InvalidTryagain=NoDisplay:Loginhereusingyourusernameandpassword,Display:Sorry,youhaveexceededtheallowednumberofloginattempts.
Restartyourbrowser.
2RegID=ValidDisplay:Loginhereusingyourusernameandpassword,Launchstudentmainviewpage.
3RegID=InvalidTryagain=YesRegID=InvalidTryagain=NoDisplay:Loginhereusingyourusernameandpassword,Display:Invalidlogin,pleasetryagain.
Display:Loginhereusingyourusernameandpassword,Display:Sorry,youhaveexceededtheallowednumberofloginattempts.
Restartyourbrowser.
4RegID=InvalidTryagain=YesRegID=ValidDisplay:Loginhereusingyourusernameandpassword,Display:Invalidlogin,pleasetryagain,Display:Loginhereusingyourusernameandpassword,Launchstudentmainviewpage.
TestResultFourstudentfunctionalitieshavebeenautomaticallygeneratedusingtheproposedtestcasegeneratorprototype.
ThegeneratedtestcasesarecomparedwiththetestcasesmanuallygeneratedbyAlshammari(2010).
Fromthiscomparison,itshowsthatthetestcasesgeneratedTestcasesforeachpathAllpossiblepaths:4pathsarecreatedProceedingsofthe3rdInternationalConferenceonComputingandInformatics,ICOCI2011,8-9June,2011Bandung,IndonesiaPaperNo.
021231bythedevelopedtestcasegeneratorprogramarethesameastheonemanuallyderived.
Therefore,itcanbeconcludedthattheproposedalgorithmisusableandreliable.
FUTUREWORKInthefuture,thisalgorithmcanbegeneralizedsothatitcanaccommodatevarioustestcoveragecriteriawithinthesametestderivationframework.
Thisprototypecanbeimprovedbydevelopingtheabilitytobuilddirectedgraphandparsetestcasesfromit.
TheUMLactivitydiagramsthathavebeenusedinthisresearchwereusingUML1.
0version.
Forthefuturework,theuseofUML2.
0notationisrecommended.
Additionally,theUMLactivitydiagramsweregeneratedmanuallyinthework;therefore,theuseofatoolthatisabletoautomaticallygeneratethesediagramsissuggested.
CONCLUSIONTheuseofactivegraphisagoodmethodtoensurethatthegenerationofthetestcasesautomaticallyusingtheproposedalgorithmanditsimplementation,andusingtheUMLactivitydiagramasabasetoguaranteetheabilityofautomaticimplementation.
Thereusabilityofthisresearchworkcanbeappliedtocompletefullautomaticanalysis.
ThistestwillopennewopportunitytodiscovernewtechniquesormethodsforthetestingusingUMLdiagramsandautomatictestcasesgeneration.
REFERENCESAlshammari,S.
A.
(2010).
GeneratingTestCasesforLearningZone.
Thesis,UUM.
Cartaxo,E.
,Neto,F.
,&Machado,P.
(2007).
TestCaseGenerationbymeansofUMLSequenceDiagramsandLabeledTransitionSystems.
IEEE,1292-1297.
Chen,M.
,Qiu,X.
,Xu,W.
,Wang,L.
,Zhao,J.
,&Li,X.
(2009).
UMLActivityDiagram-BasedAutomaticTestCaseGenerationForJavaPrograms.
TheComputerJournal,52(5),545-556.
Heumann,J.
(2001).
GeneratingTestCasesFromUseCases.
Retrieved5July,2010,from:http://www.
ibm.
com/developerworks/rational/library/content/RationalEdge/jun01/GeneratingTestCasesFromUseCasesJune01.
pdfJaved,A.
,Strooper,P.
,&Watson,G.
(2007).
AutomatedGenerationofTestCasesUsingModel-DrivenArchitecture.
IEEE,3-9.
Kim,H.
,Kang,S.
,Baik,J.
,&Ko,I.
(2007).
TestCasesGenerationfromUMLActivityDiagrams.
IEEE,556-561.
Kundu,D.
,&Samanta,D.
(2009).
ANovelApproachtoGenerateTestCasesfromUMLActivityDiagrams.
JournalofObjectTechnology,8(3),65-83.
Lilly,R.
,&G,U.
(2010).
ReliableMiningofAutomaticallyGeneratedTestCasesfromSoftwareRequirementsSpecification.
InternationalJournalofComputerScienceIssues,87-91.
Linzhang,W.
,Jiesong,Y.
,Xiaofeng,Y.
,Jun,H.
,Xuandong,L.
,&Guoliang,Z.
(2004).
GeneratingTestCasesfromUMLActivityDiagrambasedonGray-BoxMethod.
IEEE,284-291.
Mingsong,C.
,Xiaokang,Q.
,&Xuandong,L.
(2006).
AutomaticTestCaseGenerationforUMLActivityDiagrams.
ACM,2-8.
俄罗斯vps速度怎么样?俄罗斯vps云主机节点是欧洲十大节点之一,地处俄罗斯首都莫斯科,网络带宽辐射周边欧洲大陆,10G专线连通德国法兰克福、法国巴黎、意大利米兰等,向外连接全球。俄罗斯vps云主机速度快吗、延迟多少?由于俄罗斯数据中心出口带宽充足,俄罗斯vps云主机到全球各地的延迟、速度相对来说都不错。今天,云服务器网(yuntue.com)小编介绍一下俄罗斯vps速度及俄罗斯vps主机推荐!俄...
随着自媒体和短视频的发展,确实对于传统的PC独立网站影响比较大的。我们可以看到云服务器商家的各种促销折扣活动,我们也看到传统域名商的轮番新注册和转入的促销,到现在这个状态已经不能说这些商家的为用户考虑,而是在不断的抢夺同行的客户。我们看到Namecheap商家新注册域名和转入活动一个接一个。如果我们有需要新注册.COM域名的,只需要5.98美元。优惠码:NEWCOM598。同时有赠送2个月免费域名...
轻云互联成立于2018年的国人商家,广州轻云互联网络科技有限公司旗下品牌,主要从事VPS、虚拟主机等云计算产品业务,适合建站、新手上车的值得选择,香港三网直连(电信CN2GIA联通移动CN2直连);美国圣何塞(回程三网CN2GIA)线路,所有产品均采用KVM虚拟技术架构,高效售后保障,稳定多年,高性能可用,网络优质,为您的业务保驾护航。活动规则:用户购买任意全区域云服务器月付以上享受免费更换IP服...
studentmain为你推荐
主机租赁电脑租赁的缺点美国主机空间买空间网的美国主机咋样?租服务器租服务器是什么意思?注册国际域名哪里的国际域名注册便宜?vpsVPS是什么?免费网站域名申请哪有里可以申请免费域名的网站?国外主机空间可以购买国外主机(空间一样吗?)来做私服吗?成都虚拟空间虚拟主机哪家最好~~~重庆虚拟空间现在重庆那家主机空间最好?重庆网站空间重庆有没有发展空间?
已备案域名注册 出租服务器 光棍节日志 贵州电信宽带测速 淘宝双十一2018 php空间申请 阿里云浏览器 南通服务器 免费申请个人网站 789电视剧 网购分享 贵阳电信 lamp什么意思 cdn服务 闪讯网 weblogic部署 wannacry勒索病毒 tracert 文件传输 qq部落24-5 更多