WO2022227314A1 - Method and apparatus for dynamic synchronous testing, device, and storage medium - Google Patents

Method and apparatus for dynamic synchronous testing, device, and storage medium Download PDF

Info

Publication number
WO2022227314A1
WO2022227314A1 PCT/CN2021/109147 CN2021109147W WO2022227314A1 WO 2022227314 A1 WO2022227314 A1 WO 2022227314A1 CN 2021109147 W CN2021109147 W CN 2021109147W WO 2022227314 A1 WO2022227314 A1 WO 2022227314A1
Authority
WO
WIPO (PCT)
Prior art keywords
sql
variable
script
tested
executed
Prior art date
Application number
PCT/CN2021/109147
Other languages
French (fr)
Chinese (zh)
Inventor
李武钊
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2022227314A1 publication Critical patent/WO2022227314A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Definitions

  • the identification module is used to identify the input parameters of each of the SQL single-step statements through the Eclipse tool, and obtain an input parameter list corresponding to each of the SQL single-step statements;
  • a connection to the source database corresponding to the database information is established through the Mybatis tool, and a single-step parsing process is performed on the script to be executed to generate at least An SQL single-step statement, including:

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A method and apparatus for dynamic synchronous testing, a device, and a storage medium, which relate to the field of functional testing. The method comprises: acquiring a file to be tested, said file to be tested comprising database information, a script to be executed, and a variable test list (S10); establishing a connection to a source database corresponding to the database information by means of a MyBatis tool, performing single-step parsing on the script to be executed, and generating at least one SQL single-step statement (S20); performing input parameter identification on each SQL single-step statement by means of an Eclipse tool, and obtaining an input parameter list (S30); performing dynamic script generation on each SQL single-step statement according to the variable test list and the input parameter list and by means of the Eclipse tool, and generating an SQL single-step script to be tested (S40); performing synchronous testing on all SQL single-step scripts to be tested by means of the MyBatis tool, and obtaining a single-step result (S50); and outputting a test result corresponding to the file to be tested (S60). The present method thus implements automated dynamic generation of an SQL single-step script to be tested by means of a MyBatis tool and an Eclipse tool and performs concurrent testing and test result output, a testing cycle is shortened, and testing costs are reduced.

Description

动态同步测试方法、装置、设备及存储介质Dynamic synchronization test method, device, equipment and storage medium
本申请要求于2021年4月25日提交中国专利局、申请号为202110449563.9,发明名称为“动态同步测试方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number of 202110449563.9 and the invention titled "Dynamic Synchronization Test Method, Device, Equipment and Storage Medium", which was filed with the China Patent Office on April 25, 2021, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请涉及功能测试技术领域,尤其涉及一种动态同步测试方法、装置、设备及存储介质。The present application relates to the technical field of functional testing, and in particular, to a dynamic synchronization testing method, apparatus, device and storage medium.
背景技术Background technique
目前,发明人发现基于java的网页开发技术中,Mybatis已经成为网页的持久层框架的主流,对于网页的测试大部分是基于Mybatis编写测试代码,而这些测试代码均为测试人员根据不同的入参拼接不同的SQL语句编写获得,在此编写过程中测试人员往往人工判断测试代码是否存在语法错误,面对现在版本更新频繁以及复杂的网页,很容易出现人工误判的情况,而且每次修改完语法错误后都需要对整体进行重新编译及运行,才能输出测试结果,并人工判断测试结果是否符合预期结果,因此,整个测试周期长,测试效率低下,并且要求测试人员具有较强的编码能力,导致测试工作费力、费时、成本高。At present, the inventor found that Mybatis has become the mainstream of the persistence layer framework of web pages in the web page development technology based on java. It is obtained by splicing different SQL statements. During the writing process, testers often manually judge whether the test code has grammatical errors. In the face of frequent version updates and complex webpages, manual misjudgment is easy to occur, and each modification is completed. After a syntax error, the whole needs to be recompiled and run to output the test results and manually judge whether the test results meet the expected results. Therefore, the entire test cycle is long, the test efficiency is low, and the testers are required to have strong coding skills. This results in laborious, time-consuming, and high-cost testing.
发明内容SUMMARY OF THE INVENTION
本申请提供一种动态同步测试方法、装置、计算机设备及存储介质,实现了通过Mybatis工具和Eclipse工具自动动态生成SQL待测试单步脚本以及并行测试输出测试结果,无需人工解读和编写,降低了测试人员的要求门槛,缩短了测试周期,提高了测试效率,节省了测试成本。The present application provides a dynamic synchronization test method, device, computer equipment and storage medium, which realizes the automatic and dynamic generation of SQL single-step scripts to be tested and parallel test output test results through the Mybatis tool and the Eclipse tool, without manual interpretation and writing, reducing the need for manual interpretation and writing. The tester's requirement threshold shortens the test cycle, improves the test efficiency and saves the test cost.
一种动态同步测试方法,包括:A dynamic synchronization test method, comprising:
获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;Obtain a file to be tested; the file to be tested includes database information, a script to be executed and a variable test list;
通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;Establish a connection to the source database corresponding to the database information through the Mybatis tool, and perform single-step parsing processing on the script to be executed to generate at least one SQL single-step statement;
通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;Through the Eclipse tool, the input parameters are identified for each of the SQL single-step statements, and the input parameter list corresponding to each of the SQL single-step statements is obtained;
通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本;Through the Eclipse tool, according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements, dynamic script generation processing is performed on each of the SQL single-step statements, and the corresponding SQL single-step statements are generated. The SQL to be tested single-step script corresponding to the step statement;
通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;Through the Mybatis tool, synchronous testing is performed on all the SQL single-step scripts to be tested, and the single-step results corresponding to each of the SQL single-step statements are obtained;
根据所有所述单步结果,输出与所述待测文件对应的测试结果。According to all the single-step results, test results corresponding to the files to be tested are output.
一种动态同步测试装置,包括:A dynamic synchronization test device, comprising:
获取模块,用于获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;an acquisition module for acquiring a file to be tested; the file to be tested includes database information, a script to be executed and a variable test list;
解析模块,用于通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;A parsing module, used for establishing a connection with the source database corresponding to the database information through the Mybatis tool, and performing single-step parsing processing on the script to be executed to generate at least one SQL single-step statement;
识别模块,用于通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;The identification module is used to identify the input parameters of each of the SQL single-step statements through the Eclipse tool, and obtain an input parameter list corresponding to each of the SQL single-step statements;
生成模块,用于通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本;The generation module is used to perform dynamic script generation processing on each of the SQL single-step statements according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements through the Eclipse tool. The SQL single-step script to be tested corresponding to each of the SQL single-step statements;
测试模块,用于通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;A test module is used to perform a synchronous test on all the SQL single-step scripts to be tested by the Mybatis tool, and obtain a single-step result corresponding to each of the SQL single-step statements;
输出模块,用于根据所有所述单步结果,输出与所述待测文件对应的测试结果。An output module, configured to output test results corresponding to the files to be tested according to all the single-step results.
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer-readable instructions:
获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;Obtain a file to be tested; the file to be tested includes database information, a script to be executed and a variable test list;
通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;Establish a connection to the source database corresponding to the database information through the Mybatis tool, and perform single-step parsing processing on the script to be executed to generate at least one SQL single-step statement;
通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;Through the Eclipse tool, the input parameters are identified for each of the SQL single-step statements, and the input parameter list corresponding to each of the SQL single-step statements is obtained;
通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本;Through the Eclipse tool, according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements, dynamic script generation processing is performed on each of the SQL single-step statements, and the corresponding SQL single-step statements are generated. The SQL to be tested single-step script corresponding to the step statement;
通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;Through the Mybatis tool, synchronous testing is performed on all the SQL single-step scripts to be tested, and the single-step results corresponding to each of the SQL single-step statements are obtained;
根据所有所述单步结果,输出与所述待测文件对应的测试结果。According to all the single-step results, test results corresponding to the files to be tested are output.
一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more readable storage media storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the following steps:
获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;Obtain a file to be tested; the file to be tested includes database information, a script to be executed and a variable test list;
通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;Establish a connection to the source database corresponding to the database information through the Mybatis tool, and perform single-step parsing processing on the script to be executed to generate at least one SQL single-step statement;
通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;Through the Eclipse tool, the input parameters are identified for each of the SQL single-step statements, and the input parameter list corresponding to each of the SQL single-step statements is obtained;
通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本;Through the Eclipse tool, according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements, dynamic script generation processing is performed on each of the SQL single-step statements, and the corresponding SQL single-step statements are generated. The SQL to be tested single-step script corresponding to the step statement;
通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;Through the Mybatis tool, synchronous testing is performed on all the SQL single-step scripts to be tested, and the single-step results corresponding to each of the SQL single-step statements are obtained;
根据所有所述单步结果,输出与所述待测文件对应的测试结果。According to all the single-step results, test results corresponding to the files to be tested are output.
本申请提供的动态同步测试方法、装置、计算机设备及存储介质,通过获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本;通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;根据所有所述单步结果,输出与所述待测文件对应的测试结果,如此,本申请实现了通过Mybatis工具,对待测文件中的待执行脚本进行单步解析处理,得到多个SQL单步语句,再通过Eclipse工具进行入参识别,并动态脚本生成多个SQL待测试单步脚本,最后运用Mybatis工具进行同步测试获得待测文件的测试结果,因此,通过Mybatis工具和Eclipse工具自动动态生成SQL待测试单步脚本以及并行测试输出测试结果,完成无需测 试人员解读待测文件和编写测试用例,并无需人工判断语法错误,以及无需修改后进行整体编译及运行才输出测试结果,降低了测试人员的要求门槛,缩短了测试周期,提高了测试效率,节省了测试成本。The dynamic synchronization test method, device, computer equipment and storage medium provided by this application are obtained by obtaining a file to be tested; the file to be tested includes database information, a script to be executed and a variable test list; the Mybatis tool is used to establish a corresponding database information. The connection of the source database, and the single-step parsing process is performed on the script to be executed to generate at least one SQL single-step statement; through the Eclipse tool, each described SQL single-step statement is input parameter identification, and obtained and each described SQL One-to-one corresponding input parameter list of single-step statements; through the Eclipse tool, according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements, dynamically perform a dynamic analysis on each of the SQL single-step statements Script generation processing, generating the SQL single-step script to be tested corresponding to each of the SQL single-step statements; through the Mybatis tool, synchronously testing all the SQL to-be-tested single-step scripts to obtain and each of the SQL single-step scripts The single-step result corresponding to the statement; according to all the single-step results, the test results corresponding to the file to be tested are output. In this way, the present application realizes the single-step analysis processing of the script to be executed in the file to be tested through the Mybatis tool , get multiple SQL single-step statements, and then use the Eclipse tool to identify the input parameters, and dynamically generate multiple SQL single-step scripts to be tested, and finally use the Mybatis tool to perform synchronous testing to obtain the test results of the files to be tested. Therefore, through Mybatis Tools and Eclipse tools automatically and dynamically generate SQL single-step scripts to be tested and output test results in parallel tests, which eliminates the need for testers to interpret the files to be tested and write test cases, and does not require manual judgment of syntax errors, as well as the need for overall compilation and running after modification. Output test results, lower the tester's requirement threshold, shorten the test cycle, improve the test efficiency, and save the test cost.
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below, and other features and advantages of the application will become apparent from the description, drawings, and claims.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. , for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative labor.
图1是本申请一实施例中动态同步测试方法的应用环境示意图;1 is a schematic diagram of an application environment of a dynamic synchronization test method in an embodiment of the present application;
图2是本申请一实施例中动态同步测试方法的流程图;2 is a flowchart of a dynamic synchronization test method in an embodiment of the present application;
图3是本申请一实施例中动态同步测试方法的步骤S20的流程图;3 is a flowchart of step S20 of the dynamic synchronization test method in an embodiment of the present application;
图4是本申请一实施例中动态同步测试方法的步骤S202的流程图;4 is a flowchart of step S202 of the dynamic synchronization test method in an embodiment of the present application;
图5是本申请一实施例中动态同步测试方法的步骤S204的流程图;5 is a flowchart of step S204 of the dynamic synchronization test method in an embodiment of the present application;
图6是本申请一实施例中动态同步测试方法的步骤S50的流程图;6 is a flowchart of step S50 of the dynamic synchronization test method in an embodiment of the present application;
图7是本申请一实施例中动态同步测试方法的步骤S502的流程图;7 is a flowchart of step S502 of the dynamic synchronization test method in an embodiment of the present application;
图8是本申请一实施例中动态同步测试装置的原理框图;8 is a schematic block diagram of a dynamic synchronization test device in an embodiment of the present application;
图9是本申请一实施例中动态同步测试装置中的解析模块的原理框图;9 is a schematic block diagram of a parsing module in a dynamic synchronization test device in an embodiment of the present application;
图10是本申请一实施例中计算机设备的示意图。FIG. 10 is a schematic diagram of a computer device in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
本申请提供的动态同步测试方法,可应用在如图1的应用环境中,其中,客户端(计算机设备)通过网络与服务器进行通信。其中,客户端(计算机设备)包括但不限于为各种个人计算机、笔记本电脑、智能手机、平板电脑、摄像头和便携式可穿戴设备。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The dynamic synchronization test method provided by the present application can be applied in the application environment as shown in FIG. 1 , wherein the client (computer device) communicates with the server through the network. Among them, the client (computer equipment) includes but is not limited to various personal computers, notebook computers, smart phones, tablet computers, cameras and portable wearable devices. The server can be implemented as an independent server or a server cluster composed of multiple servers.
在一实施例中,如图2所示,提供一种动态同步测试方法,其技术方案主要包括以下步骤S10-S60:In one embodiment, as shown in FIG. 2 , a dynamic synchronization test method is provided, and the technical solution mainly includes the following steps S10-S60:
S10,获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单。S10: Obtain a file to be tested; the file to be tested includes database information, a script to be executed, and a variable test list.
可理解地,所述待执行脚本为需要测试的XML格式的网页脚本,所述数据库信息为所述待执行脚本需要访问的数据库的相关信息,例如:数据库信息包括数据表名,数据表字段,数据库对象(存储过程、视图、自定义函数、内置函数)、数据库类型、sql语言关键词等,其中该数据库的存储结构为json文件或Redis中的HashMap,所述json(JavaScript Object Notation,JS对象简谱)文件指一种轻量级的数据交换格式的文件,Redis(Remote Dictionary Server),即远程字典服务,是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的接口,HashMap为基于哈希表的Map接口的实现映射操作,所述变量测试清单为测试时输入的入参的集合以和预期的出参集合,所述待测文件为测试人员在对所述待执行脚本进行测试时收集的所述数据库信息、所述待执行脚本和所述变量测试清单。Understandably, the script to be executed is a web page script in XML format that needs to be tested, and the database information is the relevant information of the database that the script to be executed needs to access, for example: the database information includes a data table name, a data table field, Database objects (stored procedures, views, custom functions, built-in functions), database types, sql language keywords, etc., where the storage structure of the database is a json file or a HashMap in Redis, the json (JavaScript Object Notation, JS object Notation) file refers to a lightweight data exchange format file, Redis (Remote Dictionary Server), that is, remote dictionary service, is an open source log written in ANSI C language, supports network, and can be memory-based or persistent. type, Key-Value database, and provides interfaces in multiple languages, HashMap is the implementation mapping operation of the Map interface based on the hash table, and the variable test list is the set of input parameters input during the test and the expected set of output parameters , the to-be-tested file is the database information, the to-be-executed script and the variable test list collected by the tester when testing the to-be-executed script.
其中,XML指可扩展标记语言(eXtensible Markup Language),XML被设计用来传输 和存储数据,主要是定义使用标签来表示数据的标记语言的语法。Among them, XML refers to eXtensible Markup Language (eXtensible Markup Language). XML is designed to transmit and store data, mainly to define the syntax of markup language that uses tags to represent data.
S20,通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句。S20: Establish a connection to the source database corresponding to the database information by using the Mybatis tool, and perform single-step parsing processing on the script to be executed to generate at least one SQL single-step statement.
可理解地,所述Mybatis工具为常用的数据库持久层技术的工具,通过Mybatis工具可以设计出与之对应的数据库操作程序单元关联的各个模块功能,即MappedStatement接口,所述MappedStatement接口描述<select|update|insert|delete>或者@Select、@Update等注解配置的与SQL相关的信息。用于实现对包含一条或多条sql语句的XML文件配对生成java程序的接口Mapper文件,其中,所述Mapper文件是用于管理SQL语句的文件,所述Mapper文件分别对相应数据库的查询,***,修改,删除操作的管理,通过所述Mybatis工具根据所述数据库信息建立与其的连接,并根据所述数据库信息构建与该数据库的MappedStatement接口,同时进行所述单步解析处理,所述单步解析处理的过程为对所述待执行脚本进行语法检测和变量检测,再通过校验结果对该待执行脚本修正处理,从修正处理后的所述待执行脚本中解析出与SQL相关的语句,生成Mapper文件,再从该Mapper文件中拆分出独立的SQL语句的过程,解析出与SQL相关的语句的过程为识别出SQL语句中的首尾并通过句首的字符串确定出该SQL语句的类型,并通过与该SQL语句的类型相匹配的句首符和句末符标注,SQL类型包括insert类型(***语句),update类型(更新语句),delete类型(删除语句)、select类型(查询语句)等等,根据解析的SQL类型,检测与所述Mapper文件对应的所述待执行脚本中的语法和变量是否错误,再通过检测结果对该待执行脚本进行修正处理,输出可执行脚本,从该可执行脚本中的拆分出多个所述SQL单步语句,从而得到各个SQL单步语句,所述SQL单步语句为一个可以执行的SQL语句。Understandably, the Mybatis tool is a commonly used tool for database persistence layer technology, and each module function associated with the corresponding database operation program unit can be designed through the Mybatis tool, that is, the MappedStatement interface, which describes the MappedStatement interface <select| update|insert|delete> or the SQL-related information configured by annotations such as @Select and @Update. An interface Mapper file for realizing the pairing of XML files containing one or more SQL statements to generate a Java program, wherein the Mapper file is a file for managing SQL statements, and the Mapper file queries the corresponding database, inserting , modify, delete operation management, establish a connection to it according to the database information through the Mybatis tool, and build a MappedStatement interface with the database according to the database information, and perform the single-step parsing process at the same time, the single-step The process of parsing processing is to perform syntax detection and variable detection on the script to be executed, and then modify the script to be executed through the verification result, and parse the SQL-related statement from the script to be executed after the correction processing, The process of generating a Mapper file, and then splitting an independent SQL statement from the Mapper file. The process of parsing SQL-related statements is to identify the beginning and end of the SQL statement and determine the SQL statement through the string at the beginning of the sentence. Type, and marked by the sentence start and end characters that match the type of the SQL statement. SQL types include insert type (insert statement), update type (update statement), delete type (delete statement), select type (query statement) and so on, according to the parsed SQL type, detect whether the syntax and variables in the script to be executed corresponding to the Mapper file are wrong, and then perform correction processing on the script to be executed through the detection result, and output the executable script, Splitting a plurality of the SQL single-step statements from the executable script, thereby obtaining each SQL single-step statement, the SQL single-step statement is an executable SQL statement.
在一实施例中,如图3所示,所述步骤S20中,即通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句,包括:In one embodiment, as shown in FIG. 3 , in the step S20, a connection to the source database corresponding to the database information is established through the Mybatis tool, and a single-step parsing process is performed on the script to be executed to generate at least An SQL single-step statement, including:
S201,通过所述Mybatis工具,创建连接接口和与所述数据库信息对应的数据库配置文件,并通过所述数据库配置文件建立与所述源数据库的连接。S201, through the Mybatis tool, create a connection interface and a database configuration file corresponding to the database information, and establish a connection with the source database through the database configuration file.
可理解地,根据所述数据库信息和预先设定的参数,创建与其对应的所述连接接口和所述数据库配置文件,所述预先设定的参数包括数据库连接数及连接标识名等等,所述连接接口为MappedStatement接口,所述数据库配置文件为基于Mybatis工具连接所述源数据库的文件,通过连接所述源数据库才能进行后续的测试。Understandably, according to the database information and preset parameters, the corresponding connection interface and the database configuration file are created, and the preset parameters include the number of database connections and the connection identifier, etc. The connection interface is a MappedStatement interface, and the database configuration file is a file for connecting to the source database based on the Mybatis tool, and subsequent tests can be performed only by connecting to the source database.
S202,根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果。S202, according to the variable test list, perform syntax detection and variable detection on the script to be executed to obtain a detection result.
可理解地,通过相似匹配算法,快速查询出所述待执行脚本中所有与SQL语法相关的相同或相似的字符串,并对查询到的字符串进行序列标注,生成SQL语法文本,运用语法规则模型对序列标注后的字符串进行规则校验,所述规则校验的处理过程为通过语法规则模型将所述SQL语法文本中的字符串进行字符向量转换,通过字符向量转换后的字符串进行上下文规则识别,识别出与该字符串映射的符合SQL语句的SQL语法的字符串,即根据该字符串的向量和与该字符串向量的相邻的上下文的字符串进行该字符串的语法语义特征提取,对提取出该字符串的语法语义特征进行分类,得到与该字符串匹配的符合SQL语法的字符串结果。Understandably, through the similarity matching algorithm, all identical or similar strings related to SQL syntax in the script to be executed can be quickly queried, and the queried strings can be sequence-labeled to generate SQL syntax text and apply syntax rules. The model performs rule verification on the string after the sequence labeling, and the processing process of the rule verification is to perform character vector conversion on the character string in the SQL grammar text through the grammar rule model, and perform the character vector conversion on the character vector. Context rule identification, identifying the string that is mapped to the string and conforming to the SQL syntax of the SQL statement, that is, the grammatical semantics of the string is carried out according to the vector of the string and the string of the context adjacent to the string vector Feature extraction: classify the grammatical and semantic features of the extracted string, and obtain a string result that matches the string and conforms to the SQL syntax.
其中,将所述SQL语法文本中与所述字符串结果为不属于语法字符串对应的字符串从所述SQL语法文本中去除,再从所述待执行脚本中去除所述SQL语法文本中的字符串,将所述待执行脚本去除后剩下的文本确定为变量文本,通过字符串匹配算法,将所述变量文本中的字符串与所述变量测试清单中的源变量进行匹配,根据匹配结果标记出所述变量文本中的变量,以及得到与该变量对应的变量结果,所述变量结果为在所述变量测试清单 中与其匹配度最高的变量,根据所有所述字符串结果和所有所述变量结果进行汇总得到所述检测结果。Wherein, the strings in the SQL grammar text that correspond to the result that the strings do not belong to the grammar strings are removed from the SQL grammar text, and then the strings in the SQL grammar text are removed from the script to be executed String, the remaining text after the script to be executed is removed is determined as variable text, and the string in the variable text is matched with the source variable in the variable test list through a string matching algorithm. The result marks the variable in the variable text, and obtains the variable result corresponding to the variable, the variable result is the variable with the highest matching degree in the variable test list, according to all the string results and all The test results are obtained by summarizing the results of the aforementioned variables.
在一实施例中,如图4所示,所述步骤S202中,即所述根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果,包括:In one embodiment, as shown in FIG. 4 , in step S202, that is, performing syntax detection and variable detection on the script to be executed according to the variable test list to obtain a detection result, including:
S2021,对所述待执行脚本进行序列标注,得到标注文本。S2021, performing sequence annotation on the script to be executed to obtain annotated text.
可理解地,对所述待执行脚本中的各个字符串进行顺序标注,无需对无用的符号进行标注,得到所述标注文本,如此,只需对字符串进行处理。It is understandable that each character string in the script to be executed is sequentially marked without marking useless symbols to obtain the marked text. In this way, only the strings need to be processed.
S2022,通过相似匹配算法,查询出所述标注文本中的待处理字符串。S2022, through a similarity matching algorithm, query the character string to be processed in the marked text.
可理解地,所述相似匹配算法为运用余弦相似度衡量两个字符串之间的相似程度的算法,将所述待执行脚本中的各个字符与SQL语法相关的预设的字符串相对比,计算出各个字符与SQL语法相关的预设的字符串的余弦相似度值,将与大于预设阈值的最大余弦相似度值对应的字符串确定为所述待处理字符串。Understandably, the similarity matching algorithm is an algorithm that uses cosine similarity to measure the degree of similarity between two strings, and compares each character in the script to be executed with a preset string related to SQL grammar, Calculate the cosine similarity value of the preset character string related to the SQL syntax of each character, and determine the character string corresponding to the maximum cosine similarity value greater than the preset threshold as the to-be-processed character string.
S2023,通过语法规则模型对各待处理字符串进行规则校验,得到各待处理字符串的字符串结果。S2023: Perform rule checking on each character string to be processed by using the grammar rule model, and obtain a character string result of each character string to be processed.
可理解地,所述语法规则模型为训练完成或者预设的SQL语句的语法规则的模型,对各所述待处理字符串进行字符向量转换,得到各所述待处理字符串的向量,并根据该待处理字符串的向量和与该字符串向量的相邻的上下文的待处理字符串的向量进行该字符串的语法语义特征提取,对提取出该字符串的语法语义特征进行分类,得到与该待处理字符串匹配的符合SQL语法的字符串结果,所述字符串结果表明了该待处理字符串是否为涉及SQL语法的字符串且关联了一个符合SQL语句的语法的字符串。Understandably, the grammatical rule model is a model of grammatical rules of SQL statements that have been trained or preset, and character vector conversion is performed on each of the character strings to be processed to obtain a vector of each of the character strings to be processed. Extract the grammatical and semantic features of the string with the vector of the string to be processed and the vector of the string to be processed in the context adjacent to the string vector, classify the grammatical and semantic features of the extracted string, and obtain the same The string result that matches the to-be-processed string matches the SQL syntax, and the string result indicates whether the to-be-processed string is a string involving SQL syntax and is associated with a string that conforms to the syntax of the SQL statement.
S2024,根据所有所述字符串结果,对所述待执行脚本进行剔除处理,得到变量文本。S2024, according to all the character string results, the to-be-executed script is eliminated to obtain variable text.
可理解地,对所述待执行脚本中剔除所述字符串结果标记为涉及SQL语法的字符串的所述待处理字符串,将剔除剩下的所有字符串确定为所述变量文本。Understandably, for the to-be-processed character string that is marked as a character string involving SQL syntax in the script to be executed as a result of excluding the character string, all remaining character strings are determined as the variable text.
S2025,通过字符串匹配算法,从所述变量文本中识别出与所述变量测试清单中的源变量相匹配的变量,得到各所述变量的变量结果。S2025 , identifying variables matching the source variables in the variable test list from the variable text through a string matching algorithm, and obtaining variable results for each of the variables.
可理解地,所述字符串匹配算法为运用RK算法将所述变量文本中的字符串与所述变量测试清单中的源变量进行比较,通过哈希值衡量两个字符串的相似度,将与哈希值大于预设哈希阈值对应的字符串确定为待处理变量,将与其相匹配的所述源变量确定为该待处理变量的所述变量结果,如此,可以识别出误输入且相似的字符串。Understandably, the string matching algorithm is to use the RK algorithm to compare the string in the variable text with the source variable in the variable test list, measure the similarity of the two strings by the hash value, and use the hash value to measure the similarity between the two strings. The string corresponding to the hash value greater than the preset hash threshold value is determined as the variable to be processed, and the source variable that matches it is determined as the variable result of the variable to be processed. In this way, misinputs and similar String.
其中,所述RM算法是通过hash(哈希)的方式减少比较,通过hash的方式比较可以将字符串转变成一个26进制的数之后进行比较。Wherein, the RM algorithm reduces the comparison by means of hashing, and compares the strings by converting them into a hexadecimal number for comparison by means of hashing.
S2026,将所有所述字符串结果和所有所述变量结果确定为所述检测结果。S2026: Determine all the string results and all the variable results as the detection results.
可理解地,所述字符串结果和所述变量结果可以确定出错误输入的字符串,并能够匹配出与其对应的符合SQL语句的字符串,为后续修正处理提供了数据依据。Understandably, the character string result and the variable result can determine an incorrectly input character string, and can match a character string corresponding to the SQL statement, which provides a data basis for subsequent correction processing.
本申请实现了通过对所述待执行脚本进行序列标注,得到标注文本;通过相似匹配算法,查询出所述标注文本中的待处理字符串;通过语法规则模型对各待处理字符串进行规则校验,得到各待处理字符串的字符串结果;根据所有所述字符串结果,对所述待执行脚本进行剔除处理,得到变量文本;通过字符串匹配算法,从所述变量文本中识别出与所述变量测试清单中的源变量相匹配的变量,得到各所述变量的变量结果;将所有所述字符串结果和所有所述变量结果确定为所述检测结果,如此,实现了通过序列标注、相似匹配算法、语法规则模型的规则校验完成语法检测,以及通过字符串匹配算法完成变量检测,能够快速地自动识别出所述待执行脚本中误输入的字符串,并得出与各误输入的字符串对应的修正后的字符串。The present application realizes that by performing sequence annotation on the script to be executed, the marked text is obtained; the similarity matching algorithm is used to query the to-be-processed character string in the marked text; the rule-checking is performed on each to-be-processed character string through a grammar rule model. test to obtain the string result of each character string to be processed; according to all the string results, the script to be executed is eliminated to obtain the variable text; the string matching algorithm is used to identify and match the variable text from the variable text. The variables that match the source variables in the variable test list are obtained, and the variable results of each of the variables are obtained; all the string results and all the variable results are determined as the detection results, so that the sequence labeling is realized. , the similarity matching algorithm, the rule verification of the grammar rule model to complete the grammar detection, and the variable detection through the string matching algorithm, which can quickly and automatically identify the incorrectly inputted string in the script to be executed, and obtain the corresponding error. The modified string corresponding to the input string.
S203,根据所述检测结果,对所述待执行脚本进行修正处理,得到可执行脚本。S203, performing correction processing on the script to be executed according to the detection result to obtain an executable script.
可理解地,根据所述检测结果,将所有所述字符串结果和所有所述变量结果中的内容 相应替换现有的所述待执行脚本中的内容,从而完成所述修正处理,将经所述修正处理后的所述待执行脚本确定为所述可执行脚本。Understandably, according to the detection results, the contents in all the string results and all the variable results are correspondingly replaced with the contents in the existing script to be executed, so as to complete the correction process, and the The script to be executed after the correction processing is determined as the executable script.
S204,对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句。S204: Perform single-step splitting on the executable script to obtain at least one SQL single-step statement.
可理解地,所述单步拆分处理为通过所述Mybatis工具生成与所述可执行脚本的Mapper文件,所述Mapper文件是用于管理SQL语句的文件,对所述mapper文件进行单步识别及分割处理,所述单步识别为从该Mapper文件中拆分并解析出独立的SQL语句的过程,解析的过程为运用Mybatis工具对所述可执行脚本中的字符串进行识别,识别出独立SQL语句的句首和句尾,然后进行分割出所诉SQL单步语句。Understandably, the single-step splitting process is to generate a Mapper file with the executable script by the Mybatis tool. The Mapper file is a file for managing SQL statements, and the mapper file is identified in a single step. And segmentation processing, described single-step identification is the process of splitting and parsing out the independent SQL statement from this Mapper file, the process of parsing is to use Mybatis tool to identify the string in the described executable script, identify the independent SQL statement The beginning and end of the SQL statement, and then split out the SQL single-step statement.
在一实施例中,如图5所示,所述步骤S204中,即所述对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句,包括:In one embodiment, as shown in FIG. 5 , in the step S204, that is, the single-step splitting of the executable script is performed to obtain at least one single-step SQL statement, including:
S2041,对所述可执行脚本进行mapper生成,生成与所述待执行脚本对应的mapper文件。S2041. Perform mapper generation on the executable script, and generate a mapper file corresponding to the script to be executed.
可理解地,所述mapper生成的过程为通过Mybatis工具中的Maven插件获取预设的generatorConfig配置文件,所述generatorConfig配置文件包含了class对象的设置及模板,根据所述generatorConfig配置文件生成DAO层代码,所述DAO层代码为数据访问层的SQL代码,并将SQL代码中的字段通过关联表进行comment注释,从而生成所述mapper文件。Understandably, the process of generating the mapper is to obtain the preset generatorConfig configuration file through the Maven plug-in in the Mybatis tool. The generatorConfig configuration file contains the settings and templates of the class object, and the DAO layer code is generated according to the generatorConfig configuration file. , the DAO layer code is the SQL code of the data access layer, and the fields in the SQL code are commented through the association table, thereby generating the mapper file.
S2042,对所述mapper文件进行单步识别及分割处理,分割出所述SQL单步语句。S2042: Perform single-step identification and segmentation processing on the mapper file to segment the SQL single-step statement.
可理解地,所述单步识别为从该Mapper文件中拆分并解析出独立的SQL语句的过程,解析的过程为运用Mybatis工具对所述可执行脚本中的字符串进行识别,识别出独立SQL语句的句首和句尾,然后进行分割出所诉SQL单步语句。Understandably, the single-step identification is the process of splitting and parsing the independent SQL statement from the Mapper file, and the parsing process is to use the Mybatis tool to identify the string in the executable script, and identify the independent SQL statement. The beginning and end of the SQL statement, and then split out the SQL single-step statement.
本申请实现了对所述可执行脚本进行mapper生成,生成与所述待执行脚本对应的mapper文件;对所述mapper文件进行单步识别及分割处理,分割出所述SQL单步语句,如此,能够准确地分割出独立的SQL单步语句。The present application implements mapper generation on the executable script, and generates a mapper file corresponding to the script to be executed; single-step identification and segmentation processing is performed on the mapper file, and the SQL single-step statement is segmented, and thus, Can accurately segment independent SQL single-step statements.
本申请实现了通过所述Mybatis工具,创建连接接口和与所述数据库信息对应的数据库配置文件,并通过所述数据库配置文件建立与所述源数据库的连接;根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果;根据所述检测结果,对所述待执行脚本进行修正处理,得到可执行脚本;对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句,如此,实现了通过Mybatis工具自动与源数据库建立谅解,并自动语法检测及变量检测,修正错误的SQL语句中的语法和变量错误,并自动单步拆分出独立的SQL单步语句,因此,减少了人工判断语法的成本,以及避免变量输入错误的情况,提高了测试效率和缩短了测试周期,提高了测试准确率。The present application realizes that a connection interface and a database configuration file corresponding to the database information are created through the Mybatis tool, and a connection to the source database is established through the database configuration file; Perform syntax detection and variable detection on the script to be executed to obtain a detection result; according to the detection result, modify the script to be executed to obtain an executable script; perform single-step splitting on the executable script to obtain at least A described SQL single-step statement, thus, realizes the automatic establishment of understanding with the source database through the Mybatis tool, and automatic syntax detection and variable detection, corrects the syntax and variable errors in the wrong SQL statement, and automatically single-step splits out independent Therefore, it reduces the cost of manually judging the syntax, avoids the situation of variable input errors, improves the test efficiency, shortens the test cycle, and improves the test accuracy.
S30,通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单。S30 , using the Eclipse tool, perform input parameter identification on each of the SQL single-step statements, and obtain a one-to-one input parameter list corresponding to each of the SQL single-step statements.
可理解地,所述Eclipse工具为基于Eclipse插件(集成开发环境插件)开发的集成工具,通过所述Eclipse工具可以实现识别出所述Mybatis工具输出的SQL单步语句中的入参变量,并根据各入参变量及其类型,生成与该入参变量对应的输入变量,通过该输入变量输入的内容可以生成需要测试的SQL待测试单步脚本,所述入参识别的过程为通过所述Eclipse工具,将各所述SQL单步语句中的与SQL语法相关的内容进行去除,将去除后的所述SQL单步语句进行入参特征提取,将提取的所述入参特征进行识别,识别出与所述SQL单步语句对应的入参变量,汇总与所述SQL单步语句对应的所有入参变量,将其确定为与所述SQL单步语句对应的所述入参清单Understandably, the Eclipse tool is an integrated tool developed based on the Eclipse plug-in (integrated development environment plug-in). Through the Eclipse tool, the input parameter variables in the SQL single-step statement output by the Mybatis tool can be identified, and according to the Eclipse tool. Each input parameter variable and its type generate an input variable corresponding to the input parameter variable, through which the input content of the input variable can generate the SQL to be tested single-step script that needs to be tested, and the process of the input parameter identification is through the Eclipse Tool, the content related to SQL grammar in each described SQL single-step statement is removed, the described SQL single-step statement after the removal is carried out input parameter feature extraction, the extracted described input parameter feature is identified, and identified The input parameter variable corresponding to the SQL single-step statement, summarize all input parameter variables corresponding to the SQL single-step statement, and determine it as the input parameter list corresponding to the SQL single-step statement
其中,所述入参特征为入参与SQL符号相邻具备的特征,例如在“where”字符串之后的字符串或/和SQL符号(例如:“=”等等)或/和SQL逻辑字符串(例如:“and”、“or”等等)。Wherein, the input parameter feature is a feature that is adjacent to the input SQL symbol, such as the string after the "where" string or/and the SQL symbol (for example: "=", etc.) or/and the SQL logic string (eg: "and", "or", etc.).
S40,通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本。S40, by using the Eclipse tool, according to the variable test list and the input parameter list corresponding to each SQL single-step statement, perform dynamic script generation processing on each of the SQL single-step statements, and generate a The SQL single-step script to be tested corresponding to the SQL single-step statement.
可理解地,所述变量测试清单包括源变量、源值、预期变量和预期值,所述源变量为与所述数据库信息对应的数据库中的字段,所述源值为所述源变量根据其数据类型设置的入参值,所述预期变量为输出的出参的表中的字段,所述预期值为与所述预期变量一一对应的值,是指预期能够输出的值,所述动态脚本生成处理为获取与所述SQL单步语句对应的所述入参清单中的入参变量,从所述变量测试清单中查找入参变量,并从获取与查找到的入参变量相同的所述源变量对应的所述源值,根据获取的所有所述源值对所述SQL单步语句进行组合成不同的SQL待测试单步脚本的过程,实现了自动动态调整入参变量生成不同的脚本,无需人工编写,提高了编写效率和准确率,例如:SQL单步语句中涉及两个入参变量,分别为“name”和“password”,在所述变量测试清单中与“name”相同的源变量对应的源值包括3个值,与“password”相同的源变量对应的源值包括4个值,相当于通过所述Eclipse工具,弹出“name”和“password”两个变量的输入对话框,分别对这两个输入对话框输入3个值中的一个和4个值中的一个,按照所述SQL单步语句中的语法格式组合成12个不同情况的输入,生成与该SQL单步语句对应的12个不同的SQL待测试单步脚本,所述SQL待测试单步脚本为经所述动态脚本生成处理之后获得且可以执行的脚本。Understandably, the variable test list includes a source variable, a source value, an expected variable, and an expected value, the source variable is a field in the database corresponding to the database information, and the source value is based on the source variable. The input parameter value set by the data type, the expected variable is a field in the table of the output parameter, the expected value is a value corresponding to the expected variable one-to-one, and refers to the value that can be expected to be output, the dynamic The script generation process is to obtain the input parameter variable in the described input parameter list corresponding to the SQL single-step statement, find the input parameter variable from the variable test list, and obtain the same input parameter variable as the found input parameter variable from the acquisition. The source value corresponding to the source variable, the process of combining the SQL single-step statement into different SQL single-step scripts to be tested according to all the obtained source values, realizes automatic dynamic adjustment of the input parameter variable to generate different values. The script does not need to be manually written, which improves the writing efficiency and accuracy. For example, two input parameters are involved in the SQL single-step statement, namely "name" and "password", which are the same as "name" in the variable test list. The source value corresponding to the source variable includes 3 values, and the source value corresponding to the same source variable as "password" includes 4 values, which is equivalent to popping up the input of the two variables "name" and "password" through the Eclipse tool dialog box, enter one of the 3 values and one of the 4 values into the two input dialog boxes, and combine them into 12 different inputs according to the syntax format in the SQL single-step statement, and generate the same SQL There are 12 different SQL single-step scripts to be tested corresponding to the single-step statement, and the SQL to-be-tested single-step scripts are scripts obtained and executable after the dynamic script generation process.
其中,所述动态脚本生成处理过程中,如果所述SQL单步语句是静态SQL语句,就将所述SQL单步语句中的“#{}”参数替换成与其相应的源值;如果所述SQL单步语句是动态SQL语句,则需要对<if><foreach>等标签进行与其对应的解析,解析成只包含“#{}”的StaticSqlSource,从而将其转换成静态SQL语句,再对转换后的静态SQL语句中的“#{}”参数替换成与其相应的源值。Wherein, in the dynamic script generation process, if the SQL single-step statement is a static SQL statement, the "#{}" parameter in the SQL single-step statement is replaced with its corresponding source value; if the SQL single-step statement is a static SQL statement SQL single-step statement is a dynamic SQL statement, you need to parse <if><foreach> and other tags corresponding to it, and parse it into a StaticSqlSource containing only "#{}", so as to convert it into a static SQL statement, and then convert it. The "#{}" parameter in the following static SQL statement is replaced with its corresponding source value.
S50,通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果。S50, by using the Mybatis tool, perform a synchronous test on all the SQL single-step scripts to be tested, and obtain a single-step result corresponding to each of the SQL single-step statements.
可理解地,所述同步测试处理的过程为通过所述Mybatis工具对所有所述SQL待测试单步脚本进行同步执行,得到各所述SQL待测试单步脚本的单步执行结果;根据所述变量测试清单和所有所述单步执行结果,运用多线程对各所述SQL待测试单步脚本进行同步校验处理,得到各所述SQL单步语句相应的单步结果,其中,所述单步结果为执行所述SLQ单步语句后获得的校验处理后的结果。Understandably, the process of the synchronous test processing is to synchronously execute all the SQL single-step scripts to be tested through the Mybatis tool, and obtain the single-step execution results of each of the SQL to-be-tested single-step scripts; according to the The variable test list and all the single-step execution results are used to perform synchronous verification processing on each of the SQL single-step scripts to be tested, to obtain the corresponding single-step results of each of the SQL single-step statements, wherein the single-step The step result is the result of the verification process obtained after executing the SLQ single-step statement.
在一实施例中,如图6所示,所述步骤S50中,即所述通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果,包括:In an embodiment, as shown in FIG. 6 , in the step S50, that is, the Mybatis tool is used to perform a synchronous test on all the SQL single-step scripts to be tested, and obtain a single-step statement with each SQL statement. The corresponding single-step results, including:
S501,同步执行所有所述SQL待测试单步脚本,得到与各所述SQL待测试单步脚本一一对应的单步执行结果。S501 , synchronously execute all the SQL single-step scripts to be tested, and obtain single-step execution results corresponding to each of the SQL single-step scripts to be tested one-to-one.
可理解地,通过资源调度策略分派到多个线程,通过多个线程同步执行所有所述SQL待测试单步脚本,得到与各所述SQL待测试单步脚本一一对应的单步执行结果。Understandably, the resource scheduling strategy is used to assign to multiple threads, and all the SQL single-step scripts to be tested are executed synchronously through multiple threads, so as to obtain single-step execution results corresponding to each of the SQL single-step scripts to be tested one-to-one.
S502,根据所述变量测试清单和所有所述单步执行结果,对各所述SQL待测试单步脚本进行同步校验处理,得到与各所述SQL单步语句对应的单步结果。S502, according to the variable test list and all the single-step execution results, perform synchronous verification processing on each of the SQL single-step scripts to be tested, to obtain a single-step result corresponding to each of the SQL single-step statements.
可理解地,所述同步校验处理为同步查找与所述单步执行结果中的输出变量相同的预期变量,将与所述单步执行结果中的所述输出变量对应的输出变量值和相应的所述预期值进行比对,校验出与该SQL单步语句对应的单步结果的处理过程,其中查找的过程运用的算法可以根据需求设定,比如字符串匹配算法中的BF、RK或BM算法等等,所述同步查找为通过多个线程同步查找各个所述输出变量。Understandably, the synchronization verification process is to synchronously search for the same expected variable as the output variable in the single-step execution result, and compare the output variable value and corresponding output variable value corresponding to the output variable in the single-step execution result. Compare the expected value of , and verify the processing process of the single-step result corresponding to the SQL single-step statement. The algorithm used in the search process can be set according to requirements, such as BF and RK in the string matching algorithm. Or BM algorithm, etc., the synchronous search is to search each of the output variables synchronously through multiple threads.
本申请实现了通过同步执行所有所述SQL待测试单步脚本,得到与各所述SQL待测 试单步脚本一一对应的单步执行结果;根据所述变量测试清单和所有所述单步执行结果,对各所述SQL待测试单步脚本进行同步校验处理,得到与各所述SQL单步语句对应的单步结果,如此,能够多线程执行加快测试速度,提高了测试效率。The present application realizes that by synchronously executing all the SQL single-step scripts to be tested, the single-step execution results corresponding to each of the SQL to-be-tested single-step scripts are obtained; according to the variable test list and all the single-step execution scripts As a result, synchronous verification processing is performed on each of the SQL single-step scripts to be tested, and a single-step result corresponding to each of the SQL single-step statements is obtained. In this way, multi-threaded execution can speed up the test speed and improve the test efficiency.
在一实施例中,如图7所示,所述步骤S502中,即所述根据所述变量测试清单和所有所述单步执行结果,对各所述SQL待测试单步脚本进行同步校验处理,得到与各所述SQL单步语句对应的单步结果,包括:In an embodiment, as shown in FIG. 7 , in step S502, that is, according to the variable test list and all the single-step execution results, synchronous verification is performed on each of the SQL single-step scripts to be tested. processing to obtain a single-step result corresponding to each of the SQL single-step statements, including:
S5021,运用快速查询算法,在所述变量测试清单中同步查找与各所述单步执行结果中的输出变量相同的预期变量,获取与查找到的所述预期变量对应的预期值。S5021 , using a quick query algorithm, synchronously search the variable test list for the expected variable that is the same as the output variable in each of the single-step execution results, and obtain the expected value corresponding to the found expected variable.
可理解地,所述快速查询算法简称为BM(boyermoore)算法,所述快速查询算法为一种从右往左的字符串匹配算法,分别包含坏字符算法和好后缀算法,这两个算法分别计算在主串中我们能够向后移动模式串长度,然后选取这两个算法中移动大的,作为我们真正移动的距离,通过所述快速查询算法,从所述变量测试清单中运用多线程同步查找与各个所述输出变量相同的所述预期变量,并获取与该预期变量一一对应的所述预期值。Understandably, the fast query algorithm is abbreviated as the BM (boyermoore) algorithm, and the fast query algorithm is a right-to-left string matching algorithm, including a bad character algorithm and a good suffix algorithm, respectively. Calculate the length of the pattern string that we can move backwards in the main string, and then select the largest movement in these two algorithms as the distance we really move, through the fast query algorithm, from the variable test list using multi-threaded synchronous search The expected variable is the same as each of the output variables, and the expected value corresponding to the expected variable one-to-one is obtained.
其中,坏字符算法为当出现一个坏字符时,向右移动模式串,让模式串中最靠右的对应字符与坏字符相对,然后继续匹配主串的算法;好后缀算法为在模式串中有子串匹配出好后缀时,此时移动模式串,让该子串和好后缀对齐即可,如果超过一个子串匹配上好后缀,则选择最靠右边的子串对齐,防止有漏匹配的;在模式串中没有子串匹配出好后缀时,则需要寻找模式串的一个最长前缀,并让该前缀等于好后缀的后缀,寻找到该前缀后,让该前缀和好后缀对齐即可;在模式串中没有子串匹配出好后缀时,且在模式串中找不到最长前缀时,让该前缀等于好后缀的后缀,直接移动模式到好后缀的下一个字符。Among them, the bad character algorithm is to move the pattern string to the right when a bad character appears, so that the rightmost corresponding character in the pattern string is opposite to the bad character, and then continue to match the main string; the good suffix algorithm is in the pattern string. When there is a substring that matches a good suffix, move the pattern string at this time to align the substring with the good suffix. If more than one substring matches the good suffix, select the rightmost substring to align to prevent missing matches. ; when there is no substring in the pattern string that matches a good suffix, you need to find a longest prefix of the pattern string, and make the prefix equal to the suffix of the good suffix, after finding the prefix, align the prefix with the good suffix Yes; when no substring in the pattern string matches a good suffix, and when the longest prefix cannot be found in the pattern string, make the prefix equal to the suffix of the good suffix, and directly move the pattern to the next character of the good suffix.
S5022,将与各所述单步执行结果中的所述输出变量对应的输出变量值和获取的与其相应的所述预期值进行比对,得到所述单步结果。S5022: Compare the output variable value corresponding to the output variable in each of the single-step execution results with the obtained expected value corresponding to the output variable to obtain the single-step result.
可理解地,通过多个线程同步将所述输出变量值和与其相应的所述预期值进行比对,得到两者之间比对的差值,根据该差值可以确定出与所述单步执行结果一一对应的所述单步结果,比对的方式可以根据需求设定,比如将所述输出变量值和所述预测值分别转换成向量,即将所述输出变量值中的各个字符串进行字符向量转换,将转换后的所述输出变量值和所述预测值的向量进行对比,判断对比结果是否在预设范围内,从而确定所述单步结果是否为通过,即若所述对比结果在预设范围内,则确定所述单步结果为通过,若所述对比结果不在预设范围内,则确定所述单步结果为不通过。Understandably, the output variable value is compared with its corresponding expected value synchronously through multiple threads to obtain the difference value compared between the two. The execution results correspond to the single-step results one-to-one. The comparison method can be set according to requirements, such as converting the output variable value and the predicted value into vectors respectively, that is, each string in the output variable value. Perform character vector conversion, compare the converted output variable value with the vector of the predicted value, determine whether the comparison result is within the preset range, so as to determine whether the single-step result is passed, that is, if the comparison If the result is within the preset range, the single-step result is determined to be passed, and if the comparison result is not within the preset range, the single-step result is determined to be failed.
本申请实现了通过运用快速查询算法,在所述变量测试清单中同步查找与各所述单步执行结果中的输出变量相同的预期变量,获取与查找到的所述预期变量对应的预期值;将与各所述单步执行结果中的所述输出变量对应的输出变量值和获取的与其相应的所述预期值进行比对,得到所述单步结果,如此,实现了运用快速查询算法,自动校验各所述单步执行结果,输出相应的单步结果,能够自动完成单步执行结果的校验,无需人工校验,减少了人工成本,提高了校验效率,提高了校验的准确率。The present application realizes that by using a fast query algorithm, the variable test list is synchronously searched for the same expected variable as the output variable in each of the single-step execution results, and the expected value corresponding to the found expected variable is obtained; Comparing the output variable value corresponding to the output variable in each of the single-step execution results with the obtained expected value corresponding to the output variable to obtain the single-step result, thus realizing the use of a fast query algorithm, Automatically verify each of the single-step execution results, output the corresponding single-step results, and can automatically complete the verification of the single-step execution results without manual verification, reduce labor costs, improve verification efficiency, and improve verification. Accuracy.
S60,根据所有所述单步结果,输出与所述待测文件对应的测试结果。S60, according to all the single-step results, output test results corresponding to the files to be tested.
可理解地,在所有所述单步结果均为校验合格时,确定所述测试结果为测试合格;在任一所述单步结果为校验不合格时,确定所述测试结果为测试不合格,且将校验不合格的所述单步结果通过列表呈现。Understandably, when all the single-step results are verified as qualified, the test results are determined to be qualified; when any one of the single-step results is verified as unqualified, it is determined that the test results are unqualified. , and the single-step results that fail the verification are presented in a list.
本申请通过获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待 测试单步脚本;通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;根据所有所述单步结果,输出与所述待测文件对应的测试结果,如此,实现了通过Mybatis工具,对待测文件中的待执行脚本进行单步解析处理,得到多个SQL单步语句,再通过Eclipse工具进行入参识别,并动态脚本生成多个SQL待测试单步脚本,最后运用Mybatis工具进行同步测试获得待测文件的测试结果,因此,通过Mybatis工具和Eclipse工具自动动态生成SQL待测试单步脚本以及并行测试输出测试结果,完成无需测试人员解读待测文件和编写测试用例,并无需人工判断语法错误,以及无需修改后进行整体编译及运行才输出测试结果,降低了测试人员的要求门槛,缩短了测试周期,提高了测试效率,节省了测试成本。The present application obtains a file to be tested; the file to be tested includes database information, a script to be executed and a variable test list; a connection to the source database corresponding to the database information is established through the Mybatis tool, and the script to be executed is singled out. Step analysis and processing, generate at least one SQL single-step statement; through the Eclipse tool, carry out input parameter identification to each of the SQL single-step statements, and obtain a one-to-one corresponding input parameter list with each of the SQL single-step statements; through the Eclipse tool The tool, according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements, performs dynamic script generation processing on each of the SQL single-step statements, and generates a corresponding SQL single-step statement. SQL single-step script to be tested; through the Mybatis tool, synchronously test all the SQL to-be-tested single-step scripts to obtain a single-step result corresponding to each of the SQL single-step statements; according to all the single-step results, Output the test results corresponding to the file to be tested. In this way, the Mybatis tool is used to perform single-step parsing processing on the script to be executed in the file to be tested, and multiple SQL single-step statements are obtained, and then the Eclipse tool is used to identify the input parameters. , and the dynamic script generates multiple SQL single-step scripts to be tested, and finally uses the Mybatis tool to perform synchronous testing to obtain the test results of the files to be tested. Therefore, the SQL to be tested single-step scripts and the parallel test output are automatically and dynamically generated by the Mybatis tool and the Eclipse tool. The test results are completed without the need for testers to interpret the files to be tested and write test cases, and do not need to manually judge syntax errors, and do not need to modify the overall compilation and operation to output the test results, which reduces the tester's requirement threshold and shortens the test cycle. The test efficiency is improved and the test cost is saved.
在一实施例中,提供一种动态同步测试装置,该动态同步测试装置与上述实施例中动态同步测试方法一一对应。如图8所示,该动态同步测试装置包括获取模块11、解析模块12、识别模块13、生成模块14、测试模块15和输出模块16。各功能模块详细说明如下:In one embodiment, a dynamic synchronization test apparatus is provided, and the dynamic synchronization test apparatus corresponds to the dynamic synchronization test method in the above-mentioned embodiment one-to-one. As shown in FIG. 8 , the dynamic synchronization test apparatus includes an acquisition module 11 , an analysis module 12 , an identification module 13 , a generation module 14 , a test module 15 and an output module 16 . The detailed description of each functional module is as follows:
获取模块11,用于获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;The acquisition module 11 is used to acquire the file to be tested; the file to be tested includes database information, a script to be executed and a variable test list;
解析模块12,用于通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;The parsing module 12 is used for establishing a connection to the source database corresponding to the database information through the Mybatis tool, and performing single-step parsing processing on the script to be executed to generate at least one SQL single-step statement;
识别模块13,用于通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;The identification module 13 is used to identify the input parameters of each of the SQL single-step statements through the Eclipse tool, and obtain a list of input parameters corresponding to each of the SQL single-step statements;
生成模块14,用于通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本;The generation module 14 is configured to, through the Eclipse tool, perform dynamic script generation processing on each of the SQL single-step statements according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements, and generate The SQL single-step script to be tested corresponding to each described SQL single-step statement;
测试模块15,用于通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;The test module 15 is used to perform a synchronous test on all the SQL single-step scripts to be tested through the Mybatis tool, and obtain a single-step result corresponding to each of the SQL single-step statements;
输出模块16,用于根据所有所述单步结果,输出与所述待测文件对应的测试结果。The output module 16 is configured to output test results corresponding to the files to be tested according to all the single-step results.
在一实施例中,如图9所示,所述解析模块12包括:In one embodiment, as shown in FIG. 9 , the parsing module 12 includes:
创建子模块21,用于通过所述Mybatis工具,创建连接接口和与所述数据库信息对应的数据库配置文件,并通过所述数据库配置文件建立与所述源数据库的连接;A creation submodule 21 is used to create a connection interface and a database configuration file corresponding to the database information through the Mybatis tool, and establish a connection with the source database through the database configuration file;
检测子模块22,用于根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果;The detection sub-module 22 is configured to perform syntax detection and variable detection on the script to be executed according to the variable test list to obtain a detection result;
修正子模块23,用于根据所述检测结果,对所述待执行脚本进行修正处理,得到可执行脚本;A correction sub-module 23, configured to perform correction processing on the script to be executed according to the detection result to obtain an executable script;
拆分子模块24,用于对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句。The splitting submodule 24 is configured to perform single-step splitting of the executable script to obtain at least one single-step SQL statement.
关于动态同步测试装置的具体限定可以参见上文中对于动态同步测试方法的限定,在此不再赘述。上述动态同步测试装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the dynamic synchronization test apparatus, reference may be made to the definition of the dynamic synchronization test method above, which will not be repeated here. All or part of the modules in the above dynamic synchronization testing device can be implemented by software, hardware and combinations thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是客户端或者服务端,其内部结构图可以如图10所示。该计算机设备包括通过***总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括可读存储介质、内存储器。该可读存储介质存储有操作***、计算机可读指令和数据库。该内存储器为可读存储介质中的操作***和计算机可读指令的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种动态同步测试方法。本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质。In one embodiment, a computer device is provided, the computer device may be a client or a server, and its internal structure diagram may be as shown in FIG. 10 . The computer device includes a processor, memory, a network interface, and a database connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium, an internal memory. The readable storage medium stores an operating system, computer readable instructions and a database. The internal memory provides an environment for the execution of the operating system and computer-readable instructions in the readable storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer readable instructions, when executed by a processor, implement a dynamic synchronization testing method. The readable storage medium provided by this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现上述实施例中动态同步测试方法。In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor implements the dynamic behavior in the above-mentioned embodiment when the processor executes the computer-readable instructions Synchronous test method.
在一个实施例中,提供了一个或多个存储有计算机可读指令的可读存储介质,本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质;该可读存储介质上存储有计算机可读指令,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现上述实施例中动态同步测试方法。In one embodiment, one or more readable storage media storing computer-readable instructions are provided, and the readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage media medium; computer-readable instructions are stored on the readable storage medium, and when the computer-readable instructions are executed by one or more processors, enable one or more processors to implement the dynamic synchronization test method in the foregoing embodiment.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质或易失性可读存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile computer. In a readable storage medium or a volatile readable storage medium, the computer-readable instructions, when executed, may include the processes of the foregoing method embodiments. Wherein, any reference to memory, storage, database or other medium used in the various embodiments provided in this application may include non-volatile and/or volatile memory. Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. Module completion, that is, dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the above-mentioned embodiments, those of ordinary skill in the art should understand that: it is still possible to implement the above-mentioned implementations. The technical solutions described in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the application, and should be included in the within the scope of protection of this application.

Claims (20)

  1. 一种动态同步测试方法,其中,包括:A dynamic synchronization test method, comprising:
    获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;Obtain a file to be tested; the file to be tested includes database information, a script to be executed and a variable test list;
    通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;Establish a connection to the source database corresponding to the database information through the Mybatis tool, and perform single-step parsing processing on the script to be executed to generate at least one SQL single-step statement;
    通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;Through the Eclipse tool, the input parameters are identified for each of the SQL single-step statements, and the input parameter list corresponding to each of the SQL single-step statements is obtained;
    通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本;Through the Eclipse tool, according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements, dynamic script generation processing is performed on each of the SQL single-step statements, and the corresponding SQL single-step statements are generated. The SQL to be tested single-step script corresponding to the step statement;
    通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;Through the Mybatis tool, synchronous testing is performed on all the SQL single-step scripts to be tested, and the single-step results corresponding to each of the SQL single-step statements are obtained;
    根据所有所述单步结果,输出与所述待测文件对应的测试结果。According to all the single-step results, test results corresponding to the files to be tested are output.
  2. 如权利要求1所述的动态同步测试方法,其中,所述通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句,包括:The dynamic synchronization testing method according to claim 1, wherein the connection to the source database corresponding to the database information is established through the Mybatis tool, and the script to be executed is subjected to single-step parsing processing to generate at least one SQL statement step statement, including:
    通过所述Mybatis工具,创建连接接口和与所述数据库信息对应的数据库配置文件,并通过所述数据库配置文件建立与所述源数据库的连接;Through the Mybatis tool, create a connection interface and a database configuration file corresponding to the database information, and establish a connection with the source database through the database configuration file;
    根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果;According to the variable test list, perform syntax detection and variable detection on the script to be executed to obtain a detection result;
    根据所述检测结果,对所述待执行脚本进行修正处理,得到可执行脚本;According to the detection result, modifying the script to be executed to obtain an executable script;
    对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句。Perform single-step splitting on the executable script to obtain at least one SQL single-step statement.
  3. 如权利要求2所述的动态同步测试方法,其中,所述根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果,包括:The dynamic synchronization test method according to claim 2, wherein, according to the variable test list, performing syntax detection and variable detection on the script to be executed to obtain a detection result, comprising:
    对所述待执行脚本进行序列标注,得到标注文本;Perform sequence annotation on the script to be executed to obtain annotated text;
    通过相似匹配算法,查询出所述标注文本中的待处理字符串;Through the similarity matching algorithm, the character string to be processed in the marked text is queried;
    通过语法规则模型对各待处理字符串进行规则校验,得到各待处理字符串的字符串结果;Perform rule verification on each string to be processed through the grammar rule model, and obtain the string result of each string to be processed;
    根据所有所述字符串结果,对所述待执行脚本进行剔除处理,得到变量文本;According to all the string results, the script to be executed is eliminated to obtain variable text;
    通过字符串匹配算法,从所述变量文本中识别出与所述变量测试清单中的源变量相匹配的变量,得到各所述变量的变量结果;Through the string matching algorithm, the variable matching the source variable in the variable test list is identified from the variable text, and the variable result of each variable is obtained;
    将所有所述字符串结果和所有所述变量结果确定为所述检测结果。All of the string results and all of the variable results are determined as the detection results.
  4. 如权利要求2所述的动态同步测试方法,其中,所述对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句,包括:The dynamic synchronization testing method according to claim 2, wherein the step-by-step splitting of the executable script to obtain at least one of the SQL single-step statements includes:
    对所述可执行脚本进行mapper生成,生成与所述待执行脚本对应的mapper文件;performing mapper generation on the executable script, and generating a mapper file corresponding to the script to be executed;
    对所述mapper文件进行单步识别及分割处理,分割出所述SQL单步语句。Perform single-step identification and segmentation processing on the mapper file, and segment the SQL single-step statement.
  5. 如权利要求1所述的动态同步测试方法,其中,所述通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果,包括:The dynamic synchronization test method according to claim 1, wherein the Mybatis tool is used to perform a synchronization test on all the SQL single-step scripts to be tested, and a single-step result corresponding to each of the SQL single-step statements is obtained. ,include:
    同步执行所有所述SQL待测试单步脚本,得到与各所述SQL待测试单步脚本一一对应的单步执行结果;Simultaneously execute all the SQL single-step scripts to be tested, and obtain the single-step execution results corresponding to each of the SQL single-step scripts to be tested one-to-one;
    根据所述变量测试清单和所有所述单步执行结果,对各所述SQL待测试单步脚本进行同步校验处理,得到与各所述SQL单步语句对应的单步结果。According to the variable test list and all the single-step execution results, a synchronous verification process is performed on each of the SQL single-step scripts to be tested, and a single-step result corresponding to each of the SQL single-step statements is obtained.
  6. 如权利要求1所述的动态同步测试方法,其中,所述根据所述变量测试清单和所有所述单步执行结果,对各所述SQL待测试单步脚本进行同步校验处理,得到与各所述SQL 单步语句对应的单步结果,包括:The dynamic synchronization testing method according to claim 1, wherein, according to the variable test list and all the single-step execution results, the synchronization verification processing is performed on each of the SQL single-step scripts to be tested, and the results obtained with each The single-step result corresponding to the SQL single-step statement includes:
    运用快速查询算法,在所述变量测试清单中同步查找与各所述单步执行结果中的输出变量相同的预期变量,获取与查找到的所述预期变量对应的预期值;Using a quick query algorithm, the variable test list is synchronously searched for the same expected variable as the output variable in each of the single-step execution results, and the expected value corresponding to the found expected variable is obtained;
    将与各所述单步执行结果中的所述输出变量对应的输出变量值和获取的与其相应的所述预期值进行比对,得到所述单步结果。The single-step result is obtained by comparing the output variable value corresponding to the output variable in each of the single-step execution results with the obtained expected value corresponding to the output variable.
  7. 一种动态同步测试装置,其中,包括:A dynamic synchronization test device, comprising:
    获取模块,用于获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;an acquisition module for acquiring a file to be tested; the file to be tested includes database information, a script to be executed and a variable test list;
    解析模块,用于通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;A parsing module, used for establishing a connection with the source database corresponding to the database information through the Mybatis tool, and performing single-step parsing processing on the script to be executed to generate at least one SQL single-step statement;
    识别模块,用于通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;The identification module is used to identify the input parameters of each of the SQL single-step statements through the Eclipse tool, and obtain an input parameter list corresponding to each of the SQL single-step statements;
    生成模块,用于通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本;The generation module is used to perform dynamic script generation processing on each of the SQL single-step statements according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements through the Eclipse tool. The SQL single-step script to be tested corresponding to each of the SQL single-step statements;
    测试模块,用于通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;A test module is used to perform a synchronous test on all the SQL single-step scripts to be tested by the Mybatis tool, and obtain a single-step result corresponding to each of the SQL single-step statements;
    输出模块,用于根据所有所述单步结果,输出与所述待测文件对应的测试结果。An output module, configured to output test results corresponding to the files to be tested according to all the single-step results.
  8. 如权利要求7所述的动态同步测试装置,其中,所述解析模块包括:The dynamic synchronization testing device according to claim 7, wherein the analysis module comprises:
    创建子模块,用于通过所述Mybatis工具,创建连接接口和与所述数据库信息对应的数据库配置文件,并通过所述数据库配置文件建立与所述源数据库的连接;Create a submodule for creating a connection interface and a database configuration file corresponding to the database information through the Mybatis tool, and establishing a connection with the source database through the database configuration file;
    检测子模块,用于根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果;a detection submodule, configured to perform syntax detection and variable detection on the script to be executed according to the variable test list, and obtain a detection result;
    修正子模块,用于根据所述检测结果,对所述待执行脚本进行修正处理,得到可执行脚本;A correction submodule, configured to perform correction processing on the script to be executed according to the detection result to obtain an executable script;
    拆分子模块,用于对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句。The splitting submodule is used for single-step splitting the executable script to obtain at least one SQL single-step statement.
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer-readable instructions:
    获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;Obtain a file to be tested; the file to be tested includes database information, a script to be executed and a variable test list;
    通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;Establish a connection to the source database corresponding to the database information through the Mybatis tool, and perform single-step parsing processing on the script to be executed to generate at least one SQL single-step statement;
    通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;Through the Eclipse tool, the input parameters are identified for each of the SQL single-step statements, and the input parameter list corresponding to each of the SQL single-step statements is obtained;
    通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本;Through the Eclipse tool, according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements, dynamic script generation processing is performed on each of the SQL single-step statements, and the corresponding SQL single-step statements are generated. The SQL to be tested single-step script corresponding to the step statement;
    通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;Through the Mybatis tool, synchronous testing is performed on all the SQL single-step scripts to be tested, and the single-step results corresponding to each of the SQL single-step statements are obtained;
    根据所有所述单步结果,输出与所述待测文件对应的测试结果。According to all the single-step results, test results corresponding to the files to be tested are output.
  10. 如权利要求9所述的计算机设备,其中,所述通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句,包括:The computer device according to claim 9, wherein the connection to the source database corresponding to the database information is established through the Mybatis tool, and the script to be executed is single-step parsed to generate at least one SQL single-step statement ,include:
    通过所述Mybatis工具,创建连接接口和与所述数据库信息对应的数据库配置文件,并通过所述数据库配置文件建立与所述源数据库的连接;Through the Mybatis tool, create a connection interface and a database configuration file corresponding to the database information, and establish a connection with the source database through the database configuration file;
    根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果;According to the variable test list, perform syntax detection and variable detection on the script to be executed to obtain a detection result;
    根据所述检测结果,对所述待执行脚本进行修正处理,得到可执行脚本;According to the detection result, modifying the script to be executed to obtain an executable script;
    对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句。Perform single-step splitting on the executable script to obtain at least one single-step SQL statement.
  11. 如权利要求10所述的计算机设备,其中,所述根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果,包括:The computer device according to claim 10, wherein, according to the variable test list, performing syntax detection and variable detection on the script to be executed to obtain a detection result, comprising:
    对所述待执行脚本进行序列标注,得到标注文本;Perform sequence annotation on the script to be executed to obtain annotated text;
    通过相似匹配算法,查询出所述标注文本中的待处理字符串;Through the similarity matching algorithm, the character string to be processed in the marked text is queried;
    通过语法规则模型对各待处理字符串进行规则校验,得到各待处理字符串的字符串结果;Perform rule verification on each string to be processed through the grammar rule model, and obtain the string result of each string to be processed;
    根据所有所述字符串结果,对所述待执行脚本进行剔除处理,得到变量文本;According to all the string results, the script to be executed is eliminated to obtain variable text;
    通过字符串匹配算法,从所述变量文本中识别出与所述变量测试清单中的源变量相匹配的变量,得到各所述变量的变量结果;Through the string matching algorithm, the variable matching the source variable in the variable test list is identified from the variable text, and the variable result of each variable is obtained;
    将所有所述字符串结果和所有所述变量结果确定为所述检测结果。All of the string results and all of the variable results are determined as the detection results.
  12. 如权利要求10所述的计算机设备,其中,所述对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句,包括:The computer device according to claim 10, wherein the single-step splitting of the executable script to obtain at least one of the SQL single-step statements includes:
    对所述可执行脚本进行mapper生成,生成与所述待执行脚本对应的mapper文件;performing mapper generation on the executable script, and generating a mapper file corresponding to the script to be executed;
    对所述mapper文件进行单步识别及分割处理,分割出所述SQL单步语句。Perform single-step identification and segmentation processing on the mapper file, and segment the SQL single-step statement.
  13. 如权利要求9所述的计算机设备,其中,所述通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果,包括:The computer device according to claim 9, wherein the Mybatis tool is used to perform a synchronous test on all the SQL single-step scripts to be tested, and a single-step result corresponding to each of the SQL single-step statements is obtained, including :
    同步执行所有所述SQL待测试单步脚本,得到与各所述SQL待测试单步脚本一一对应的单步执行结果;Simultaneously execute all the SQL single-step scripts to be tested, and obtain the single-step execution results corresponding to each of the SQL single-step scripts to be tested one-to-one;
    根据所述变量测试清单和所有所述单步执行结果,对各所述SQL待测试单步脚本进行同步校验处理,得到与各所述SQL单步语句对应的单步结果。According to the variable test list and all the single-step execution results, a synchronous verification process is performed on each of the SQL single-step scripts to be tested, and a single-step result corresponding to each of the SQL single-step statements is obtained.
  14. 如权利要求9所述的计算机设备,其中,所述根据所述变量测试清单和所有所述单步执行结果,对各所述SQL待测试单步脚本进行同步校验处理,得到与各所述SQL单步语句对应的单步结果,包括:The computer device according to claim 9, wherein, according to the variable test list and all the single-step execution results, synchronous verification processing is performed on each of the SQL to-be-tested single-step scripts to obtain the same result as each of the single-step scripts to be tested. Single-step results corresponding to SQL single-step statements, including:
    运用快速查询算法,在所述变量测试清单中同步查找与各所述单步执行结果中的输出变量相同的预期变量,获取与查找到的所述预期变量对应的预期值;Using a quick query algorithm, the variable test list is synchronously searched for the same expected variable as the output variable in each of the single-step execution results, and the expected value corresponding to the found expected variable is obtained;
    将与各所述单步执行结果中的所述输出变量对应的输出变量值和获取的与其相应的所述预期值进行比对,得到所述单步结果。The single-step result is obtained by comparing the output variable value corresponding to the output variable in each of the single-step execution results with the obtained expected value corresponding to the output variable.
  15. 一个或多个存储有计算机可读指令的可读存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more readable storage media storing computer-readable instructions, wherein the computer-readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:
    获取待测文件;所述待测文件包括数据库信息、待执行脚本和变量测试清单;Obtain a file to be tested; the file to be tested includes database information, a script to be executed and a variable test list;
    通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句;Establish a connection to the source database corresponding to the database information through the Mybatis tool, and perform single-step parsing processing on the script to be executed to generate at least one SQL single-step statement;
    通过Eclipse工具,对各所述SQL单步语句进行入参识别,得到与各所述SQL单步语句一一对应的入参清单;Through the Eclipse tool, the input parameters are identified for each of the SQL single-step statements, and the input parameter list corresponding to each of the SQL single-step statements is obtained;
    通过所述Eclipse工具,根据所述变量测试清单和与各所述SQL单步语句对应的所述入参清单,对各所述SQL单步语句进行动态脚本生成处理,生成与各所述SQL单步语句对应的SQL待测试单步脚本;Through the Eclipse tool, according to the variable test list and the input parameter list corresponding to each of the SQL single-step statements, dynamic script generation processing is performed on each of the SQL single-step statements, and the corresponding SQL single-step statements are generated. The SQL to be tested single-step script corresponding to the step statement;
    通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果;Through the Mybatis tool, synchronous testing is performed on all the SQL single-step scripts to be tested, and the single-step results corresponding to each of the SQL single-step statements are obtained;
    根据所有所述单步结果,输出与所述待测文件对应的测试结果。According to all the single-step results, test results corresponding to the files to be tested are output.
  16. 如权利要求15所述的可读存储介质,其中,所述通过Mybatis工具建立与所述数据库信息对应的源数据库的连接,以及对所述待执行脚本进行单步解析处理,生成至少一个SQL单步语句,包括:The readable storage medium according to claim 15, wherein the connection to the source database corresponding to the database information is established through the Mybatis tool, and the script to be executed is subjected to single-step parsing processing to generate at least one SQL statement step statement, including:
    通过所述Mybatis工具,创建连接接口和与所述数据库信息对应的数据库配置文件,并通过所述数据库配置文件建立与所述源数据库的连接;Through the Mybatis tool, create a connection interface and a database configuration file corresponding to the database information, and establish a connection with the source database through the database configuration file;
    根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果;According to the variable test list, perform syntax detection and variable detection on the script to be executed to obtain a detection result;
    根据所述检测结果,对所述待执行脚本进行修正处理,得到可执行脚本;According to the detection result, modifying the script to be executed to obtain an executable script;
    对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句。Perform single-step splitting on the executable script to obtain at least one single-step SQL statement.
  17. 如权利要求16所述的可读存储介质,其中,所述根据所述变量测试清单,对所述待执行脚本进行语法检测及变量检测,得到检测结果,包括:The readable storage medium according to claim 16, wherein, according to the variable test list, performing syntax detection and variable detection on the script to be executed to obtain a detection result, comprising:
    对所述待执行脚本进行序列标注,得到标注文本;Perform sequence annotation on the script to be executed to obtain annotated text;
    通过相似匹配算法,查询出所述标注文本中的待处理字符串;Through the similarity matching algorithm, the character string to be processed in the marked text is queried;
    通过语法规则模型对各待处理字符串进行规则校验,得到各待处理字符串的字符串结果;Perform rule verification on each string to be processed through the grammar rule model, and obtain the string result of each string to be processed;
    根据所有所述字符串结果,对所述待执行脚本进行剔除处理,得到变量文本;According to all the string results, the script to be executed is eliminated to obtain variable text;
    通过字符串匹配算法,从所述变量文本中识别出与所述变量测试清单中的源变量相匹配的变量,得到各所述变量的变量结果;Through the string matching algorithm, the variable matching the source variable in the variable test list is identified from the variable text, and the variable result of each variable is obtained;
    将所有所述字符串结果和所有所述变量结果确定为所述检测结果。All of the string results and all of the variable results are determined as the detection results.
  18. 如权利要求16所述的可读存储介质,其中,所述对所述可执行脚本进行单步拆分,得到至少一个所述SQL单步语句,包括:The readable storage medium according to claim 16, wherein the single-step splitting of the executable script to obtain at least one of the SQL single-step statements includes:
    对所述可执行脚本进行mapper生成,生成与所述待执行脚本对应的mapper文件;performing mapper generation on the executable script, and generating a mapper file corresponding to the script to be executed;
    对所述mapper文件进行单步识别及分割处理,分割出所述SQL单步语句。Perform single-step identification and segmentation processing on the mapper file, and segment the SQL single-step statement.
  19. 如权利要求15所述的可读存储介质,其中,所述通过所述Mybatis工具,对所有所述SQL待测试单步脚本进行同步测试,得到与各所述SQL单步语句对应的单步结果,包括:The readable storage medium according to claim 15, wherein the Mybatis tool is used to perform a synchronous test on all the SQL single-step scripts to be tested, to obtain a single-step result corresponding to each of the SQL single-step statements ,include:
    同步执行所有所述SQL待测试单步脚本,得到与各所述SQL待测试单步脚本一一对应的单步执行结果;Simultaneously execute all the SQL single-step scripts to be tested, and obtain the single-step execution results corresponding to each of the SQL single-step scripts to be tested one-to-one;
    根据所述变量测试清单和所有所述单步执行结果,对各所述SQL待测试单步脚本进行同步校验处理,得到与各所述SQL单步语句对应的单步结果。According to the variable test list and all the single-step execution results, a synchronous verification process is performed on each of the SQL single-step scripts to be tested, and a single-step result corresponding to each of the SQL single-step statements is obtained.
  20. 如权利要求15所述的可读存储介质,其中,所述根据所述变量测试清单和所有所述单步执行结果,对各所述SQL待测试单步脚本进行同步校验处理,得到与各所述SQL单步语句对应的单步结果,包括:The readable storage medium according to claim 15, wherein, according to the variable test list and all the single-step execution results, synchronous verification processing is performed on each of the SQL to-be-tested single-step scripts, to obtain a The single-step result corresponding to the SQL single-step statement includes:
    运用快速查询算法,在所述变量测试清单中同步查找与各所述单步执行结果中的输出变量相同的预期变量,获取与查找到的所述预期变量对应的预期值;Using a quick query algorithm, the variable test list is synchronously searched for the same expected variable as the output variable in each of the single-step execution results, and the expected value corresponding to the found expected variable is obtained;
    将与各所述单步执行结果中的所述输出变量对应的输出变量值和获取的与其相应的所述预期值进行比对,得到所述单步结果。The single-step result is obtained by comparing the output variable value corresponding to the output variable in each of the single-step execution results with the obtained expected value corresponding to the output variable.
PCT/CN2021/109147 2021-04-25 2021-07-29 Method and apparatus for dynamic synchronous testing, device, and storage medium WO2022227314A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110449563.9A CN112988595A (en) 2021-04-25 2021-04-25 Dynamic synchronization test method, device, equipment and storage medium
CN202110449563.9 2021-04-25

Publications (1)

Publication Number Publication Date
WO2022227314A1 true WO2022227314A1 (en) 2022-11-03

Family

ID=76340088

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/109147 WO2022227314A1 (en) 2021-04-25 2021-07-29 Method and apparatus for dynamic synchronous testing, device, and storage medium

Country Status (2)

Country Link
CN (1) CN112988595A (en)
WO (1) WO2022227314A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116032813A (en) * 2022-12-29 2023-04-28 龙尚科技(上海)有限公司 Communication module testing method and device, electronic equipment and storage medium
CN116366609A (en) * 2023-06-02 2023-06-30 天津金城银行股份有限公司 Global unique identification generation method, system, computer and readable storage medium
CN116701237A (en) * 2023-08-09 2023-09-05 北京集度科技有限公司 Test script generation and test method, equipment and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988595A (en) * 2021-04-25 2021-06-18 深圳壹账通智能科技有限公司 Dynamic synchronization test method, device, equipment and storage medium
CN116881244B (en) * 2023-06-05 2024-03-26 易智瑞信息技术有限公司 Real-time processing method and device for space data based on column storage database

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100287214A1 (en) * 2009-05-08 2010-11-11 Microsoft Corporation Static Analysis Framework for Database Applications
CN109101415A (en) * 2018-06-25 2018-12-28 平安科技(深圳)有限公司 Interface test method, system, equipment and the storage medium compared based on database
CN109408381A (en) * 2018-10-10 2019-03-01 四川新网银行股份有限公司 A kind of product data automatic Verification platform and method based on data check template
CN110221967A (en) * 2019-05-20 2019-09-10 深圳壹账通智能科技有限公司 Test data building method, device, computer equipment and storage medium
CN112988595A (en) * 2021-04-25 2021-06-18 深圳壹账通智能科技有限公司 Dynamic synchronization test method, device, equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9823995B2 (en) * 2014-08-28 2017-11-21 Sap Se Structured query language debugger
CN108399130A (en) * 2018-02-28 2018-08-14 平安科技(深圳)有限公司 Automatically generate the method, apparatus, equipment and readable storage medium storing program for executing of test cases
CN110347598B (en) * 2019-07-10 2023-11-28 上海达梦数据库有限公司 Test script generation method and device, server and storage medium
CN110765152B (en) * 2019-09-18 2023-05-30 平安科技(深圳)有限公司 SQL extraction method, SQL extraction device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100287214A1 (en) * 2009-05-08 2010-11-11 Microsoft Corporation Static Analysis Framework for Database Applications
CN109101415A (en) * 2018-06-25 2018-12-28 平安科技(深圳)有限公司 Interface test method, system, equipment and the storage medium compared based on database
CN109408381A (en) * 2018-10-10 2019-03-01 四川新网银行股份有限公司 A kind of product data automatic Verification platform and method based on data check template
CN110221967A (en) * 2019-05-20 2019-09-10 深圳壹账通智能科技有限公司 Test data building method, device, computer equipment and storage medium
CN112988595A (en) * 2021-04-25 2021-06-18 深圳壹账通智能科技有限公司 Dynamic synchronization test method, device, equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116032813A (en) * 2022-12-29 2023-04-28 龙尚科技(上海)有限公司 Communication module testing method and device, electronic equipment and storage medium
CN116366609A (en) * 2023-06-02 2023-06-30 天津金城银行股份有限公司 Global unique identification generation method, system, computer and readable storage medium
CN116366609B (en) * 2023-06-02 2023-09-01 天津金城银行股份有限公司 Global unique identification generation method, system, computer and readable storage medium
CN116701237A (en) * 2023-08-09 2023-09-05 北京集度科技有限公司 Test script generation and test method, equipment and storage medium
CN116701237B (en) * 2023-08-09 2023-12-29 北京集度科技有限公司 Test script generation and test method, equipment and storage medium

Also Published As

Publication number Publication date
CN112988595A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
WO2022227314A1 (en) Method and apparatus for dynamic synchronous testing, device, and storage medium
WO2021037196A1 (en) Smart contract code vulnerability detection method and apparatus, computer device and storage medium
US8782609B2 (en) Test failure bucketing
WO2022142613A1 (en) Training corpus expansion method and apparatus, and intent recognition model training method and apparatus
AU2010319344B2 (en) Managing record format information
US8887135B2 (en) Generating test cases for functional testing of a software application
WO2021217846A1 (en) Interface data processing method and apparatus, and computer device and storage medium
WO2021258848A1 (en) Data dictionary generation method and apparatus, data query method and apparatus, and device and medium
WO2020206840A1 (en) Code translation method and apparatus, computer device, and storage medium
CN109325042B (en) Processing template acquisition method, form processing method, device, equipment and medium
JP2018505506A (en) Machine-based instruction editing
CN112181489A (en) Code migration method and device, computer equipment and storage medium
WO2020206838A1 (en) Code snippet translation method and apparatus, computer device, and storage medium
CN115827895A (en) Vulnerability knowledge graph processing method, device, equipment and medium
CN111897946A (en) Vulnerability patch recommendation method, system, computer equipment and storage medium
CN108388606B (en) Method for checking base table field names in Sql sentences and computer equipment
CN110955608A (en) Test data processing method and device, computer equipment and storage medium
CN106547765B (en) SQ L-based database management method and device
US10592400B2 (en) System and method for creating variants in a test database during various test stages
GB2513348A (en) Translation validation
CN111309596A (en) Database testing method and device, terminal equipment and storage medium
WO2019148797A1 (en) Natural language processing method, device, computer apparatus, and storage medium
Lavoie et al. A case study of TTCN-3 test scripts clone analysis in an industrial telecommunication setting
WO2021259290A1 (en) Stored procedure conversion method and apparatus, and device and storage medium
US11366742B2 (en) Automated identification of lines of code related to errors field

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21938780

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 220324)