基于遗传算法的软件测试技术文档格式.docx

上传人:b****7 文档编号:22462294 上传时间:2023-02-04 格式:DOCX 页数:22 大小:127.16KB
下载 相关 举报
基于遗传算法的软件测试技术文档格式.docx_第1页
第1页 / 共22页
基于遗传算法的软件测试技术文档格式.docx_第2页
第2页 / 共22页
基于遗传算法的软件测试技术文档格式.docx_第3页
第3页 / 共22页
基于遗传算法的软件测试技术文档格式.docx_第4页
第4页 / 共22页
基于遗传算法的软件测试技术文档格式.docx_第5页
第5页 / 共22页
点击查看更多>>
下载资源
资源描述

基于遗传算法的软件测试技术文档格式.docx

《基于遗传算法的软件测试技术文档格式.docx》由会员分享,可在线阅读,更多相关《基于遗传算法的软件测试技术文档格式.docx(22页珍藏版)》请在冰豆网上搜索。

基于遗传算法的软件测试技术文档格式.docx

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

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 法律文书 > 起诉状

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1