数据库应用程序测试中英文对照外文翻译文献Word文档下载推荐.docx
《数据库应用程序测试中英文对照外文翻译文献Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《数据库应用程序测试中英文对照外文翻译文献Word文档下载推荐.docx(7页珍藏版)》请在冰豆网上搜索。
1.Introduction
Databasesplayapivotalroleinalmosteveryorganizationintoday’sinformation-basedsociety.CommercialDatabasemanagementsystems(DBMSs)provideorganizationswithefficientaccesstohugeamountsofdatawithoutaffectingtheintegrityofdataandrelievingtheuseroftheanyneedtounderstandthelow-levelimplementationdetails.OvertheyearstremendouseffortshavebeendevotedtoensuringuseofefficientandintegrityprotectingdatastructuresandalgorithmsbyDBMSs.However,littlehasbeendonetodevelopsystematictechniquesforensuringcorrectnessofapplicationsusingtheseDBMSs.Manytestingtechniqueshavebeendevelopedtohelpensurethatbehaviourofaprogramisinaccordancewiththespecifications.However,thesetechniquesmostlytargetprogramswrittenintraditionalimperativelanguagesandcan’tbeofmuchhelpwhenitcomestodatabaseapplications.Likeanyotherprogram,databaseapplicationprogramcanbeviewedasanattempttoimplementafunction.Consideredthisway,boththeinputandoutputspacesofthisfunctionwillincludedatabasestateapartfromtheexplicitinputandoutputparametersoftheapplication.Thisaffectssubstantiallythewayatestcaseisdefined,generatedandexecutedtocheckcorrectnessofapplication.Hencethereisaneedfornewapproachesspecificallyorientedtowardstestingdatabaseapplications.
Testingdatabaseapplicationprogramsinvolvesthefollowingphases:
•Extractionofinformationfromdatabaseschema
•GenerationoftestdataandPopulatingtestdatabase
•Generationoftestcasesasinputtotheapplicationprogram
•Validationofdatabasestateandoutputafterexecution
Usinglivedatahasseverallimitations.Itmaynotreflectsufficientlywidevarietyofpossiblesituationsandevenifitdoes,itmightbedifficulttofindtheminalargedatabase.Secondly,privacyorsecurityconstraintsmightpreventtheuserfromseeingsensitivedata.Hence,variousmethodsforgeneratingsynthetictestdatahavebeenproposed.Whengeneratingdataandpopulatingthetestdatabase,itsimportanttogeneratevalidandinterestingdatae.g.itwouldbeadvisabletoselectdatasoastoincludesituationswhichthetesterbelievesarelikelytooccurorwillexposefaultsinapplication.Thetechniqueusedfortestdatagenerationwilldeterminetheextentofcoverageoftestdatabase.Selectingagoodinitialdatabasestatesoastoincludeawidevarietyofscenariosresemblingrealdatafortheparticularapplicationisverybeneficial.Sincedatabasestateplaysanimportantroleindeterminingtheoutput,ithastobecheckedaftereachexecutionthatonlythespecifiedmodificationsandnoneothershaveoccurred.
2.AGENDA-toolsetfortestingDBapplications
AGENDAisatoolsethasbeendesigned.AGENDAtakesasinputtheapplicationdatabaseschema,applicationsourcecodeandfilescontainingsamplevalueswhichcontainsuggestedvaluesfortheattributesprovidedbytheuser.Theuserinteractivelyselectstestheuristicsandprovidesinformationaboutexpectedbehaviouroftestcases.UsingthisinformationAGENDA,populatesthedatabase,generatesinputstotheapplication,executestheapplicationonthoseinputsandcheckssomeaspectsofcorrectnessoftheresultingdatabasestateandapplicationoutput.1
3.InputGenerator:
ItgeneratestheinputdatatobesuppliedtotheapplicationbyusinginformationderivedfromAgendaparserandStategeneratorinadditiontotheinformationgainedbyparsingtheSQLstatementsintheapplicationprogramandinformationusefulforcheckingtestresults.Informationderivedfromparsingthesourcecodemaybeusefulinsuggestinginputsthattestershouldsupplytotheapplication.Theinputgeneratorthusgeneratestestinputsbyinstantiatingtheinputparameterswithactualparameters.
4.StateValidator:
ThevalidatormonitorsthechangeinapplicationDBstateduringexecutionofatest.Itautomaticallylogsthechangesintheapplicationtablesandsemi-automaticallychecksthestatechange.
5.OutputValidator:
Itcapturestheapplication’soutputsandchecksthemagainstthequerypreconditionsandpostconditionsthathavebeengeneratedbythetoolorsuppliedbythetester.
6.DesignandImplementation
6.1Parsingtool
TheAgendaParsingtoolisbasedonPostgresSQLparser.PostgresSQLparsercreatesanAbstractSyntaxTreecontainingrelevantinformationabouttables,attributesandconstraintsfromagivenschema.However,thisinformationisspreadoutatdifferentlocationsinthetree.Inaddition,itispossibletohavedifferenttreestructureshavingthesameunderlyinginformationaboutthetables,becauseofuseofdifferentSQLDDLsyntacticconstructsexpressingthesameinformation.Consequently,theexactlocationofrelevantinformationdependsontheexactsyntaxofschemadefinition.SomeoftheinformationfromDBMS’sinternalcatalogtablesisneededbyothercomponentsofAGENDA.AllowingthemtodirectlyquerythesetableswouldhaveintroducedinterdependencybetweenAGENDAcomponentswhichisnotdesirable.HencealltheinformationthatneedstobeprocessedisstoredinAgendaDBwhichismadeavailabletoothercomponents.ThisdecouplingofPostgresSQLfromrestofthecomponentsallowsAGENDAtobeportedtodifferentDBMSjustbychangingtheParser.TheParserextractsinformationaboutintegrityconstraintssuchasuniquenessconstraints,referentialconstraintsandnotNULLconstraintsfromschema.Italsoextractslimitedinformationfromsemanticconstraints,particularlyboundaryvalues.Thisisveryusefulinautomaticdata-partitioningandinputgeneration.Next,theAgendaParserparsesthesample-valuefilescontaininguser-supplieddataandstoresthesamplevalues,theirdatagroupsandassociatedattributesintheAgendaDB.Attributesinvolvedincompositeconstraintsaremarkedsothattheycanbecorrectlyhandledbyinputgenerator.
7ExtensionstoAGENDA
7.1TestingWebDBapplications
WiththetremendousgrowthofWorldWideWeb,manynewweb-basedservicesthataredrivenbydatastoredindatabasesaregainingimportance.ExamplesincludeE-commerceapplicationssuchasonlinestores,andbusiness-to-businesssupportproducts.Someoftheseareofcriticalimportanceandhenceitisessentialtoensuretheircorrectfunctioning.MostwebDBapplicationsconsistofthreeslayers-atthebaseisDBMSandadatabase,atthetopisclientwebbrowserandinbetweenliestheapplicationlogic-usuallydevelopedwithaserver-sidescriptinglanguageorJavaextendedwithlibrarythatcaninterfacewithDBMSs,andcandecodeandproduceHTMLpagesdisplayedintheclientbrowser.Forawebapplicationatestcaseisconsideredasasequenceofpagestobevisitedalongwiththeinputvaluestobeprovidedtothepagescontainingforms.Thewhiteboxapproachinvolvesfollowingsteps:
1.Informationextractionfromapplicationsource:
UsefulinformationsuchasURLlinks(whichincludesallotherURLsthatcanbereachedfromthecurrentpage)andparameterinformation(name-valuepairsthatarepassedtotheServlet)foreachURLisextractedfromapplicationsource.URLsarepartitionedintotwocategoriesdependingontheircontent-staticanddata-based(dynamic)page.
2.Webapplicationgraphgenerationandpathselection:
Basedontheinformationextractedearlier,anapplicationgraph,whereeachnoderepresentsaURLandedgesrepresentURLlinks,isgeneratedandthensimplifiedaccordingtoURLlinktypes.ThereisanedgefromURLAtoURLBifURLAproducesalinktoURLBintheHTMLpageitgenerates.PathsthroughthegraphrepresentnaturalsequencesofexecutionofURLsasausernavigatesthroughthewebapplication.Hence,someofthesepathsareselectedastestcasestorepresentpossiblescenariosofuseoftheapplication.
3.InputGeneration:
Foreachpathselected,AGENDAisusedtogenerateinputsforeachURL.Thepathalongwithinputsconstituteatestcase.AnXMLfileisgeneratedcorrespondingtoeachsuchtestcase.
4.TestExecution:
TheXMLfileisparsedusingXMLparsertoextractURLinformationandthetestcaseisexecutedautomaticallyusingopensourceJakartaHttpClientintegratedwithAGENDA.Afterexecutionofeachupdateorinsertion,AGENDAchecksthenewdatabasestates.Outputpagesarecheckedbymanualinspectionorothertools.ThetoolinitscurrentformistargetedtotheJavaServletmodel,usingJDBCfordatabaseaccess,andmakessomeassumptionsaboutprogrammingstyle.However,thebasictechniquecanbeappliedtomoregeneralservletstylesandotherwebapplicationlanguages.
8.RegressionTestsForDatabaseApplications
Anyapplicationisconstantlygoingthroughtheprocessofevolutionsuchasitscomponentsgettingreplacedwithmorepowerfulcomponents,variousoptimizationsbeingincorporatedandsoon.Wheneversuchmodificationisintroducedinanapplication,itisimportanttocheckfortheintegrityoftheapplicationandthatisthepurposeofregressiontests.Therearevarioustoolsbuiltforautomatingtheregressiontestingprocedure,mostpopularbeingJUnitframeworkdevelopedforcarryingoutregressiontestsforJavaapplications.Databaseapplicationswhicharecomposedofmanylayersandstackedinvariouslayersare,inparticular,subjecttoconstantchangeforinstancere-engineeringofbusinessprocesses,authorizationrulesbeingchangedetc.Changingdatabaseapplicationsisverycostlyandinvolvesgreatdealofmanualworksincetherearen’tanytoolsavailablethatcanautomaticallycarryingoutregressiontestsonthem.
9.ConclusionsandFutureWork
TheAGENDAtoolsetwasdesignedandimplementedinrespo