基于遗传算法的软件测试技术文档格式.docx
- 文档编号:22462294
- 上传时间:2023-02-04
- 格式:DOCX
- 页数:22
- 大小:127.16KB
基于遗传算法的软件测试技术文档格式.docx
《基于遗传算法的软件测试技术文档格式.docx》由会员分享,可在线阅读,更多相关《基于遗传算法的软件测试技术文档格式.docx(22页珍藏版)》请在冰豆网上搜索。
AzadHindFauzMarg,Dwarka,Sector-3,NewDelhi-110078,India
Abstract
Theoverallaimofthesoftwareindustryistoensuredeliveryofhighqualitysoftwaretotheenduser.Toensurehighqualitysoftware,itisrequiredtotestsoftware.Testingensuresthatsoftwaremeetsuserspecificationsandrequirements.However,thefieldofsoftwaretestinghasanumberofunderlyingissueslikeeffectivegenerationoftestcases,prioritisationoftestcasesetcwhichneedtobetackled.Theseissuesdemandoneffort,timeandcostofthetesting.Differenttechniquesandmethodologieshavebeenproposedfortakingcareoftheseissues.Useofevolutionaryalgorithmsforautomatictestgenerationhasbeenanareaofinterestformanyresearchers.GeneticAlgorithm(GA)isonesuchformofevolutionaryalgorithms.Inthisresearchpaper,wepresentasurveyofGAapproachforaddressingthevariousissuesencounteredduringsoftwaretesting.
Keywords:
Softwaretesting,GeneticAlgorithm
1.Introduction
Testingisprimarilydoneonsoftwareaswellasinwebfortestingclientandserverarchitecture.Softwaretestingisoneofthemajorandprimarytechniquesforachievinghighqualitysoftware.Softwaretestingisdonetodetectpresenceoffaults,whichcausesoftwarefailure.However,softwaretestingisatimeconsumingandexpensivetask[29],[20],[28].Itconsumesalmost50%ofthesoftwaresystemdevelopmentresources[3],[20].Softwaretestingcanalsobedefinedasprocessofverifyingandvalidatingsoftwaretoensurethatsoftwaremeetsthetechnicalaswellasbusinessrequirementsasexpected[16].
Verificationisdonetoensurethatthesoftwaremeetsspecificationandisclosetostructuraltestingwhereasvalidationisclosetothefunctionaltestingandisdone
byexecutingsoftwareundertest(SUT)[18].Broadly,testingtechniquesincludefunctional(blackbox)andstructural(whitebox)testing.Functionaltestingisbased
onfunctionalrequirementswhereasstructuraltestingisdoneoncodeitself[13][10][24].Grayboxtestingishybridofwhiteboxtestingandblackboxtesting[8].
Testingcanbedoneeithermanuallyorautomaticallybyusingtestingtools.Itisfoundthatautomatedsoftwaretestingisbetterthanmanualtesting.However,veryfewtestdatagenerationtoolsarecommerciallyavailabletoday[14].Varioustechniqueshavebeenproposedforgeneratingtestdataortestcasesautomatically.Recently,lotofworkisbeingdonefortestcasesgenerationusingsoftcomputingtechniqueslikefuzzylogic,neuralnetworks,GA,geneticprogrammingandevolutionarycomputationprovidingkeystotheproblemareasofsoftwaretesting.
Evolutionarytestingisanemergingmethodologyforautomaticallyproducinghighqualitytestdata[10].GAiswellknownformoftheevolutionaryalgorithmsconceivedbyJohnHollandinUnitedStatesduringlatesixties[6][25].In[21],evolutionaryblackboxtestingisalsoappliedonembeddedsystemstotestitsfunctionalandnon-functionalproperties.GAhasbeenappliedinmanyoptimizationproblemsforgeneratingtestplansforfunctionalitytesting,feasibletestcasesandinmanyotherareas[5][15].GAhasalsobeenusedinmodelbasedtestcasegeneration[3][23][26][27].Inobjectorientedunittestingaswellasintheblackboxtesting,GAisusedforautomaticgenerationoftestcases[23],[10],[15].Concerningtestingofwebapplications,manytools,newtechniquesandmethodshavebeendevelopedtoaddressissueslikemaintainability,testability,security,performance,correctnessandreliabilityofwebapplication[8].Webapplicationsarecomposedofwebpagesandcomponentsandinteractionbetweenthemexecuteswebservers,HTTP,browser(theclientside)andnetworks.Awebpageisinformationviewedontheclientsideinasinglebrowserwindow[16].In[30],usersessiondataofwebapplicationisusedtogeneratetestcasesbyapplyingGA.
Inthisresearchpaper,asurveyofdifferentsoftwaretestingtechniqueswhereGAisefficientlyusedispresented.Thispaperisdividedinto4sections.Section2describesbrieflytheworkingofaGA.Insection3,applicationsofGAindifferenttypesofsoftwaretestingisdescribed.Section4concludesthepaperandgivesanoverviewofourfuturework.
2.GeneticAlgorithm:
ABriefIntroduction
Inthepast,evolutionaryalgorithmshavebeenappliedinmanyreallifeproblems.GAisonesuchevolutionary
algorithm.GAhasemergedasapractical,robustoptimizationtechniqueandsearchmethod.AGAisasearchalgorithmthatisinspiredbythewaynatureevolvesspeciesusingnaturalselectionofthefittestindividuals.
Thepossiblesolutionstoproblembeingsolvedarerepresentedbyapopulationofchromosomes.Achromosomeisastringofbinarydigitsandeachdigitthatmakesupachromosomeiscalledagene.Thisinitialpopulationcanbetotallyrandomorcanbecreatedmanuallyusingprocessessuchasgreedyalgorithm.ThepseudocodeofabasicalgorithmforGAisasfollows[6]:
-
Initialize(population)
Evaluate(population)
While(stoppingconditionnotsatisfied)
{
Selection(population)
Crossover(population)
Mutate(population)
}
GAusesthreeoperatorsonitspopulationwhicharedescribedbelow:
ΣSelection:
Aselectionschemeisappliedtodeterminehowindividualsarechosenformatingbasedontheirfitness.Fitnesscanbedefinedasacapabilityofanindividualtosurviveandreproduceinanenvironment.Selectiongeneratesthenewpopulationfromtheoldone,thusstartinganewgeneration.Eachchromosomeisevaluatedinpresentgenerationtodetermineitsfitnessvalue.Thisfitnessvalueisusedtoselectthebetterchromosomesfromthepopulationforthenextgeneration.
ΣCrossoverorRecombination:
Afterselection,thecrossoveroperationisappliedtotheselectedchromosomes.Itinvolvesswappingofgenesorsequenceofbitsinthestringbetweentwoindividuals.Thisprocessisrepeatedwithdifferentparentindividualsuntilthenextgenerationhasenoughindividuals.Aftercrossover,themutationoperatorisappliedtoarandomlyselectedsubsetofthepopulation.
ΣMutation:
Mutationalterschromosomesinsmallwaystointroducenewgoodtraits.Itisappliedtobringdiversityinthepopulation.
3.UsingGeneticAlgorithminSoftware
Testing
InthissectionwewilldiscussindetailtheapplicationsofGAindifferentareasoftestingliketestplanning[5],minimizationoftestcasesinregressiontesting[11],modelbasedtesting[3][23][26][27]andwebtesting[30].
3.1ApplicationsofGAinWhiteBoxTesting
Structuraltestingcanbedoneintheformofdataflowtestingorpathtesting.Pathtestinginvolvesgeneratingasetofpathsthatwillcovereverybranchintheprogramandfindingthesetoftestcasesthatwillexecuteeverypathinthissetofprogrampath[16][18].Indataflowtesting,thefocusisonthepointsatwhichvariablesreceivevaluesandthepointsatwhichthesevaluesareused[2].Next,wewilldiscussbrieflysomeoftheresearchworkregardingtheapplicationsofGAinwhiteboxtesting.
3.1.1DataFlowTesting
M.R.Girgis
Girgis[7]hasproposedastructuralorientedautomatictestdatagenerationtechniquethatusesaGAguidedbythedataflowdependenciesintheprogramtofulfiltheall-usescriterion.TheprogramtobetestedisconvertedintoaControlFlowGraph(CFG)whereeachnoderepresentsablockinaprogramandtheedgesoftheflowgraphdepictthecontrolflowofthestatements.
Variablesinaprogramundertestaredividedinto'
cuses'
and'
p-uses’variables.c-usesvariablesarethosewhichareusedincomputationsorasapredicatesinaprogramwhereasp-usesvariablesareassociatedwithedgesoftheflowgraph.Inordertofulfiltheall-usescriteria,thedef-clearpath(apathcontainingnonewdefinitionofacurrentvariable)fromeachdefinitionofavariabletoeachuseofthatvariableneedtobedetermined.Tofindoutthesetofpathssatisfyingallusescriteria,itisnecessarytodeterminedefc-use(dcu)anddefp-use(dpu)ofavariablei.e.thedef-clearpathstotheirc-useatnodeianddef-clearpathstotheirp-useatedge(i,j).
Usingthelocationofavariabledefsandusesinaprogramundertest,combinedwiththe‘Basicstatereachalgorithm’,thesetsdcu(i)anddpu(i,j)aredetermined.Fromthe‘Basicstatereachalgorithm’twosetsreach(i)andavail(i)aredeterminedwherereach(i)isthesetofallvariabledefsthat“reach”nodeiandsetavail(i)isthesetofall“available”variabledefsatnodeii.e.Theunionofsetofglobaldefsatnodeiandthesetofalldefsthatreachthisnode.
dcu(i):
reach(i)«
c-use(i)
(1)
dpu(i,j):
avail(i)«
p-use(i,j)
Listofalldcuanddpusetsintheprocedurecallssatisfyingtheall-usescriterionaredeterminedalongwithkillingnodes(nodescontainingotherdefinitionofavariableinacurrentpath)thatmustnotbeincludedinthecurrentpath.Inthisapproach,GAacceptsinstrumentedversionoftheprogramundertest,thelistofdef-usesetstobecovered,thenumberofinputvariables,andthedomainandtheprecisionofeachinputvariablesasaninput.Abinaryvectorisusedtorepresentachromosome.Thelengthoftheinputisdeterminedbythedomainandtheprecision.ThedomainisrepresentedbyDi=[ai,bi]whereeachvariableinaprogramtakesvaluesfromtherange[ai,bi].EachdomainDishouldbecutintoequalsizerangesifdecimalplacesdiisdesiredforavariab
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 遗传 算法 软件 测试 技术