华中科技大学硕士学位论文大型关系数据库自动化测试工具的设计与实现姓名:曹娜申请学位级别:硕士专业:计算机软件与理论指导教师:周英飚20090529IIIDatabaseapplicationsareincreasinglywidespreadandmoreandmoreimportantroleisplayednowadays,whilethesoftwareandnetworkapplicationsaredevelopingrapidly.Astheintegrityoffunctionalityandthestabilityofperformanceinthedatabasemakeadirectimpactontheefficiencyofthesoftwareimplementation,Thegraduallyimprovingimportanceintestingdatabaseisconsequent.Insoftwaretesting,onaccountofalargeworkloadinsoftwaretesting,theautomatedtechniquesinsoftwaretestingcangreatlyimprovethespeedandefficiencywhilethesoftwaredevelopmentcyclecanbeshortenandthecostoftestcanbereduced.Therefore,thetestautomationindatabasefunctionshasbeenturnedintotheinevitabletrendofdevelopmentinthisfield.However,thereisnonedevotedautomatedtestingtooltodothefunctionaltestingofthelarge-scalerelationaldatabases.Basedonthementionedrequirementsabove,theautomatedtestingtoolforlarge-scalerelationaldatabaseisdesignedanddevelopedtorealizetheautomatedtestingfunctions.Inthedesignoftestscriptlanguage,thetoolcomparestheadvantagesanddisadvantages.Besidesitanalyzesthecharacteristicsoffunctionaltestinginthelarge-scalerelationaldatabaseandselectsareadablereusableeasytomaintaintestscriptlanguage.Inordertoachieveeasypreparationoftestscript,atestscripteditorforthisscriptinglanguageisdesignedandexplored.Infunctionaldesignofthetool,itreferstheframeworkdesignideasofapopularautomatedtestingtoolandselectsthesuperiority.Thefunctionofthetoolhasbeendesignedtomakeabetterautomatedtestingfunction,amorestableperformanceandafasterimplementation.Thefunctionalimplementationofthetoolistouseobject-orientedsoftwaredesignmethodology,sothatthesoftwarecanbeconstructed,extendedandreused.Thetoolisprovedtobeabletocompletethefunctionoflarge-scalerelationaldatabaseautomatedtesting,whichimprovetheefficiencyofthetest.Keywords:large-scalerelationaldatabases,testautomation,functionaltesting,testscript?_____?“v”11.1[1][2,3]2[2005]5551.21.2.1[4-6]1[4,5]23[4,5]3[5-7]4excel[8-10]54[7,11]1.2.21RationalRobotRationalRobotIBMRationalRobotGUIHTML.NetJavaPowerBuilderOracleDelphiVisualBasicMFCRationalRobotSQABasic1RationalRobot2RationalRobot3IBMRationalTestManagerRationalRobot123RationalRobot123[5,12,13]2WinRunner5WinRunnerMercuryInteractiveWebERPCRMWinRunnerWinRunnerTSLWinRunnerMercuryInteractiveTestDirectorWinRunner1WinRunnerGUIMapGUIMapWinRunner2WinRunnerWinRunner3WinRunner1MercuryInteractiveTSL2[9,10]3QuickTestProfessionalQuickTestProfessionalQTPWinRunnerMercuryInteractiveQTPGUIWindowsWeb6VBScriptQTPQTPQuickTestProfessional123QuickTestProfessional1WinRunnerQTP23GUI[9,14,15]1.31XML27341.482.1[16]2.1.1[16,17]1Tab92.12.112234GUI[7,17,18]2102.22.2123GUI[8,17,18]32.3GUI[17,18]4112.3122.4GUI[9,17,18]52.5[11,17,18]122.4122.5126XML13XML(ExtensibleMarkupLanguage:)W3C(WorldideWeb:)XMLXML[19]XMLXMLXMLXMLXMLXML[19]XML[19]XML[19]XMLXMLXMLXMLXMLXMLSQL_CASECASEEXPRESULTfalse/CASEEXPRESULTTYPEDIRECT_EXECUTE_SUCCESS/TYPESQLCREATETABLETT/SQL/SQL_CASE142.1.2XML1[19,20]2.62.6DML_0XXXXDML_1XXXXDML_2XXXXDML_3XXXX00CREATETABLET00001_1(C1INT,C2CHAR(10))DIRECT_EXECUTE_SUCCESSSQLXMLSQLTESTCONTENT/CONTENTCONNECT0/CONNECTSQL_CASETYPEDIRECT_EXECUTE_SUCCESS/TYPE15SQLCREATETABLET00001_1(C1INT,C2CHAR(10));/SQL/SQL_CASE/SQLTESTSQLTEST/SQLTESTSQL_CASESQLSQLTYPE/TYPE2.XML[19]1SQLTESTXMLXMLXMLmainSQLTESTCONTENTSQL_CASECLEARSQLTESTCONTENT……../CONTENTSQL_CASE………./SQL_CASESQL_CASE………./SQL_CASECLEAR………./CLEAR/SQLTEST2CONTENTSQLTESTCONTENT16SQLTESTCONTENT/CONTENT………./SQLTEST3SQL_CASESQLTESTSQL_CASESQL_CASESQLTESTCONTENT/CONTENTCONNECT/SQL_CASETYPEDIRECT_EXECUTE_SUCCESS/TYPESQLCREATETABLET00001_1(C1INT,C2CHAR(10));/SQL/SQL_CASESQL_CASE………./SQL_CASE/SQLTESTSQL_CASESQLTYPERESULTXML2.72.7XMLXML17XML?xmlversion=1.0encoding=GB2312?!----!--1.--SQLTESTCONNECT0/CONNECTCONTENT…./CONTENTSQL_CASETYPEDIRECT_EXECUTE_SUCCESS/TYPESQLCREATETABLET00001_1(C1INT,C2CHAR(10));/SQLSQLINSERTINTOT00001_1VALUES(1,'ABC');/SQLSQLINSERTINTOT00001_1VALUES(2,'DEF');/SQL/SQL_CASECLEARSQL_CASETYPEDIRECT_EXECUTE_SUCCESS/TYPESQLDROPTABLET00001_1;/SQL/SQL_CASERECONNECT/RECONNECT/CLEAR18XML/SQLTEST2.2[21,22]1231945672.3202.3.1NET[23-25]XML2.3.2XML[26-27]XMLXMLXML2.12.1XML21XML2.3.3XML[32-34]2.22.2:1XML2.xml22provalues.proprovalues.proXMLdocumentloadXMLXMLLEVELprovalues.proLEVELSQLprovalues.proSQLSQL3DisposeTrans.exe,provalues.pro4provalues.proIP23TCP/IPSocketsuccessFail2.42.4.1XMLXML[17,35,36]2.32.31XML124SQL_CASE/SQL_CASESQL2SQL3.xml2XMLQTPWinrunnerQTPWinrunnerXML2.4.2[36,37]2.4252.412.xml345262.4.3[37,38]2.51NEWTRANS2XML27NEWTRANS2.52.4.4[37,39]2.6Socket28SocketSocket2.6QTPWebwindows2.51.QTPQTP29Webwindows2.30XML[39,40]3.1XML133.13.1SyntaxEditorCcomBoxListConnectNativeErrorFindResultSQLSQLTranFormType313.1.1SyntaxEditorSyntaxEditorSyntaxEditor3.13.1SyntaxEditorXMLInsertRow(stringsPrkey){intiTempStart=this.SelectionStart;//s