[go: up one dir, main page]

CN110471833A - A kind of acquisition methods of test data, electronic equipment and storage medium - Google Patents

A kind of acquisition methods of test data, electronic equipment and storage medium Download PDF

Info

Publication number
CN110471833A
CN110471833A CN201910566206.3A CN201910566206A CN110471833A CN 110471833 A CN110471833 A CN 110471833A CN 201910566206 A CN201910566206 A CN 201910566206A CN 110471833 A CN110471833 A CN 110471833A
Authority
CN
China
Prior art keywords
test data
test
identification information
data
acquisition methods
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201910566206.3A
Other languages
Chinese (zh)
Inventor
许敏杰
黄穗萍
张宗兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and Technology Co Ltd
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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN201910566206.3A priority Critical patent/CN110471833A/en
Publication of CN110471833A publication Critical patent/CN110471833A/en
Pending legal-status Critical Current

Links

Classifications

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

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

The present embodiments relate to testing fields, disclose the acquisition methods, electronic equipment and storage medium of a kind of test data.In the section Example of the application, the acquisition methods of test data include: the identification information for obtaining the first test data;According to the identification information of the first test data, the first test data is obtained from database;According to the first corresponding relationship of the field of the second test data of the field and pre-generatmg of the first test data and the first test data, the second test data is generated.In the realization, can automatic Data Generation Test, reduce maintenance automatic test test data workload.

Description

一种测试数据的获取方法、电子设备及存储介质A test data acquisition method, electronic equipment and storage medium

技术领域technical field

本发明实施例涉及通信技术领域,特别涉及一种测试数据的获取方法、电子设备及存储介质。Embodiments of the present invention relate to the field of communication technologies, and in particular, to a method for acquiring test data, electronic equipment, and a storage medium.

背景技术Background technique

目前,公知的软件自动化测试脚本,如webUI自动化测试、http接口自动化测试,是由前置准备、操作步骤(ACTION(行为)+DATA(数据))、预期结果、实际结果、后置清理组合而成。对于软件的功能测试而言,它的前置准备、操作步骤中的ACTION、实际结果获取、后置清理,大多是固定的,而操作步骤的DATA和预期结果是变化的,以下统称测试数据。对于软件自动化测试的测试数据,目前公知的处理方式为数据驱动方式,即把测试数据写死在EXCEL(表格)或CSV(逗号分割值文件)之类的数据源文件,数据内容包含大量字段。At present, known software automated test scripts, such as webUI automated testing and http interface automated testing, are composed of pre-preparation, operation steps (ACTION (behavior)+DATA (data)), expected results, actual results, and post-clearing combinations. to make. For functional testing of software, its pre-preparation, action in operation steps, actual result acquisition, and post-clearing are mostly fixed, while the data and expected results of operation steps are variable, hereinafter collectively referred to as test data. For the test data of software automated testing, the currently known processing method is a data-driven method, that is, the test data is hard-written in a data source file such as EXCEL (table) or CSV (comma-separated value file), and the data content includes a large number of fields.

然而,发明人发现现有技术中至少存在如下问题:上述测试数据的处理方式,在用例数越多(假设测试用例数为M)、表单越大(假设每个测试用例的字段数为N)的情况下,单次编写维护工作量就越大(M*(N+1))。如果功能未变,但是测试数据失效,每次维护工作都为M*(N+1)。However, the inventor finds that there are at least the following problems in the prior art: the processing method of the above-mentioned test data, the more the number of use cases (assuming that the number of test cases is M), the larger the form (assuming that the number of fields of each test case is N) In the case of , the greater the maintenance workload for a single write (M*(N+1)). If the function does not change, but the test data fails, each maintenance work is M*(N+1).

需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。It should be noted that the information disclosed in the above background section is only for enhancing the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to those of ordinary skill in the art.

发明内容Contents of the invention

本发明实施方式的目的在于提供一种测试数据的获取方法、电子设备及存储介质,使得能够自动生成测试数据,减少了维护测试数据的工作量。The purpose of the embodiments of the present invention is to provide a method for acquiring test data, an electronic device and a storage medium, so that the test data can be automatically generated and the workload of maintaining the test data is reduced.

为解决上述技术问题,本发明的实施方式提供了一种测试数据的获取方法、电子设备及存储介质,包括以下步骤:获取第一测试数据的标识信息;根据第一测试数据的标识信息,从数据库中获取第一测试数据;根据第一测试数据,以及第一测试数据的字段和预生成的第二测试数据的字段的第一对应关系,生成第二测试数据。In order to solve the above technical problems, the embodiments of the present invention provide a test data acquisition method, electronic equipment and storage medium, including the following steps: acquiring the identification information of the first test data; according to the identification information of the first test data, from The first test data is acquired from the database; the second test data is generated according to the first test data and the first corresponding relationship between the fields of the first test data and the pre-generated fields of the second test data.

本发明的实施方式还提供了一种电子设备,包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行上述实施方式提及的测试数据的获取方法。The embodiment of the present invention also provides an electronic device, including: at least one processor; and a memory connected to the at least one processor in communication; wherein, the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by at least one processor. Executed by one processor, so that at least one processor can execute the method for acquiring test data mentioned in the above implementation manner.

本发明的实施方式还提供了一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时实现上述实施方式提及的测试数据的获取方法。Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the method for acquiring test data mentioned in the above embodiment is implemented.

本发明实施方式相对于现有技术而言,电子设备可以通过查询数据库的方式,获取第一测试数据,并基于第一测试数据,自动生成测试数据,无需测试人员为自动化测试编写和维护各个测试用例的测试数据,减少了测试数据的维护量,减少了测试人员的工作量。Compared with the prior art, the embodiment of the present invention can obtain the first test data by querying the database, and automatically generate the test data based on the first test data, without the need for testers to write and maintain each test for the automated test. The test data of use cases reduces the amount of test data maintenance and the workload of testers.

另外,根据第一测试数据,以及第一测试数据的字段和预生成的第二测试数据的字段的第一对应关系,生成第二测试数据,具体包括:根据预设的字段处理逻辑,对第一测试数据中的字段进行处理;根据处理后的第一测试数据,生成第二测试数据;根据第一对应关系,确定与第二测试数据的字段对应的处理后的第一测试数据中的字段;根据对应的处理后的第一测试数据中的字段,确定第二测试数据。该实现中,对第一测试数据进行处理,可以实现唯一值字段的数值自动生成等功能,以满足第二测试数据的要求,进一步减少了测试人员的工作量。除此之外,能够自动对处理后的第一测试数据中的数据进行筛选,去除无用数据,提高了第二测试数据的有效性。In addition, according to the first test data and the first corresponding relationship between the fields of the first test data and the fields of the pre-generated second test data, generating the second test data specifically includes: according to the preset field processing logic, processing the first A field in the test data is processed; according to the processed first test data, second test data is generated; according to the first correspondence, the field in the processed first test data corresponding to the field of the second test data is determined ; Determine the second test data according to the fields in the corresponding processed first test data. In this implementation, the processing of the first test data can realize functions such as automatic generation of the value of the unique value field, so as to meet the requirements of the second test data and further reduce the workload of testers. In addition, the data in the processed first test data can be automatically screened to remove useless data and improve the effectiveness of the second test data.

另外,在根据第一测试数据,以及第一测试数据的字段和预生成的第二测试数据的字段的第一对应关系,生成第二测试数据之前,测试数据的获取方法还包括:根据测试用例的标识信息,获取测试用例对应的第一对应关系。In addition, before generating the second test data according to the first test data and the first corresponding relationship between the fields of the first test data and the fields of the pre-generated second test data, the method for obtaining the test data further includes: according to the test case The identification information of the test case to obtain the first corresponding relationship corresponding to the test case.

另外,根据第一测试数据的标识信息,从数据库中获取第一测试数据,具体包括:获取预设的查询语句模板;根据查询语句模板,以及第一测试数据的标识信息,生成查询语句;通过执行查询语句,得到第一测试数据。该实现中,自动识别第一测试数据,提高了电子设备的自动化程度,减少了测试人员维护测试数据的人力消耗。In addition, obtaining the first test data from the database according to the identification information of the first test data specifically includes: obtaining a preset query statement template; generating a query statement according to the query statement template and the identification information of the first test data; Execute the query statement to obtain the first test data. In this implementation, the first test data is automatically identified, the degree of automation of the electronic equipment is improved, and the labor consumption of test personnel for maintaining test data is reduced.

另外,获取第一测试数据的标识信息,具体包括:确定测试用例的标识信息;根据测试用例的标识信息和预设的第二对应关系,确定第一测试数据的标识信息;第二对应关系为测试用例的标识信息和第一测试数据的标识信息的对应关系。In addition, obtaining the identification information of the first test data specifically includes: determining the identification information of the test case; determining the identification information of the first test data according to the identification information of the test case and the preset second corresponding relationship; the second corresponding relationship is The corresponding relationship between the identification information of the test case and the identification information of the first test data.

另外,在根据第一测试数据,生成第二测试数据之后,测试数据的获取方法还包括:将第二测试数据输入测试用例;在执行测试用例的过程中,若接收到错误提示,提示测试人员进行人工测试。In addition, after the second test data is generated according to the first test data, the method for obtaining the test data further includes: inputting the second test data into the test case; in the process of executing the test case, if an error prompt is received, prompting the tester Do manual testing.

另外,在提示测试人员进行人工测试之后,测试数据的获取方法还包括:在确定人工测试成功后,将人工测试过程中产生的第三测试数据保存至数据库中。In addition, after the tester is prompted to perform the manual test, the method for obtaining the test data further includes: after the manual test is determined to be successful, saving the third test data generated during the manual test into the database.

另外,在执行测试用例之后,测试数据的获取方法还包括:若确定测试用例执行成功,将本次执行测试用例产生的第四测试数据保存至数据库中。In addition, after the test case is executed, the method for obtaining the test data further includes: if it is determined that the test case is executed successfully, saving the fourth test data generated by executing the test case this time into the database.

附图说明Description of drawings

一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplifications do not constitute a limitation to the embodiments. Elements with the same reference numerals in the drawings represent similar elements. Unless otherwise stated, the drawings in the drawings are not limited to scale.

图1是本发明的第一实施方式的测试数据的获取方法的流程图;Fig. 1 is the flowchart of the acquisition method of the test data of the first embodiment of the present invention;

图2是本发明的第二实施方式的测试数据的获取方法的流程图;Fig. 2 is the flowchart of the acquisition method of the test data of the second embodiment of the present invention;

图3是本发明的第二实施方式的底层API之间的交互示意图;Fig. 3 is a schematic diagram of interaction between the underlying APIs of the second embodiment of the present invention;

图4是本发明的第三实施方式的测试数据的获取装置的结构示意图;4 is a schematic structural diagram of a test data acquisition device according to a third embodiment of the present invention;

图5是本发明的第四实施方式的电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, various implementation modes of the present invention will be described in detail below in conjunction with the accompanying drawings. However, those of ordinary skill in the art can understand that, in each implementation manner of the present invention, many technical details are provided for readers to better understand the present application. However, even without these technical details and various changes and modifications based on the following implementation modes, the technical solution claimed in this application can also be realized.

本发明的第一实施方式涉及一种测试数据的获取方法,应用于电子设备,例如,终端或服务器,电子设备可以在测试软件或测试系统时,通过执行本实施方式提及的测试数据的获取方法,来获取测试过程中使用的测试数据。如图1所示,测试数据的获取方法包括以下步骤:The first embodiment of the present invention relates to a test data acquisition method, which is applied to electronic devices, such as terminals or servers. When the electronic device is testing software or a test system, it can perform the test data acquisition mentioned in this embodiment method to get the test data used during the test. As shown in Figure 1, the method for obtaining test data includes the following steps:

步骤101:获取第一测试数据的标识信息。Step 101: Obtain identification information of first test data.

具体地说,电子设备的数据库中存储有测试用例被执行后产生的第一测试数据。电子设备可以根据测试用例的标识信息,来确定第一测试数据的标识信息,也可以根据输入设备检测到的信息,确定第一测试数据的标识信息。Specifically, the first test data generated after the test case is executed is stored in the database of the electronic device. The electronic device may determine the identification information of the first test data according to the identification information of the test case, or may determine the identification information of the first test data according to the information detected by the input device.

在一个例子中,电子设备获取第一测试数据的标识信息的过程如下:电子设备先确定测试用例的标识信息,再根据测试用例的标识信息和预设的第二对应关系,确定第一测试数据的标识信息;第二对应关系为测试用例的标识信息和第一测试数据的标识信息的对应关系。其中,测试用例的标识信息可以是测试用例的用例名,第一测试数据的标识信息可以是第一测试数据的主键。In an example, the process for the electronic device to obtain the identification information of the first test data is as follows: the electronic device first determines the identification information of the test case, and then determines the first test data according to the identification information of the test case and the preset second corresponding relationship. the identification information of the test case; the second corresponding relationship is the corresponding relationship between the identification information of the test case and the identification information of the first test data. Wherein, the identification information of the test case may be a test case name, and the identification information of the first test data may be a primary key of the first test data.

具体实现中,用户可以将第二对应关系写在配置文件中,电子设备通过读取配置文件,确定第二对应关系。In a specific implementation, the user may write the second correspondence in the configuration file, and the electronic device determines the second correspondence by reading the configuration file.

值得一提的是,电子设备根据测试用例和第一测试数据的关联关系,自动识别第一测试数据,提高了电子设备的自动化程度,减少了测试人员维护测试数据的人力消耗。It is worth mentioning that the electronic device automatically identifies the first test data according to the correlation between the test case and the first test data, which improves the automation of the electronic device and reduces the manpower consumption of testers for maintaining test data.

在另一个例子中,用户通过输入设备输入测试用例对应的第一测试数据的标识信息,电子设备根据输入设备检测的信息,确定第一测试数据的标识信息,例如,用户通过输入设备输入第一测试数据的主键,电子设备就可以根据用户输入的信息,确定第一测试数据的标识信息。In another example, the user inputs the identification information of the first test data corresponding to the test case through the input device, and the electronic device determines the identification information of the first test data according to the information detected by the input device. For example, the user inputs the first test data through the input device. The primary key of the test data, the electronic device can determine the identification information of the first test data according to the information input by the user.

需要说明的是,本领域技术人员可以理解,实际应用中,还可以通过其他方式来获取第一测试数据的标识信息,此处不一一列举,本实施方式不限制获取第一测试数据的标识信息的方法。It should be noted that those skilled in the art can understand that in practical applications, the identification information of the first test data can also be obtained in other ways, which are not listed here. This embodiment does not limit the identification information of the first test data. method of information.

步骤102:根据第一测试数据的标识信息,从数据库中获取第一测试数据。Step 102: Obtain the first test data from the database according to the identification information of the first test data.

具体地说,在已知第一测试数据的标识信息的情况下,电子设备可以通过查询的方式,从数据库中查询标识信息为该第一测试数据的标识信息的第一测试数据,调取该第一测试数据。Specifically, when the identification information of the first test data is known, the electronic device may query the database for the first test data whose identification information is the identification information of the first test data, and retrieve the first test data.

在一个例子中,电子设备获取预设的查询语句模板;根据查询语句模板,以及第一测试数据的标识信息,生成查询语句;通过执行查询语句,得到对应的第一测试数据。例如,查询语句模板可以是select*from table;其中,select表示查询,*在查询阶段被替换为第一测试数据的标识信息,from table表示从表格(table)中进行查询操作,“table”可以被替换为存储第一测试数据的表格的具体表名。In an example, the electronic device acquires a preset query statement template; generates a query statement according to the query statement template and identification information of the first test data; and obtains corresponding first test data by executing the query statement. For example, the query statement template can be select*from table; wherein, select means query, * is replaced with the identification information of the first test data in the query phase, and from table means to perform a query operation from a table, and "table" can be is replaced with the specific table name of the table that stores the first test data.

需要说明的是,本领域技术人员可以理解,实际应用中,由于使用的数据库软件不同,其查询语句模板可能不同,本领域技术人员可以根据需要设置查询语句模板。It should be noted that those skilled in the art can understand that in practical applications, due to different database software used, the query statement templates may be different, and those skilled in the art can set the query statement templates as required.

需要说明的是,本领域技术人员可以理解,实际应用中,由于使用的数据库软件不同,获取第一测试数据的方式可能不同,本领域技术人员可以根据使用的数据库软件,来设置第一测试数据的获取逻辑,本实施方式不限制获取从数据库中获取第一测试数据的方式。It should be noted that those skilled in the art can understand that in practical applications, due to the different database software used, the way to obtain the first test data may be different, and those skilled in the art can set the first test data according to the database software used. acquisition logic, this embodiment does not limit the manner of acquiring the first test data from the database.

步骤103:根据第一测试数据,以及第一测试数据的字段和预生成的第二测试数据的字段的第一对应关系,生成第二测试数据。Step 103: Generate second test data according to the first test data and the first corresponding relationship between the fields of the first test data and the pre-generated fields of the second test data.

具体地说,电子设备以测试用例被执行后产生的第一测试数据为依据,自动生成第二测试数据。Specifically, the electronic device automatically generates the second test data based on the first test data generated after the test case is executed.

通过上述内容可知,在自动化测试的过程中,电子设备可以通过查询数据库,获取第一测试数据,并基于第一测试数据,自动生成第二测试数据,无需测试人员为自动化测试编写和维护各个测试用例的测试数据,减少了测试数据的编写量和维护量,减少了测试人员的工作量。From the above content, it can be seen that in the process of automated testing, the electronic device can obtain the first test data by querying the database, and automatically generate the second test data based on the first test data, without the need for testers to write and maintain each test for automated testing. The test data of use cases reduces the amount of writing and maintenance of test data, and reduces the workload of testers.

在一个例子中,电子设备生成第二测试数据的过程具体包括:根据预设的字段处理逻辑,对第一测试数据中的字段进行处理;根据处理后的第一测试数据,生成第二测试数据;根据第一对应关系,确定与第二测试数据的字段对应的处理后的第一测试数据中的字段;根据对应的处理后的第一测试数据中的字段,确定第二测试数据。具体地说,由于数据库中记录的测试操作中产生的第一测试数据中,可能包含一些测试用例不需要的数据,即无用数据,测试人员可以在执行该测试数据的获取方法前,通过查看数据库中的数据,确定该测试用例所需要的测试数据在第一测试数据中的哪些字段中,并给定第一对应关系,以确保生成的第二测试数据中不包括无用数据。In an example, the process of generating the second test data by the electronic device specifically includes: processing the fields in the first test data according to preset field processing logic; generating the second test data according to the processed first test data ; According to the first correspondence, determine the fields in the processed first test data corresponding to the fields of the second test data; determine the second test data according to the corresponding processed fields in the first test data. Specifically, because the first test data generated in the test operation recorded in the database may contain some data that is not required by the test case, that is, useless data, the tester can check the database before executing the test data acquisition method. , determine which fields in the first test data the test data required by the test case are in, and give the first correspondence to ensure that the generated second test data does not include useless data.

值得一提的是,电子设备能够自动对处理后的第一测试数据中的数据进行筛选,去除无用数据,提高了第二测试数据的有效性。It is worth mentioning that the electronic device can automatically filter the data in the processed first test data, remove useless data, and improve the validity of the second test data.

需要说明的是,本领域技术人员可以理解,预设的字段处理逻辑可以由测试人员根据测试用例对第二测试数据的需求编写,例如,预设的字段处理逻辑可以是特殊值处理逻辑,即对第一测试数据中的指定字段的值进行处理,以满足该字段的要求,例如,对于第二测试数据中的字段值必须是唯一值的第一字段,可以设置增加时间戳等处理逻辑,即在与第一字段对应的第一测试数据的字段末尾加上时间戳,以保证第一字段的唯一性。又如,对于第二测试数据中需要包含特定字符的第二字段,则可以设置增加特定字符的处理逻辑,以保证生成的第二测试数据的第二字段中包括特定字符。再如,对于第二测试数据中字段值只能为1或2的第三字段,可以设置替换逻辑,将与第三字段对应的第一测试数据的字段替换为1或2,再作为第二测试数据的第三字段。It should be noted that those skilled in the art can understand that the preset field processing logic can be written by the tester according to the requirements of the test case for the second test data, for example, the preset field processing logic can be a special value processing logic, namely Process the value of the specified field in the first test data to meet the requirements of the field. For example, for the first field whose field value must be unique in the second test data, processing logic such as adding a timestamp can be set. That is, a timestamp is added at the end of the field of the first test data corresponding to the first field to ensure the uniqueness of the first field. As another example, for the second field that needs to contain specific characters in the second test data, processing logic for adding specific characters may be set to ensure that the second field of the generated second test data includes specific characters. For another example, for the third field whose field value can only be 1 or 2 in the second test data, you can set the replacement logic to replace the field of the first test data corresponding to the third field with 1 or 2, and then use it as the second field. The third field of the test data.

需要说明的是,上述字段处理逻辑仅为举例说明,实际应用中,可以根据各个字段的需求,为各个字段设置相应的处理逻辑。It should be noted that the above-mentioned field processing logic is only for illustration. In practical applications, corresponding processing logic can be set for each field according to the requirements of each field.

值得一提的是,通过预设的字段处理逻辑,可以对第一测试数据中的一些字段的值进行修改,可以实现唯一值字段的数值自动生成等功能,以满足第二测试数据的要求,进一步减少了测试人员的工作量。It is worth mentioning that, through the preset field processing logic, the values of some fields in the first test data can be modified, and functions such as automatic generation of unique value fields can be realized to meet the requirements of the second test data. Further reduce the workload of testers.

需要说明的是,本领域技术人员可以理解,实际应用中,还可以根据需要对第一测试数据进行其他处理,本实施方式不限制对第一测试数据的处理过程。It should be noted that those skilled in the art can understand that in practical applications, other processing may be performed on the first test data as required, and this embodiment does not limit the processing of the first test data.

在一个例子中,电子设备根据测试用例的标识信息,获取测试用例对应的第一对应关系。具体地说,每个测试用例的第一测试数据和预生成的第二测试数据的对应关系可能不同,电子设备根据测试用例的标识信息,获取该测试用例所对应的第一对应关系。In an example, the electronic device acquires the first corresponding relationship corresponding to the test case according to the identification information of the test case. Specifically, the correspondence between the first test data of each test case and the pre-generated second test data may be different, and the electronic device obtains the first correspondence corresponding to the test case according to the identification information of the test case.

需要说明的是,以上仅为举例说明,并不对本发明的技术方案构成限定。It should be noted that the above is only for illustration and does not limit the technical solution of the present invention.

与现有技术相比,本实施方式中提供的测试数据的获取方法,电子设备可以通过查询数据库,获取第一测试数据,并基于第一测试数据,自动生成测试数据,无需测试人员为自动化测试编写和维护各个测试用例的测试数据,减少了测试数据的维护量,减少了测试人员的工作量。除此之外,电子设备可以根据预设的字段处理逻辑对第一测试数据进行处理,根据处理后的第一测试数据生成第二测试数据,以提高第二测试数据的有效性。Compared with the prior art, in the test data acquisition method provided in this embodiment, the electronic device can obtain the first test data by querying the database, and automatically generate test data based on the first test data, without the need for testers to conduct automated tests. Writing and maintaining the test data of each test case reduces the amount of test data maintenance and the workload of testers. In addition, the electronic device can process the first test data according to the preset field processing logic, and generate the second test data according to the processed first test data, so as to improve the validity of the second test data.

本发明的第二实施方式涉及一种测试数据的获取方法,本实施方式在第一实施方式的基础上做了进一步改进,具体改进之处为:在生成第二测试数据后,使用第二测试数据对软件或系统进行测试,并根据测试结果进行后续操作。The second embodiment of the present invention relates to a method for obtaining test data. This embodiment is further improved on the basis of the first embodiment. The specific improvement is: after generating the second test data, use the second test The data is used to test the software or system, and to carry out subsequent operations based on the test results.

具体的说,如图2所示,在本实施方式中,包含步骤201至步骤208,其中,步骤201至步骤203分别与第一实施方式中的步骤101至步骤103大致相同,此处不再赘述。下面主要介绍不同之处:Specifically, as shown in FIG. 2, in this embodiment, steps 201 to 208 are included, wherein, steps 201 to 203 are substantially the same as steps 101 to 103 in the first embodiment, and are not repeated here. repeat. Here are the main differences:

步骤201:获取第一测试数据的标识信息。Step 201: Obtain identification information of the first test data.

步骤202:根据第一测试数据的标识信息,从数据库中获取第一测试数据。Step 202: Obtain the first test data from the database according to the identification information of the first test data.

步骤203:根据第一测试数据,生成本次执行测试用例所需的第二测试数据。Step 203: According to the first test data, generate the second test data required for executing the test case this time.

步骤204:将第二测试数据输入测试用例。Step 204: Input the second test data into the test case.

具体地说,在进行自动化测试时,电子设备在确定第二测试数据后,会将第二测试数据输入测试用例,并执行该测试用例。其中,自动化测试的测试脚本可以是WEBUI自动化测试,也可以是接口自动化测试,本实施方式不限制自动化测试脚本的类型。Specifically, when performing an automated test, after determining the second test data, the electronic device will input the second test data into a test case and execute the test case. Wherein, the test script of the automated test may be a WEBUI automated test, or an interface automated test, and this embodiment does not limit the type of the automated test script.

步骤205:判断测试是否成功。Step 205: Determine whether the test is successful.

具体地说,在执行测试用例的过程中,若接收到错误提示,即测试失败,则执行步骤206,若在执行完测试用例后,仍未接收到错误提示,则测试成功,执行步骤208。Specifically, in the process of executing the test case, if an error message is received, that is, the test fails, then step 206 is performed; if no error message is received after the test case is executed, the test is successful, and step 208 is performed.

步骤206:提示测试人员进行人工测试。Step 206: Prompt the tester to perform manual testing.

具体地说,若测试失败,说明被测试的软件或系统的功能可能发生了变化,导致原有的第一测试数据无法适用于被测试的软件或系统,进而使得基于第一测试数据生成的第二测试数据失效。该情况下,电子设备可以通过警报或其他方式,提示测试人员测试失败,进行人工测试,即由测试人员重新设置测试数据,对被测试的软件或系统进行测试。Specifically, if the test fails, it indicates that the function of the software or system under test may have changed, causing the original first test data to be unsuitable for the software or system under test, thereby making the first test data generated based on the first test data 2. The test data is invalid. In this case, the electronic device may prompt the tester to fail the test through an alarm or other means, and perform a manual test, that is, the tester resets the test data to test the software or system under test.

步骤207:在确定人工测试成功后,将人工测试过程中产生的第三测试数据保存至数据库中。之后结束流程。Step 207: After determining that the manual test is successful, save the third test data generated during the manual test into the database. Then end the process.

具体地说,对第三测试数据进行保存,以获得能够作为产生适用于当前被测试的软件或系统的测试数据的素材。Specifically, the third test data is saved to obtain materials that can be used as test data suitable for the currently tested software or system.

步骤208:将本次执行测试用例产生的第四测试数据保存至数据库中。Step 208: Save the fourth test data generated by executing the test case this time into the database.

具体地说,若测试用例执行成功,说明本次测试过程中使用的第二测试数据,电子设备可以记录第二测试数据,为后续自动产生测试数据提供素材。Specifically, if the test case is successfully executed, it indicates the second test data used in this test process, and the electronic device can record the second test data to provide materials for the subsequent automatic generation of test data.

需要说明的是,本领域技术人员可以理解,实际应用中,电子设备可以对本次测试过程中产生的一些其他数据进行记录,将其他数据和第二测试数据作为第四测试数据,保存在数据库中,本实施方式不限制第四测试数据所包含的数据内容。It should be noted that those skilled in the art can understand that in practical applications, the electronic device can record some other data generated during this test, and store the other data and the second test data as the fourth test data in the database In this embodiment, the data content included in the fourth test data is not limited.

以下结合实际情况,对测试数据的获取方法进行举例说明。The method for obtaining the test data is described below with an example in combination with the actual situation.

本实施方式中,电子设备采用关联关系维护第二测试数据,底层应用程序编程接口(Application Programming Interface,API)根据存储第二对应关系的配置文件、存储预设的第一测试数据的获取逻辑和预设的字段处理逻辑的处理逻辑文件,以及存储第一对应关系的映射文件,自动生成第二测试数据。具体地说,底层API包括底层API1 301、底层API2 302和底层API3 303,底层API之间的交互示意图如图3所示,底层API1 301根据配置文件311中的测试用例和第一测试数据的主键的第二对应关系、处理逻辑文件312中的第一测试数据的获取逻辑,拼接数据库304的查询语句,从数据库304获取第一测试数据。底层API2 302根据处理逻辑文件312中的字段处理逻辑,对底层API1 301获取到的第一测试数据中的字段进行处理,如将一些字段值设置为唯一值,将一些字段值设置为json串。底层API3 303根据映射文件313中的第一对应关系,从底层API2 302处理得到的第一测试数据中,选择一些字段,构成第二测试数据,将第二测试数据输入自动化测试脚本305。自动化测试脚本305将第二测试数据输入测试用例,对被测软件或系统306进行测试。在测试成功后,将测试过程中产生的测试数据存储至数据库中。在自动化测试脚本305执行的时候,电子设备自动触发上述测试数据的获取方法,逐层调用以上底层API,动态生成第二测试数据,然后使用第二测试数据对被测软件或系统进行自动化测试。测试结束后,若测试成功,存储测试过程中产生的第四测试数据。具体实现中,底层API可以通过对开源架构(如Robotframework)、开源库(如Database Library)和自定义库(可以采用python编写)的二次开发和封装获得。In this embodiment, the electronic device maintains the second test data using the association relationship, and the underlying application programming interface (Application Programming Interface, API) stores the configuration file of the second corresponding relationship, the acquisition logic and the preset first test data The processing logic file of the preset field processing logic and the mapping file storing the first correspondence relationship automatically generate the second test data. Specifically, the underlying API includes underlying API1 301, underlying API2 302, and underlying API3 303. The schematic diagram of the interaction between the underlying APIs is shown in Figure 3. The underlying API1 301 is based on the test case in the configuration file 311 and the primary key of the first test data. The second corresponding relationship, the acquisition logic of the first test data in the processing logic file 312, splice the query statement of the database 304, and acquire the first test data from the database 304. The underlying API2 302 processes the fields in the first test data acquired by the underlying API1 301 according to the field processing logic in the processing logic file 312, such as setting some field values as unique values and setting some field values as json strings. The underlying API3 303 selects some fields from the first test data processed by the underlying API2 302 according to the first correspondence in the mapping file 313 to form the second test data, and inputs the second test data into the automated test script 305 . The automated test script 305 inputs the second test data into the test case to test the software or system 306 under test. After the test is successful, the test data generated during the test is stored in the database. When the automated test script 305 is executed, the electronic device automatically triggers the above test data acquisition method, calls the above underlying API layer by layer, dynamically generates second test data, and then uses the second test data to perform automated tests on the software or system under test. After the test, if the test is successful, the fourth test data generated during the test is stored. In specific implementation, the underlying API can be obtained through secondary development and packaging of open source architectures (such as Robotframework), open source libraries (such as Database Library) and custom libraries (which can be written in python).

采用本实施方式提及的测试数据的获取方法,若被测软件或系统功能不变,从数据库获取第一测试数据生成第二测试数据->自动化测试->存储第四测试数据->从数据库获取第一测试数据生成第二测试数据将构成循环;如被测软件或系统功能发生变化,自动化测试脚本给予错误提示,测试人员收到提示后对被测软件或系统进行人工测试,人工测试过程中产生的测试数据存储数据库,测试人员根据功能变化情况,维护配置文件、处理逻辑文件和映射文件后,重新进入上文被测软件或系统功能不变的循环中。Adopt the acquisition method of test data mentioned in this embodiment mode, if the software under test or system function is unchanged, acquire the first test data from the database to generate the second test data->automated test->store the fourth test data->from the database Obtaining the first test data and generating the second test data will constitute a cycle; if the function of the software or system under test changes, the automated test script will give an error prompt, and the tester will manually test the software or system under test after receiving the prompt. The test data generated in the database is stored in the database. After the testers maintain the configuration file, process the logic file and the mapping file according to the function change, they re-enter the cycle of the above tested software or system function unchanged.

以下对基于EXCEL、CSV等的测试数据的获取方法和本实施方式提及的测试数据的获取方法进行对比,说明本实施方式提及的测试数据的获取方法的优点。The following compares the method for acquiring test data based on EXCEL, CSV, etc. with the method for acquiring test data mentioned in this embodiment, and describes the advantages of the method for acquiring test data mentioned in this embodiment.

1)假设表单中每个字段的编写量为1,基于EXCEL、CSV等的测试数据的获取方法,测试数据首次编写量为:M*(N+1),其中M为测试用例数,N为每个测试用例的字段数;基于本实施方式提及的测试数据的获取方法,测试人员只需要编写测试用例的标识信息和该测试用例对应的测试数据的标识信息的对应关系(编写量为2M)、每个测试用例的字段(编写量为N),以及少量简单数据库语句(即查询语句等),故首次编写量为:2M+N+少量简单数据库语句。被测软件或系统功能越复杂,字段越多,普通数据驱动方式的首次编写量比本实施方式的首次工作量大越多。1) Assuming that the writing amount of each field in the form is 1, based on the method of obtaining test data such as EXCEL, CSV, etc., the first writing amount of test data is: M*(N+1), where M is the number of test cases, and N is The number of fields of each test case; based on the acquisition method of test data mentioned in this embodiment, the tester only needs to write the correspondence between the identification information of the test case and the identification information of the test data corresponding to the test case (the amount of writing is 2M ), the fields of each test case (the amount of writing is N), and a small amount of simple database statements (ie, query statements, etc.), so the amount of writing for the first time is: 2M+N+ a small number of simple database statements. The more complex the function of the software or system to be tested, the more fields there are, and the initial writing workload of the common data-driven method is greater than that of this implementation method.

2)基于EXCEL、CSV等的测试数据的获取方法,如果软件或系统功能存在动态表单嵌套,即字段值为json串,因为数据量动态变化,因此维护难度较大;基于本实施方式提及的测试数据的获取方法,由于字段值由电子设备根据预设的字段处理逻辑自动生成,测试人员感知不到数据量变化的维护区别。2) The acquisition method of test data based on EXCEL, CSV, etc., if there is a dynamic form nesting in the software or system function, that is, the field value is a json string, because the amount of data changes dynamically, it is difficult to maintain; based on this embodiment mentioned The test data acquisition method, because the field value is automatically generated by the electronic device according to the preset field processing logic, the tester cannot perceive the maintenance difference of the data volume change.

3)基于EXCEL、CSV等的测试数据的获取方法,如果测试数据涉及到唯一值,自动化测试执行过程中可能会出现值被占用的情况;基于本实施方式提及的测试数据的获取方法,动态地从数据库获取第一测试数据,并且可以基于字段处理逻辑,对唯一值字段进行处理,不会出现被占用的情况。3) The acquisition method of test data based on EXCEL, CSV, etc., if the test data involves a unique value, the value may be occupied during the execution of the automated test; based on the acquisition method of the test data mentioned in this embodiment, dynamic The first test data can be obtained from the database in a timely manner, and the unique value field can be processed based on the field processing logic without being occupied.

4)基于EXCEL、CSV等的测试数据的获取方法,如果功能未变,但是测试数据失效,每次维护工作量都为M*(N+1);基于本实施方式提及的测试数据的获取方法,只需要在配置文件中更改第一测试数据的主键,工作量为M。4) The acquisition method of test data based on EXCEL, CSV, etc., if the function has not changed, but the test data is invalid, the maintenance workload is M*(N+1) each time; based on the acquisition of test data mentioned in this embodiment method, you only need to change the primary key of the first test data in the configuration file, and the workload is M.

5)基于EXCEL、CSV等的测试数据的获取方法,如果软件或系统功能需要新增字段,需要对每条测试数据维护,工作量为M;基于本实施方式提及的测试数据的获取方法,只需要在映射文件中添加字段映射,工作量为1。5) based on the acquisition method of test data such as EXCEL, CSV, if the software or system function needs to add new fields, each test data needs to be maintained, and the workload is M; based on the acquisition method of the test data mentioned in this embodiment, Just need to add field mapping in the mapping file, the workload is 1.

6)基于EXCEL、CSV等的测试数据的获取方法,自动化测试脚本执行后,测试数据失效,需要对测试数据进行还原,增加工作量,且若还原不当,可能会出现垃圾数据;基于本实施方式提及的测试数据的获取方法,不需要新增EXCEL或CSV来存储测试数据,测试数据是在每次测试过程中自动产生的,因此,在自动化测试脚本执行后,不需要对存储测试数据的EXCEL或CSV等进行还原,则不会出现垃圾数据。6) The acquisition method of test data based on EXCEL, CSV, etc. After the execution of the automated test script, the test data becomes invalid, and the test data needs to be restored, which increases the workload, and if the restoration is not done properly, garbage data may appear; based on this embodiment The method of obtaining the test data mentioned does not need to add EXCEL or CSV to store the test data. The test data is automatically generated during each test. Therefore, after the execution of the automated test script, there is no need to store the test data. EXCEL or CSV, etc. to restore, there will be no junk data.

需要说明的是,以上仅为举例说明,并不对本发明的技术方案构成限定。It should be noted that the above is only for illustration and does not limit the technical solution of the present invention.

与现有技术相比,本实施方式中提供的测试数据的获取方法,能够在自动化测试失败时,及时提醒测试人员进行人工测试,提高了测试效率。在自动化测试成功或人工测试成功后,自动保存测试过程中产生的测试数据,丰富了数据库中的第一测试数据的类别,为自动生成第二测试数据提供了更多的素材。Compared with the prior art, the test data acquisition method provided in this embodiment can remind the tester to perform manual test in time when the automated test fails, which improves the test efficiency. After the automatic test or manual test is successful, the test data generated during the test process is automatically saved, which enriches the categories of the first test data in the database and provides more materials for automatically generating the second test data.

上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。The step division of the above various methods is only for the sake of clarity of description. During implementation, it can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. ; Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but not changing the core design of the algorithm and process are all within the scope of protection of this patent.

本发明的第三实施方式涉及一种测试数据的获取装置,测试数据的获取装置的数据库中存储有测试用例被执行后产生的第一测试数据,如图4所示,包括:第一获取模块401、第二获取模块402和生成模块403。第一获取模块401用于获取第一测试数据的标识信息;第二获取模块402用于根据第一测试数据的标识信息,从数据库中获取第一测试数据;生成模块403用于根据第一测试数据,以及第一测试数据的字段和预生成的第二测试数据的字段的第一对应关系,生成第二测试数据。The third embodiment of the present invention relates to a test data acquisition device, the first test data generated after the test case is executed is stored in the database of the test data acquisition device, as shown in Figure 4, including: a first acquisition module 401 , a second acquiring module 402 and a generating module 403 . The first acquisition module 401 is used to acquire the identification information of the first test data; the second acquisition module 402 is used to acquire the first test data from the database according to the identification information of the first test data; the generation module 403 is used to obtain the first test data according to the first test data. data, and the first corresponding relationship between the fields of the first test data and the fields of the pre-generated second test data to generate the second test data.

在一个例子中,根据第一测试数据,以及第一测试数据的字段和预生成的第二测试数据的字段的第一对应关系,生成第二测试数据,具体包括:根据预设的字段处理逻辑,对第一测试数据中的字段进行处理;根据处理后的第一测试数据,生成第二测试数据,根据第一对应关系,确定与第二测试数据的字段对应的处理后的第一测试数据中的字段;根据对应的处理后的第一测试数据中的字段,确定第二测试数据。该实现中,对第一测试数据进行处理,可以实现唯一值字段的数值自动生成等功能,以满足第二测试数据的要求,进一步减少了测试人员的工作量。除此之外,能够自动对处理后的第一测试数据中的数据进行筛选,去除无用数据,提高了第二测试数据的有效性。In one example, generating the second test data according to the first test data and the first corresponding relationship between the fields of the first test data and the fields of the pre-generated second test data, specifically includes: processing logic according to preset fields , process the fields in the first test data; generate second test data according to the processed first test data, and determine the processed first test data corresponding to the fields of the second test data according to the first correspondence Fields in the field; determine the second test data according to the corresponding fields in the processed first test data. In this implementation, the processing of the first test data can realize functions such as automatic generation of the value of the unique value field, so as to meet the requirements of the second test data and further reduce the workload of testers. In addition, the data in the processed first test data can be automatically screened to remove useless data and improve the effectiveness of the second test data.

在一个例子中,在根据第一测试数据,以及第一测试数据的字段和预生成的第二测试数据的字段的第一对应关系,生成第二测试数据之前,测试数据的获取方法还包括:根据测试用例的标识信息,获取测试用例对应的第一对应关系。In an example, before generating the second test data according to the first test data and the first corresponding relationship between the fields of the first test data and the pre-generated fields of the second test data, the method for obtaining the test data further includes: According to the identification information of the test case, the first corresponding relationship corresponding to the test case is acquired.

在一个例子中,根据第一测试数据的标识信息,从数据库中获取第一测试数据,具体包括:获取预设的查询语句模板;根据查询语句模板,以及第一测试数据的标识信息,生成查询语句;通过执行查询语句,得到第一测试数据。该实现中,自动识别第一测试数据,提高了电子设备的自动化程度,减少了测试人员维护测试数据的人力消耗。In one example, obtaining the first test data from the database according to the identification information of the first test data specifically includes: obtaining a preset query statement template; generating a query according to the query statement template and the identification information of the first test data A statement; the first test data is obtained by executing the query statement. In this implementation, the first test data is automatically identified, the degree of automation of the electronic equipment is improved, and the labor consumption of test personnel for maintaining test data is reduced.

在一个例子中,获取第一测试数据的标识信息,具体包括:确定测试用例的标识信息;根据测试用例的标识信息和预设的第二对应关系,确定第一测试数据的标识信息;第二对应关系为测试用例的标识信息和第一测试数据的标识信息的对应关系。In one example, obtaining the identification information of the first test data specifically includes: determining the identification information of the test case; determining the identification information of the first test data according to the identification information of the test case and the preset second corresponding relationship; The corresponding relationship is the corresponding relationship between the identification information of the test case and the identification information of the first test data.

在一个例子中,在根据第一测试数据,生成第二测试数据之后,测试数据的获取方法还包括:将第二测试数据输入测试用例;在执行测试用例的过程中,若接收到错误提示,提示测试人员进行人工测试。In one example, after generating the second test data according to the first test data, the method for obtaining the test data further includes: inputting the second test data into the test case; during the execution of the test case, if an error prompt is received, Prompt the tester for manual testing.

在一个例子中,在提示测试人员进行人工测试之后,测试数据的获取方法还包括:在确定人工测试成功后,将人工测试过程中产生的第三测试数据保存至数据库中。In an example, after the tester is prompted to perform the manual test, the method for obtaining the test data further includes: after determining that the manual test is successful, saving the third test data generated during the manual test into the database.

在一个例子中,在执行测试用例之后,测试数据的获取方法还包括:若确定测试用例执行成功,将本次执行测试用例产生的第四测试数据保存至数据库中。In one example, after the test case is executed, the method for obtaining test data further includes: if it is determined that the test case is executed successfully, saving the fourth test data generated by executing the test case this time into the database.

不难发现,本实施方式为与第一实施方式相对应的系统实施例,本实施方式可与第一实施方式互相配合实施。第一实施方式中提到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第一实施方式中。It is not difficult to find that this embodiment is a system embodiment corresponding to the first embodiment, and this embodiment can be implemented in cooperation with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and will not be repeated here in order to reduce repetition. Correspondingly, the relevant technical details mentioned in this implementation manner can also be applied in the first implementation manner.

值得一提的是,本实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本发明的创新部分,本实施方式中并没有将与解决本发明所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。It is worth mentioning that all the modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, or a part of a physical unit, or multiple physical units. Combination of units. In addition, in order to highlight the innovative part of the present invention, units that are not closely related to solving the technical problems proposed by the present invention are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.

本发明的第四实施方式涉及一种电子设备,如图5所示,包括:至少一个处理器501;以及,与至少一个处理器501通信连接的存储器502;其中,存储器502存储有可被至少一个处理器501执行的指令,指令被至少一个处理器501执行,以使至少一个处理器501能够执行上述实施方式提及的测试数据的获取方法。The fourth embodiment of the present invention relates to an electronic device, as shown in FIG. 5 , including: at least one processor 501; and a memory 502 communicatively connected to at least one processor 501; Instructions executed by one processor 501, the instructions are executed by at least one processor 501, so that at least one processor 501 can execute the method for obtaining test data mentioned in the above embodiments.

该电子设备包括:一个或多个处理器501以及存储器502,图5中以一个处理器501为例。处理器501、存储器502可以通过总线或者其他方式连接,图5中以通过总线连接为例。存储器502作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施方式中第一对应关系就存储于存储器502中。处理器501通过运行存储在存储器502中的非易失性软件程序、指令以及模块,从而执行设备的各种功能应用以及数据处理,即实现上述测试数据的获取方法。The electronic device includes: one or more processors 501 and a memory 502, one processor 501 is taken as an example in FIG. 5 . The processor 501 and the memory 502 may be connected through a bus or in other ways, and connection through a bus is taken as an example in FIG. 5 . The memory 502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. For example, in the embodiment of the present application, the first correspondence is stored in the memory 502 in. The processor 501 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 502, that is, realizes the above method for obtaining test data.

存储器502可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储选项列表等。此外,存储器502可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施方式中,存储器502可选包括相对于处理器501远程设置的存储器,这些远程存储器可以通过网络连接至外接设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application program required by at least one function; the data storage area may store an option list and the like. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. In some implementations, the memory 502 may optionally include a memory that is set remotely relative to the processor 501, and these remote memories may be connected to an external device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

一个或者多个模块存储在存储器502中,当被一个或者多个处理器501执行时,执行上述任意方法实施方式中的测试数据的获取方法。One or more modules are stored in the memory 502, and when executed by one or more processors 501, execute the method for acquiring test data in any of the above method implementations.

上述产品可执行本申请实施方式所提供的方法,具备执行方法相应的功能模块和有益效果,未在本实施方式中详尽描述的技术细节,可参见本申请实施方式所提供的方法。The above-mentioned products can execute the methods provided in the embodiments of this application, and have the corresponding functional modules and beneficial effects for executing the methods. For technical details not described in detail in this embodiment, please refer to the methods provided in the embodiments of this application.

本发明的第五实施方式涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。A fifth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The above method embodiments are implemented when the computer program is executed by the processor.

即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method of the above-mentioned embodiments can be completed by instructing related hardware through a program, the program is stored in a storage medium, and includes several instructions to make a device ( It may be a single-chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and other media that can store program codes.

本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。Those of ordinary skill in the art can understand that the above-mentioned embodiments are specific examples for realizing the present invention, and in practical applications, various changes can be made to it in form and details without departing from the spirit and spirit of the present invention. scope.

Claims (10)

1. a kind of acquisition methods of test data, which is characterized in that be applied to electronic equipment, in the database of the electronic equipment It is stored with the first test data generated after test case is performed, comprising:
Obtain the identification information of first test data;
According to the identification information of first test data, first test data is obtained from database;
According to the word of the second test data of the field and pre-generatmg of first test data and first test data First corresponding relationship of section generates second test data.
2. the acquisition methods of test data according to claim 1, which is characterized in that described according to the first test number According to and first test data field and pre-generatmg the second test data field the first corresponding relationship, generate Second test data, specifically includes:
Logic is handled according to preset field, the field in first test data is handled;
According to treated the first test data, second test data is generated;
According to first corresponding relationship, treated first survey corresponding with the field of second test data is determined Try the field in data;
According to the field in corresponding treated first test data, second test data is determined.
3. the acquisition methods of test data according to claim 2, which is characterized in that described according to first test First corresponding relationship of the field of the second test data of the field and pre-generatmg of data and first test data, it is raw Before the second test data, the acquisition methods of the test data further include:
According to the identification information of the test case, corresponding first corresponding relationship of the test case is obtained.
4. the acquisition methods of test data according to any one of claim 1 to 3, which is characterized in that described according to institute The identification information for stating the first test data obtains first test data from database, specifically includes:
Obtain preset query statement template;
According to the identification information of the query statement template and first test data, query statement is generated;
By executing the query statement, first test data is obtained.
5. the acquisition methods of test data according to any one of claim 1 to 3, which is characterized in that the acquisition institute The identification information for stating the first test data, specifically includes:
Determine the identification information of the test case;
According to the identification information of the test case and preset second corresponding relationship, the mark of first test data is determined Information;Second corresponding relationship is the corresponding relationship of the identification information of test case and the identification information of the first test data.
6. the acquisition methods of test data according to any one of claim 1 to 3, which is characterized in that in the basis First test data, after generating the second test data, the acquisition methods of the test data further include:
Second test data is inputted into the test case;
During executing the test case, if receiving miscue, tester is prompted to carry out manual testing.
7. the acquisition methods of test data according to claim 6, which is characterized in that carried out in the prompt tester After manual testing, the acquisition methods of the test data further include:
After determining manual testing's success, the third test data generated during manual testing is saved to the database In.
8. the acquisition methods of test data according to claim 6, which is characterized in that execute the test case described Later, the acquisition methods of the test data further include:
If it is determined that the test case runs succeeded, by this execute the 4th test data that the test case generates save to In the database.
9. a kind of electronic equipment characterized by comprising at least one processor;And
The memory being connect at least one described processor communication;Wherein, be stored with can be by described at least one for the memory The instruction that a processor executes, described instruction is executed by least one described processor, so that at least one described processor energy Enough acquisition methods executed such as test data described in any item of the claim 1 to 8.
10. a kind of computer readable storage medium, is stored with computer program, which is characterized in that the computer program is located Reason device realizes the acquisition methods of test data described in any item of the claim 1 to 8 when executing.
CN201910566206.3A 2019-06-27 2019-06-27 A kind of acquisition methods of test data, electronic equipment and storage medium Pending CN110471833A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910566206.3A CN110471833A (en) 2019-06-27 2019-06-27 A kind of acquisition methods of test data, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910566206.3A CN110471833A (en) 2019-06-27 2019-06-27 A kind of acquisition methods of test data, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110471833A true CN110471833A (en) 2019-11-19

Family

ID=68507071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910566206.3A Pending CN110471833A (en) 2019-06-27 2019-06-27 A kind of acquisition methods of test data, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110471833A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111078543A (en) * 2019-12-02 2020-04-28 贝壳技术有限公司 System dynamic testing method and testing device
CN111651363A (en) * 2020-06-29 2020-09-11 平安银行股份有限公司 Test data acquisition method, test data acquisition device, electronic device and medium
CN111679979A (en) * 2020-06-03 2020-09-18 中国银行股份有限公司 Destructive testing method and device
CN112328499A (en) * 2020-11-27 2021-02-05 杭州安恒信息技术股份有限公司 Test data generation method, device, equipment and medium
CN112882960A (en) * 2021-03-30 2021-06-01 中信银行股份有限公司 Data acquisition method and device
CN112988558A (en) * 2019-12-16 2021-06-18 迈普通信技术股份有限公司 Test execution method and device, electronic equipment and storage medium
CN113407454A (en) * 2021-06-29 2021-09-17 山东派盟网络科技有限公司 Method, device and equipment for comprehensive test
CN113641590A (en) * 2021-09-03 2021-11-12 中国银行股份有限公司 Method and device for generating test case of PLSQL program and electronic equipment
CN114647568A (en) * 2020-12-21 2022-06-21 中国移动通信有限公司研究院 Automatic testing method and device, electronic equipment and readable storage medium
CN115495338A (en) * 2021-06-18 2022-12-20 神讯电脑(昆山)有限公司 Method and device for testing picture uniformity, electronic equipment and storage medium

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH056291A (en) * 1991-06-28 1993-01-14 Hitachi Ltd How to create and manage test resources
JP2005285002A (en) * 2004-03-30 2005-10-13 Hitachi Software Eng Co Ltd Test data generation apparatus
CN101989201A (en) * 2009-08-07 2011-03-23 佛山市顺德区顺达电脑厂有限公司 Method for automatically generating test coverage rate of flying probe test program
WO2011116471A1 (en) * 2010-03-25 2011-09-29 Mga Aq Inc. Method and system for generating updated test data
CN103077110A (en) * 2011-10-25 2013-05-01 阿里巴巴集团控股有限公司 Test method and device
CN104133772A (en) * 2014-08-13 2014-11-05 广东电网公司信息中心 Automatic test data generation method
CN104346366A (en) * 2013-07-30 2015-02-11 国际商业机器公司 Test data expansion method and device
US20160062865A1 (en) * 2014-08-29 2016-03-03 Skyworks Solutions, Inc. Systems and methods for processing test results
CN106033390A (en) * 2015-03-12 2016-10-19 阿里巴巴集团控股有限公司 Mail style testing method and apparatus
CN106547689A (en) * 2016-10-20 2017-03-29 金航数码科技有限责任公司 A kind of automatic test cases development system and method based on web
CN106713011A (en) * 2016-11-22 2017-05-24 腾讯科技(深圳)有限公司 Method and system for obtaining test data
CN106815146A (en) * 2016-12-27 2017-06-09 甘肃万维信息技术有限责任公司 A kind of software automated testing system based on VBScript
US20170220458A1 (en) * 2016-01-28 2017-08-03 Accenture Global Solutions Limited Orchestrating and providing a regression test
US20170351746A1 (en) * 2016-06-06 2017-12-07 International Business Machines Corporation Test data management
CN107562627A (en) * 2017-09-04 2018-01-09 郑州云海信息技术有限公司 A kind of test result automatic creation system and method
US20180095866A1 (en) * 2016-09-30 2018-04-05 Wipro Limited Method and system for automatically generating test data for testing applications

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH056291A (en) * 1991-06-28 1993-01-14 Hitachi Ltd How to create and manage test resources
JP2005285002A (en) * 2004-03-30 2005-10-13 Hitachi Software Eng Co Ltd Test data generation apparatus
CN101989201A (en) * 2009-08-07 2011-03-23 佛山市顺德区顺达电脑厂有限公司 Method for automatically generating test coverage rate of flying probe test program
WO2011116471A1 (en) * 2010-03-25 2011-09-29 Mga Aq Inc. Method and system for generating updated test data
CN103077110A (en) * 2011-10-25 2013-05-01 阿里巴巴集团控股有限公司 Test method and device
CN104346366A (en) * 2013-07-30 2015-02-11 国际商业机器公司 Test data expansion method and device
CN104133772A (en) * 2014-08-13 2014-11-05 广东电网公司信息中心 Automatic test data generation method
US20160062865A1 (en) * 2014-08-29 2016-03-03 Skyworks Solutions, Inc. Systems and methods for processing test results
CN106033390A (en) * 2015-03-12 2016-10-19 阿里巴巴集团控股有限公司 Mail style testing method and apparatus
US20170220458A1 (en) * 2016-01-28 2017-08-03 Accenture Global Solutions Limited Orchestrating and providing a regression test
US20170351746A1 (en) * 2016-06-06 2017-12-07 International Business Machines Corporation Test data management
US20180095866A1 (en) * 2016-09-30 2018-04-05 Wipro Limited Method and system for automatically generating test data for testing applications
CN106547689A (en) * 2016-10-20 2017-03-29 金航数码科技有限责任公司 A kind of automatic test cases development system and method based on web
CN106713011A (en) * 2016-11-22 2017-05-24 腾讯科技(深圳)有限公司 Method and system for obtaining test data
CN106815146A (en) * 2016-12-27 2017-06-09 甘肃万维信息技术有限责任公司 A kind of software automated testing system based on VBScript
CN107562627A (en) * 2017-09-04 2018-01-09 郑州云海信息技术有限公司 A kind of test result automatic creation system and method

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111078543A (en) * 2019-12-02 2020-04-28 贝壳技术有限公司 System dynamic testing method and testing device
CN112988558A (en) * 2019-12-16 2021-06-18 迈普通信技术股份有限公司 Test execution method and device, electronic equipment and storage medium
CN112988558B (en) * 2019-12-16 2024-09-17 迈普通信技术股份有限公司 Test execution method, device, electronic equipment and storage medium
CN111679979A (en) * 2020-06-03 2020-09-18 中国银行股份有限公司 Destructive testing method and device
CN111679979B (en) * 2020-06-03 2023-09-19 中国银行股份有限公司 Destructive testing method and device
CN111651363A (en) * 2020-06-29 2020-09-11 平安银行股份有限公司 Test data acquisition method, test data acquisition device, electronic device and medium
CN112328499A (en) * 2020-11-27 2021-02-05 杭州安恒信息技术股份有限公司 Test data generation method, device, equipment and medium
CN114647568A (en) * 2020-12-21 2022-06-21 中国移动通信有限公司研究院 Automatic testing method and device, electronic equipment and readable storage medium
CN112882960A (en) * 2021-03-30 2021-06-01 中信银行股份有限公司 Data acquisition method and device
CN115495338A (en) * 2021-06-18 2022-12-20 神讯电脑(昆山)有限公司 Method and device for testing picture uniformity, electronic equipment and storage medium
CN113407454A (en) * 2021-06-29 2021-09-17 山东派盟网络科技有限公司 Method, device and equipment for comprehensive test
CN113407454B (en) * 2021-06-29 2022-08-05 山东派盟网络科技有限公司 A comprehensive testing method, apparatus and apparatus
CN113641590A (en) * 2021-09-03 2021-11-12 中国银行股份有限公司 Method and device for generating test case of PLSQL program and electronic equipment

Similar Documents

Publication Publication Date Title
CN110471833A (en) A kind of acquisition methods of test data, electronic equipment and storage medium
CN110597730B (en) Automatic test case generation method and system based on scene method
CN108446223B (en) An automated testing method for business scenarios based on dynamic compilation
US11720334B2 (en) Inductive equivalence in machine-based instruction editing
US20170192882A1 (en) Method and system for automatically generating a plurality of test cases for an it enabled application
CN112487083B (en) Data verification method and device
US10782941B1 (en) Refinement of repair patterns for static analysis violations in software programs
CN109634846B (en) ETL software testing method and device
US20210103514A1 (en) Reusable test cases for identifiable patterns
JP2018505506A (en) Machine-based instruction editing
WO2021196674A1 (en) System code testing method and apparatus, and computer device and storage medium
JP2020102209A (en) Software program defect location identification
CN112015648A (en) Test method, device, computer equipment and medium based on automation script
CN109697161A (en) A kind of test method of storing process, storage medium and database server
CN112948473A (en) Data processing method, device and system of data warehouse and storage medium
CN105279092A (en) Software testing method and apparatus
US10176087B1 (en) Autogenic test framework
CN114691519B (en) Interface automated testing method, device, equipment and storage medium
CN110096292B (en) Method and system for refreshing BIOS firmware of server in self-adaptive manner
US11347533B2 (en) Enhanced virtual machine image management system
CN105824758B (en) A kind of heap area object comparative approach based on execution index and access path
CN114138646B (en) CAD resource verification method and device, storage medium and processor
CN114490415B (en) Business testing method, computer device, storage medium and computer program product
CN107092671B (en) Method and equipment for managing meta information
CN114064489B (en) Automated testing method, device, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20191119

RJ01 Rejection of invention patent application after publication