A data processing method, apparatus, electronic device, computer storage medium

In interface automation testing, use case data is read and system data to be tested is queried according to preset query methods, and the use case data is determined and modified, the problem of low testing efficiency in the existing technology is solved, and more efficient test case execution is achieved.

CN114911709BActive Publication Date: 2025-06-27HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210644874.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-09
Publication Date
2025-06-27
Estimated Expiration
2042-06-09

AI Technical Summary

Technical Problem

In the prior art, the execution efficiency of interface automation test cases is low, especially when system parameters change, it is necessary to manually check and modify the use case data, resulting in a decrease in testing efficiency.

Method used

When executing test cases through the interface, read the use case data and query the query data in the system to be tested according to the preset query method to determine whether there will be an exception in the use case data. If an exception is the use case data is modified based on the preset query method to ensure the normal execution of the test case.

Benefits of technology

By pre-checking and data comparison of the test system before the test case is executed, the efficiency of test execution is improved and the need for manual troubleshooting and modification is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911709B_ABST
    Figure CN114911709B_ABST
Patent Text Reader

Abstract

The present invention provides a data processing method, apparatus, electronic device, and computer storage medium. The method includes: when executing a test case through an interface, reading the case data in the test case; querying, according to a preset query method, the query data corresponding to the preset query method in the system to be tested, where the system to be tested is a system connected to the interface; determining whether an exception will occur for the case data based on the query data; and if it is determined that no exception will occur for the case data, executing the test case. In the embodiments of the present invention, when a test case is executed, the system to be tested is checked in advance, and the query data corresponding to the preset query method in the system to be tested is queried according to the preset query method; and the query data is compared with the case data in the test case to determine whether the data in the system has changed, thereby improving the test execution efficiency through the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular, to a data processing method, apparatus, electronic device, and computer storage medium. Background Art

[0002] Currently, in the industry, interface automation testing mainly writes automation test cases based on test frameworks such as unittest and pytest, and executes the test cases to generate test reports.

[0003] To solve the problems that occur when a large number of interfaces execute test cases, common processing methods for request parameters in test cases are separated into excel, databases, etc. for storage in a data-driven manner, so as to integrate the data for integrated execution; when system parameters change and it is impossible to create a scenario for specifically automated data, directly executing the integrated case data is likely to cause warning problems and requires manual troubleshooting and modification, thereby reducing the test efficiency. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a data processing method, apparatus, electronic device, and computer storage medium to solve the problem of low test efficiency in the prior art.

[0005] To achieve the above object, embodiments of the present invention provide the following technical solutions:

[0006] A first aspect of an embodiment of the present invention shows a data processing method, the method including:

[0007] When executing a test case through an interface, read the case data in the test case;

[0008] Query the query data corresponding to the preset query method in the system to be tested according to the preset query method, where the system to be tested is a system connected to the interface;

[0009] Based on the query data, determine whether the case data will be abnormal;

[0010] If it is determined that the case data will not be abnormal, execute the test case.

[0011] Optionally, it further includes:

[0012] If it is determined that the case data will be abnormal, modify the case data based on the preset query method, and return to execute the step of querying the query data corresponding to the preset query method in the system connected to the interface according to the preset query method.

[0013] Optionally, the modifying the case data based on the preset query method includes:

[0014] If the number of the preset query methods is 1, obtain a modification method corresponding to the preset query method;

[0015] Modify the use case data based on the modification method and the query data;

[0016] If the number of the preset query methods is more than 1, obtain modification methods corresponding to each of the preset query methods to get a plurality of modification methods;

[0017] Modify the use case data based on the plurality of modification methods and the query data.

[0018] Optionally, the querying the query data corresponding to the preset query method in the system to be tested according to the preset query method includes:

[0019] When executing a test case through an interface, detect the test data in the system to be tested in real time;

[0020] If the number of the preset query methods is 1, query the query data corresponding to the preset query method in the test data according to the preset query method.

[0021] Optionally, the querying the query data corresponding to the preset query method in the system to be tested according to the preset query method includes:

[0022] When executing a test case through an interface, detect the test data in the system to be tested in real time;

[0023] If the number of the preset query methods is more than 1, for each preset query method, query the query data corresponding to the preset query method in the test data according to the preset query method.

[0024] Optionally, determining whether the use case data will have an exception based on the query data includes:

[0025] Judge whether the query data is consistent with the use case data;

[0026] If they are consistent, determine that the use case data will not have an exception;

[0027] If they are inconsistent, determine that the use case data will have an exception.

[0028] A second aspect of an embodiment of the present invention shows a data processing device, and the device includes:

[0029] An obtaining unit, configured to read use case data in a test case when executing the test case through an interface;

[0030] A query unit, configured to query query data corresponding to the preset query method in the system to be tested according to the preset query method, where the system to be tested is a system connected to the interface;

[0031] A determination unit, configured to determine whether an exception will occur in the use case data based on the query data;

[0032] An execution unit, configured to execute the test case if it is determined that no exception will occur in the use case data.

[0033] Optionally, it further includes:

[0034] A modification unit, configured to modify the use case data based on the preset query method if it is determined that an exception will occur in the use case data.

[0035] A third aspect of the embodiments of the present invention shows an electronic device, which is used to run a program. Wherein, when the program runs, it executes the data processing method shown in the first aspect of the embodiments of the present invention.

[0036] A fourth aspect of the embodiments of the present invention shows a computer storage medium, which includes a stored program. Wherein, when the program runs, it controls the device where the storage medium is located to execute the data processing method shown in the first aspect of the embodiments of the present invention.

[0037] Based on the data processing method, device, electronic device, and computer storage medium provided in the above embodiments of the present invention, the method includes: when executing a test case through an interface, reading the use case data in the test case; querying query data corresponding to the preset query method in the system to be tested according to the preset query method, where the system to be tested is a system connected to the interface; determining whether an exception will occur in the use case data based on the query data; if it is determined that no exception will occur in the use case data, executing the test case. In the embodiments of the present invention, when a test case is executed, the system to be tested is checked in advance, and query data corresponding to the preset query method in the system to be tested is queried according to the preset query method; and the query data is compared with the use case data in the test case to determine whether the data in the system has changed, thereby improving the test execution efficiency through the above method. Description of the Drawings

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0039] Figure 1Schematic flowchart of a data processing method shown in an embodiment of the present invention;

[0040] Figure 2 Schematic architecture diagram of data processing shown in an embodiment of the present invention;

[0041] Figure 3 Schematic structural diagram of a data processing device shown in an embodiment of the present invention;

[0042] Figure 4 Schematic structural diagram of another data processing device shown in an embodiment of the present invention. Detailed implementation manners

[0043] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0044] Terms such as "first", "second", "third", "fourth", etc. (if any) in the specification, claims and above-mentioned drawings of the present application are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0045] It should be noted that the descriptions involving "first", "second", etc. in the present invention are only for descriptive purposes, and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between various embodiments can be combined with each other, but it must be based on the fact that those of ordinary skill in the art can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the protection scope required by the present invention.

[0046] In this application, the terms "comprising", "including" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

[0047] In an embodiment of the present invention, when executing a test case through an interface, use case data in the test case is read; query data corresponding to the preset query method in the system under test is queried according to the preset query method, where the system under test is a system connected to the interface; based on the query data, it is determined whether the use case data will be abnormal; if it is determined that the use case data will not be abnormal, the test case is executed; if it is determined that the use case data will be abnormal, the use case data is modified based on the preset query method. This solution improves the test execution efficiency by pre-checking the system under test when the test case is executed, querying the query data corresponding to the preset query method in the system under test according to the preset query method; and comparing the query data with the use case data in the test case to determine whether the data in the system has changed. If there is no change, the test case continues to be executed. If there is a change, the use case data is modified.

[0048] See Figure 1 , which is a schematic flowchart of a data processing method shown in an embodiment of the present invention. The method includes:

[0049] Step S101: When executing a test case through an interface, read the use case data in the test case.

[0050] It should be noted that the use case data includes at least data in excel, database, and json.

[0051] In the specific process of implementing step S101, at the start of the test, the config configuration is read, the test case set is searched for and run; when executing the test case, a pre-script front.py is added to the interface automation framework based on the test framework pytest. When executing the test case through the interface, the data in excel, database, and json in the test case is read.

[0052] Step S102: Query the query data corresponding to the preset query method in the system under test according to the preset query method.

[0053] In step S102, the system under test is a system connected to the interface.

[0054] It should be noted that the preset query method is set in advance according to experiments or experience, and can be carried out through interfaces, querying databases, etc. For example: the preset query method for querying the required system accounts and information data; the number of preset query methods can be one or more.

[0055] In one embodiment, if the number of the preset query methods is one, the specific implementation step S102 of querying the query data corresponding to the preset query method in the system to be tested according to the preset query method includes:

[0056] Step S11: When executing the test case through the interface, detect the test data in the system to be tested in real time.

[0057] In the process of specifically implementing step S11, it is necessary to detect the system to be tested connected to the interface in real time and record the corresponding system data, that is, the test data.

[0058] Step S12: Query the query data corresponding to the preset query method in the test data according to the preset query method.

[0059] In the process of specifically implementing step S12, the use case data query function query_casedata() determines whether there is modified or changed data in the test data according to the preset query method. If so, obtain the changed data corresponding to the preset query method in the test data, that is, the query data.

[0060] For example: According to the preset query method for querying the required system accounts and information data, query the test data, determine that there is a variable id under this account and there is a scenario of being frequently modified, and obtain the data corresponding to the scenario where there is a variable id under this account and there is a scenario of being frequently modified from the test data.

[0061] In one embodiment, if the number of the preset query methods is multiple, the specific implementation step S102 of querying the query data corresponding to the preset query method in the system to be tested according to the preset query method includes:

[0062] Step S21: When executing the test case through the interface, detect the test data in the system to be tested in real time.

[0063] It should be noted that the specific implementation process of step S21 is the same as that of the above step S11, and reference can be made to each other.

[0064] Step S22: For each preset query method, query the query data corresponding to the preset query method in the test data according to the preset query method.

[0065] In the process of specifically implementing step S12, if the number of the preset query methods is N, where N is a positive integer greater than or equal to 2, the use case data query function query_casedata() determines whether there is modified or changed data in the test data according to the first preset query method. If there is, the changed data corresponding to the preset query method in the test data is obtained, that is, the query data. Then, by analogy, until the query data corresponding to the Nth preset query method is determined; that is, the query data corresponding to each preset query method is determined in turn.

[0066] Step S103: Determine whether the use case data will have an exception based on the query data. If it is determined that the use case data will not have an exception, execute step S105. If it is determined that the use case data will have an exception, execute step S104.

[0067] In the process of specifically implementing step S103, it is determined whether the query data is consistent with the use case data through the method contrast(); if they are consistent, it is determined that the use case data will not have an exception, and step S105 is executed; if they are inconsistent, it is determined that the use case data will have an exception, and step S104 is executed.

[0068] Step S104: Modify the use case data based on the preset query method, and return to execute step S102.

[0069] It should be noted that a corresponding relationship between the preset query method and the modification method is established in advance.

[0070] Specifically, when setting the preset query method, the use case data modification function modify_casedata() is used to define the corresponding modification method at the same time, and a mapping relationship between the preset query method and the modification method is established.

[0071] For example: the preset query method is a method for querying the required system account and information data, and its corresponding modification method is a method for modifying the required system account and information data; and a mapping relationship between the preset query method and the modification method is established.

[0072] In an implementation manner, if the number of the preset query methods is 1, the process of specifically implementing step 105 to modify the use case data based on the preset query method includes:

[0073] Step S31: Obtain the modification method corresponding to the preset query method.

[0074] In the process of specifically implementing step S31, all the modification methods are traversed to find the modification method corresponding to the preset query method and obtain it.

[0075] Step S32: Modify the use case data based on the modification method and the query data.

[0076] In the process of specifically implementing step S32, determine the use case data that needs to be modified in the use case data based on the modification method; modify the use case data that needs to be modified with the query data, and return to execute step S102.

[0077] In an embodiment, if the number of the preset query methods is multiple, the process of specifically implementing step 105 to modify the use case data based on the preset query method includes:

[0078] Step S41: Obtain the modification methods corresponding to each of the preset query methods to obtain multiple modification methods.

[0079] In the process of specifically implementing step S41, traverse all the modification methods, search for the modification methods corresponding to each of the preset query methods, and obtain them.

[0080] Step S42: Modify the use case data based on the multiple modification methods and the corresponding query data.

[0081] In the process of specifically implementing step S42, if the number of the preset query methods is N, N is a positive integer greater than or equal to 2, first determine the preset query method corresponding to each modification method, and then determine the corresponding query data based on the preset query method; for each modification method and its corresponding query data, determine the use case data that needs to be modified in the use case data based on the modification method; modify the use case data that needs to be modified with its corresponding query data; after all the modification methods are executed, return to execute step S102.

[0082] Step S105: Execute the test case.

[0083] In the process of specifically implementing step S105, the test case that needs to be executed by the test request continues to run.

[0084] Optionally, after the test case runs, perform operations such as result assertion, production report, sending report, and error warning to implement the test of the interface.

[0085] Correspondingly, based on the processes of steps S101 to S105 shown in the embodiments of the present invention above, the corresponding architecture schematic diagram is also shown, as Figure 2 shown.

[0086] In an embodiment of the present invention, when executing a test case through an interface, use case data in the test case is read; query data corresponding to the preset query method in the system to be tested is queried according to the preset query method, where the system to be tested is a system connected to the interface; based on the query data, it is determined whether the use case data will have an exception; if it is determined that the use case data will not have an exception, the test case is executed; if it is determined that the use case data will have an exception, the use case data is modified based on the preset query method. This solution checks the system to be tested in advance when executing the test case, queries the query data corresponding to the preset query method in the system to be tested according to the preset query method; and compares the query data with the use case data in the test case to determine whether the data in the system has changed. If there is no change, the test case is continued to be executed, and if there is a change, the use case data is modified. In the above manner, the test execution efficiency is improved.

[0087] Based on the data processing method shown in the above embodiment of the present invention, an embodiment of the present invention also correspondingly discloses a data processing device, as Figure 3 shown, which is a schematic structural diagram of a data processing device shown in an embodiment of the present invention. The device includes:

[0088] An acquisition unit 301, configured to read use case data in a test case when executing the test case through an interface;

[0089] A query unit 302, configured to query query data corresponding to the preset query method in the system to be tested according to the preset query method, where the system to be tested is a system connected to the interface;

[0090] A determination unit 303, configured to determine whether the use case data will have an exception based on the query data;

[0091] An execution unit 304, configured to execute the test case if it is determined that the use case data will not have an exception.

[0092] It should be noted that the specific principles and execution processes of each unit in the data processing device disclosed in the above embodiments of the present application are the same as those of the data processing method shown in the above embodiments of the present application. For the corresponding parts, reference can be made to the data processing method disclosed in the above embodiments of the present application, and details will not be repeated here.

[0093] In an embodiment of the present invention, when executing a test case through an interface, use case data in the test case is read; query data corresponding to the preset query method in the system to be tested is queried according to the preset query method, where the system to be tested is a system connected to the interface; based on the query data, it is determined whether the use case data will have an exception; if it is determined that the use case data will not have an exception, the test case is executed; if it is determined that the use case data will have an exception, the use case data is modified based on the preset query method. This solution checks the system to be tested in advance when executing the test case, queries the query data corresponding to the preset query method in the system to be tested according to the preset query method; and compares the query data with the use case data in the test case to determine whether the data in the system has changed. If there is no change, the test case is continued to be executed, and if there is a change, the use case data is modified. The test execution efficiency is improved in the above manner.

[0094] Optionally, based on the data processing device shown in the above embodiment of the present invention, in combination with Figure 3 , see Figure 4 , the device is further provided with a modification unit 305.

[0095] The modification unit 305 is used to modify the use case data based on the preset query method if it is determined that the use case data will have an exception.

[0096] In an embodiment of the present invention, when executing a test case through an interface, use case data in the test case is read; query data corresponding to the preset query method in the system to be tested is queried according to the preset query method, where the system to be tested is a system connected to the interface; based on the query data, it is determined whether the use case data will have an exception; if it is determined that the use case data will not have an exception, the test case is executed; if it is determined that the use case data will have an exception, the use case data is modified based on the preset query method. This solution checks the system to be tested in advance when executing the test case, queries the query data corresponding to the preset query method in the system to be tested according to the preset query method; and compares the query data with the use case data in the test case to determine whether the data in the system has changed. If there is no change, the test case is continued to be executed, and if there is a change, the use case data is modified. The test execution efficiency is improved in the above manner.

[0097] Optionally, based on the data processing device shown in the above embodiment of the present invention, the modification unit 305 is specifically used for: if the number of the preset query methods is 1, obtain a modification method corresponding to the preset query method;

[0098] Modify the use case data based on the modification method and the query data;

[0099] If the number of the preset query methods is multiple, obtain modification methods corresponding to each of the preset query methods to obtain multiple modification methods;

[0100] Modify the case data based on the multiple modification methods and the query data.

[0101] Optionally, based on the data processing device shown in the embodiment of the present invention above, the query unit 302 is specifically configured to:

[0102] When executing a test case through an interface, detect the test data in the system to be tested in real time;

[0103] If the number of the preset query methods is 1, query the query data corresponding to the preset query method in the test data according to the preset query method.

[0104] Optionally, based on the data processing device shown in the embodiment of the present invention above, the query unit 302 is specifically configured to:

[0105] When executing a test case through an interface, detect the test data in the system to be tested in real time;

[0106] If the number of the preset query methods is multiple, for each preset query method, query the query data corresponding to the preset query method in the test data according to the preset query method.

[0107] Optionally, based on the data processing device shown in the embodiment of the present invention above, the determination unit 303 is specifically configured to:

[0108] Determine whether the query data is consistent with the case data;

[0109] If they are consistent, determine that the case data will not have an exception;

[0110] If they are inconsistent, determine that the case data will have an exception.

[0111] Based on the data processing device disclosed in the embodiment of the present disclosure above, each of the above modules can be implemented by a hardware device composed of a processor and a memory. Specifically, each of the above modules is stored in the memory as a program unit, and the processor executes the above program unit stored in the memory to implement interest calculation processing.

[0112] Among them, the processor includes a kernel, and the kernel retrieves the corresponding program unit from the memory. One or more kernels can be set, and data processing is achieved by adjusting the kernel parameters.

[0113] The embodiment of the present disclosure provides a computer storage medium, and the storage medium includes a stored text processing program, wherein when the program is executed by a processor, it implements Figure 1The data processing method described above.

[0114] Embodiments of the present disclosure provide a processor for running a program. When the program runs, it executes Figure 1 The data processing method described above.

[0115] Embodiments of the present disclosure provide an electronic device, which can be a server, a PC, a PAD, a mobile phone, etc.

[0116] The electronic device includes at least one processor, at least one memory connected to the processor, and a bus.

[0117] The processor and the memory communicate with each other through the bus. The processor is configured to execute a program stored in the memory.

[0118] The memory is configured to store a program, which is at least used for: when executing a test case through an interface, reading the case data in the test case; querying the query data corresponding to the preset query method in the system under test according to the preset query method, where the system under test is a system connected to the interface; determining whether the case data will have an abnormality based on the query data; if it is determined that the case data will not have an abnormality, executing the test case.

[0119] The present application also provides a computer program product, which, when executed on an electronic device, is adapted to execute a program initialized with the following method steps:

[0120] When executing a test case through an interface, reading the case data in the test case; querying the query data corresponding to the preset query method in the system under test according to the preset query method, where the system under test is a system connected to the interface; determining whether the case data will have an abnormality based on the query data; if it is determined that the case data will not have an abnormality, executing the test case.

[0121] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0122] In a typical configuration, a device includes one or more processors (CPUs), memory, and a bus. The device may also include an input / output interface, a network interface, etc.

[0123] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip. The memory is an example of computer-readable media.

[0124] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transitory media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0125] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for a system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the description of the method embodiment. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.

[0126] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0127] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data processing method, characterized in that The method includes: When executing a test case through an interface, reading the case data in the test case; Querying the query data corresponding to the preset query method in the system under test according to the preset query method, including: when executing a test case through an interface, detecting the test data in the system under test in real time; determining whether there is modified or changed data in the test data according to the preset query method through the case data query function, and if so, obtaining the changed data corresponding to the preset query method in the test data; using the changed data corresponding to the preset query method in the test data as the query data; the system under test is a system connected to the interface; Determining whether the case data will be abnormal based on the query data, including: judging whether the query data is consistent with the case data; if consistent, determining that the case data will not be abnormal and executing the test case; if inconsistent, determining that the case data will be abnormal, modifying the case data based on the preset query method, and returning to the step of querying the query data corresponding to the preset query method in the system under test according to the preset query method; there is a mapping relationship between the preset query method and the modification method; the mapping relationship is established in advance using the case data modification function.

2. The method according to claim 1, wherein The modifying the case data based on the preset query method includes: If the number of the preset query methods is 1, obtaining the modification method corresponding to the preset query method; Modifying the case data based on the modification method and the query data; If the number of the preset query methods is multiple, obtaining the modification methods corresponding to each of the preset query methods to get multiple modification methods; Modifying the case data based on the multiple modification methods and the query data.

3. The method according to claim 1, wherein The querying the query data corresponding to the preset query method in the system under test according to the preset query method includes: if the number of the preset query methods is 1, querying the query data corresponding to the preset query method in the test data according to the preset query method preset in advance.

4. The method according to claim 1, characterized in that, The querying the query data corresponding to the preset query method in the system under test according to the preset query method includes: if the number of the preset query methods is multiple, for each preset query method, querying the query data corresponding to the preset query method in the test data according to the preset query method preset in advance.

5. A data processing device, characterized in that, The apparatus includes: An obtaining unit, configured to read the case data in the test case when executing a test case through an interface; A query unit for querying query data corresponding to the preset query method in the system to be tested according to the preset query method, including: when executing a test case through an interface, detecting test data in the system to be tested in real time; determining whether there is modified or changed data in the test data according to the preset query method through the use case data query function, and if so, obtaining the changed data corresponding to the preset query method in the test data; using the changed data corresponding to the preset query method in the test data as the query data; the system to be tested is a system connected to the interface; A determination unit for determining whether an exception will occur in the use case data based on the query data, including: determining whether the query data is consistent with the use case data; An execution unit for determining that the use case data will not have an exception and executing the test case if the query data is consistent with the use case data; A modification unit for determining that the use case data will have an exception if the query data is inconsistent with the use case data, modifying the use case data based on the preset query method, and returning to execute the query unit; there is a mapping relationship between the preset query method and the modification method; the mapping relationship is established in advance using the use case data modification function.

6. An electronic device, characterized in that, The electronic device is used to run a program, wherein when the program runs, it executes the data processing method according to any one of claims 1-4.

7. A computer storage medium, characterized in that, The storage medium includes a stored program, wherein when the program runs, it controls the device where the storage medium is located to execute the data processing method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Embedded software test case batch execution method capable of being automatically convertible

    CN103605606A

  • Test case parameter replacement method and device, computer equipment and storage medium

    CN108829587A

  • A skill testing method and system for a voice product in a voice dialogue platform

    CN109670016A

  • Test case verification method and device, computer equipment and storage medium

    CN110471838A