Automated testing method and device

By embedding probe programs in the system under test to obtain and process production data, the problems of high system testing cost and low efficiency in the existing technology are solved, the efficiency and authenticity of automated testing are achieved, and the cost of manually constructing data is reduced. .

CN113722235BInactive Publication Date: 2024-10-11BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111087316.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-16
Publication Date
2024-10-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing system testing methods are costly and have low efficiency in automated testing. Especially when testing non-independent systems, they need to manually construct large amounts of data and develop baffle programs, making the testing process complex and expensive.

Method used

Embed the probe program in the system under test, obtain the production data and send it to the test management system for processing, and generate the first data for automated testing, thereby reducing the cost of artificially constructing data and improving testing efficiency.

Benefits of technology

The production data is acquired and processed through the probe program, and the first data generated is used for automated testing, which improves the authenticity and efficiency of the test and reduces labor investment and testing costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113722235B_ABST
    Figure CN113722235B_ABST
Patent Text Reader

Abstract

The present invention discloses an automated testing method and device, and relates to the field of artificial intelligence technology, wherein the method comprises: embedding a probe program in a system to be tested; controlling the probe program to obtain production data of the system to be tested; sending the production data to a test management system through the probe program, so that the test management system processes the production data to obtain first data, and the first data is used for automated testing. The present invention can obtain the production data of the system to be tested through the probe program, and use the first data generated based on the production data for automated testing, which can reduce the cost of artificially constructing data and improve the efficiency of automated testing of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an automated testing method and device. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] With the rapid development of computer technology, the speed of system updates is also accelerating. When a system modifies certain functions or develops new functions, it is necessary to test the system to determine whether it affects other functions of the system. The existing testing method is to test the system by manually constructing a large amount of data and frequently maintaining the data, which is not only costly, but also has low efficiency in automated testing. Summary of the invention

[0004] An embodiment of the present invention provides an automated testing method for reducing system automated testing costs and improving automated testing efficiency. The method includes:

[0005] Embed the probe program in the system under test;

[0006] Controlling the probe program to obtain production data of the system to be tested;

[0007] The production data is sent to a test management system through the probe program, so that the test management system processes the production data to obtain first data, and the first data is used for performing automated testing.

[0008] The embodiment of the present invention further provides an automated testing device for reducing the system automated testing cost and improving the automated testing efficiency, the device comprising:

[0009] An embedding module, used to embed the probe program in the system under test;

[0010] A data acquisition module, used for controlling the probe program to acquire the production data of the system to be tested;

[0011] The first sending module is used to send the production data to the test management system through the probe program, so that the test management system processes the production data to obtain first data, and the first data is used for performing automated testing.

[0012] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned automated testing method when executing the computer program.

[0013] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above-mentioned automated testing method.

[0014] In an embodiment of the present invention, a probe program is embedded in the system to be tested; the probe program is controlled to obtain production data of the system to be tested; the production data is sent to a test management system through the probe program, so that the test management system processes the production data to obtain first data, and the first data is used for automated testing. In this way, the production data of the system to be tested can be obtained through the probe program, and the first data generated based on the production data can be used for automated testing, which can reduce the cost of manually constructing data and improve the efficiency of automated testing of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0016] Figure 1 A flowchart of an automated testing method provided in an embodiment of the present invention;

[0017] Figure 2 A flowchart of another automated testing method provided in an embodiment of the present invention;

[0018] Figure 3 A flow chart of an automated testing method for a non-independent system under test provided in an embodiment of the present invention;

[0019] Figure 4 A schematic diagram of an automated testing device provided in an embodiment of the present invention;

[0020] Figure 5 A schematic diagram of another automated testing device provided in an embodiment of the present invention;

[0021] Figure 6 A schematic diagram of another automated testing device provided in an embodiment of the present invention;

[0022] Figure 7 A schematic diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0024] In the description of this specification, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps is not limited and can be appropriately adjusted as needed.

[0025] Through research, it is found that, through the existing system testing methods, when testing independent systems (i.e. systems that do not rely on other systems and can provide services independently), most of the test data is constructed manually, and the amount of data required is huge, which requires a lot of labor costs; and for the testing of non-independent systems (i.e. systems that must cooperate with other systems to complete certain functions and are only responsible for special tasks in terms of division of labor, such as channel systems that are only responsible for receiving, converting and forwarding messages), not only does it require manual construction of a large amount of data, but it also requires the development of baffle programs to simulate other dependent systems, and then use the baffle programs to initiate tests or return data as the receiver. The whole process is very troublesome. It is understandable to use this method to test new functions of new versions, but for other original functions that need to be regressed every time, this approach is too costly and the difficulty of automated testing is also relatively large.

[0026] In view of the problems existing in the above research, an embodiment of the present invention provides an automated testing method, such as Figure 1 As shown, the method includes:

[0027] Step 101: embedding a probe program in the system to be tested;

[0028] Step 102: Control the probe program to obtain production data of the system to be tested;

[0029] Step 103: Send the production data to a test management system through the probe program, so that the test management system processes the production data to obtain first data, where the first data is used for automated testing.

[0030] In an embodiment of the present invention, a probe program is embedded in the system to be tested; the probe program is controlled to obtain production data of the system to be tested; the production data is sent to a test management system through the probe program, so that the test management system processes the production data to obtain first data, and the first data is used for automated testing. In this way, the production data of the system to be tested can be obtained through the probe program, and the first data generated based on the production data can be used for automated testing, which can reduce the cost of manually constructing data and improve the efficiency of automated testing of the system.

[0031] In the above step 101, the above probe program refers to a script program embedded in the system, which can be used to collect data and communicate with the outside. Moreover, for different systems under test, their communication methods or message formats may require different compatibility measures. Therefore, the probe programs embedded in different systems under test are also different. Specifically, the probe program can be customized and developed according to the language environment of the system under test.

[0032] In addition, to embed the probe program in the system under test, the probe program needs to be embedded in a suitable position in the system under test. Specifically, the position where the probe program is embedded in the system under test can be determined by existing methods such as the instrumentation strategy, which will not be described in detail here.

[0033] In the above step 102, the above production data refers to the real transaction data generated during the actual application of the system under test.

[0034] Among them, when the system under test is in the actual application process (real environment), the probe is in the recording state, and the system under test can control the probe program to capture the data generated by the interaction with the system under test (i.e., production data). For example, two probes are embedded in different positions in the system under test, namely the front probe and the rear probe, wherein the front probe is used to obtain the data of the interaction between system A and the system under test, and the rear probe is used to obtain the data of the interaction between system C and the system under test.

[0035] In the above step 103, it can be known from the above content that the probe program can be used for external communication, and therefore, the above production data can be sent to the test management system through the probe program.

[0036] The above-mentioned management system to be tested is a pre-set system that matches the probe program, which can be used to receive and store data sent by the probe program; it can also provide a data query interface to the outside world, and perform data query for requests sent by the probe program; it can also generate request messages based on the data stored in the system, and send them to the system to be tested to simulate the initiation of real transactions. In addition, for some data with variables (serial numbers, timestamps, etc.), the management system to be tested can also use artificial intelligence technology to identify and perform special processing.

[0037] Therefore, after the test management system receives the production data sent by the probe program, it processes the received production data, generates first data and stores it. When the system to be tested is in a development environment, the test management system can use the first data to initiate a test request. Since the first data is generated based on the production data of the system to be tested, the test results obtained by performing automated testing using the first data are more authentic and have better test effects.

[0038] In the embodiment of the present invention, when the above-mentioned system to be tested is an independent system, Figure 2 As shown, a flow chart of a method for performing automated testing using first data in a development environment of a system to be tested provided by an embodiment of the present invention includes:

[0039] Step 201: when the system under test is in a development environment and the test management system generates a first test request message according to the first data, receiving the first test request message sent by the test management system through the probe program;

[0040] Step 202: Based on the first service logic of the system under test, the first test request message is processed to generate a first test response message;

[0041] The first business logic is a pre-set processing rule for a specific business of the system, which is responsible for the generation, processing and conversion of logical data.

[0042] Step 203: Send the first test response message to the test management system through the probe program, so that the test management system compares the first test response message with the first expected response message in the first data to generate a first test report.

[0043] Specifically, the first test report can be used to obtain the difference in the running results between the development environment and the actual environment of the system to be tested, thereby quickly and accurately locating whether new defects are introduced in the new version.

[0044] In addition, when the above-mentioned system to be tested is a non-independent system, the embodiment of the present invention can use the test management system to simulate any system environment and reproduce the real transaction scenario.

[0045] In the embodiment of the present invention, after the above step 202, the following steps are further included:

[0046] Based on the second business logic of the system to be tested, the first test request message is processed to generate a second test request message;

[0047] Sending the second test request message to the test management system through the probe program, so that the test management system queries the second expected response message corresponding to the second test request message from the first data;

[0048] Receiving a second expected response message sent by the test management system;

[0049] Based on the third service logic of the system to be tested, the second expected response message is processed to generate a fourth test response message.

[0050] Specifically, through the query interface of the system under test, the response message corresponding to the test request is queried, and the queried response message is sent to the system under test to continue the transaction, thereby realizing the use of the test management system to simulate any system environment and reproduce the real transaction scenario. Compared with the existing technology, there is no need to develop a baffle program or manually construct data, which reduces manual input and improves the efficiency of automated testing.

[0051] In addition, in an embodiment of the present invention, after generating the fourth test response message, the fourth test response message is sent to the test management system through the probe program, so that the test management system compares the fourth test response message with the second expected response message in the first data, and compares the second test request message with the first expected request message in the first data, to generate a second test report.

[0052] In order to more clearly describe the automated testing method provided by the present invention, the automated testing method provided by the present invention is illustrated below by using a specific example.

[0053] like Figure 3 FIG. 1 is a flow chart of an automated testing method for a non-independent system under test provided in an embodiment of the present invention, which mainly includes the following steps:

[0054] When the system under test is in a real environment (i.e. the system under test is in actual application):

[0055] Step 301: Control the front probe in the system to be tested to receive the request message 31 sent by system A;

[0056] Step 302: after being processed by the uplink logic (i.e., the second service logic) of the system under test, a request message 32 is generated, and the post-probe is controlled to send the request message 32 to the system C;

[0057] Step 303: System C generates a response message 33 according to the request message 32, and sends the response message 33 to the system under test;

[0058] Step 304: after being processed by the downlink logic (i.e., the third service logic) of the system under test, a response message 34 is generated, and the response message 34 is sent to the system A through the front probe;

[0059] It should be noted that the above request message 31, request message 32, response message 33 and response message 34 are equivalent to the production data in the embodiment of the present invention; and these production data can be sent to the test management system for processing and storage through the front probe and the rear probe. Among them, the front probe is mainly responsible for obtaining the data sent by system A and communicating with system A, and the rear probe is mainly responsible for the data sent by system C and communicating with system C.

[0060] When the system to be tested is in a development environment, neither system A nor system C exists. System A and system C can be simulated through the test management system. The test management system simulates initiating a transaction based on the request message 31, request message 32, response message 33, and response message 34.

[0061] Step 305: the test management system generates a corresponding test request message 41 (i.e., a first test request message) according to the request message 31, and sends the test request message 41 to the system under test;

[0062] Step 306: after being processed by the uplink logic (i.e., the second service logic) of the system under test, a test request message 42 (i.e., the second test request message) is generated, and the post-probe is controlled to send the test request message 42 to the test management system;

[0063] Step 307: the test management system queries the corresponding expected response message (i.e., the second expected response message) according to the test request message 42, and sends the expected response message 43 (i.e., the above-mentioned response message 33) to the system under test;

[0064] Step 308: after being processed by the downlink logic (i.e., the third service logic) of the system under test, a test response message 44 (i.e., the fourth test response message) is generated, and the front probe is controlled to send the test response message 44 to the test management system;

[0065] Step 309: The test management system compares the test request message 42 with the request message 32 to determine whether the upstream logic of the system under test introduces new defects due to the newly developed functions; and compares the test response message 44 with the response message 34 to determine whether the downstream logic of the system under test introduces new defects due to the newly developed functions. After the comparison is completed, a test report is automatically generated.

[0066] It should be noted that, when the system to be tested is in a real environment, system A can be an IT system or a user directly inputting data requests, and there can be one or more systems A; in addition, system C can exist or not exist. If it does not exist, there is no need to embed the post-probe, and there can also be one or more systems C.

[0067] The present invention also provides an automated testing device, as described in the following embodiments. Since the principle of solving the problem by the device is similar to that of the automated testing method, the implementation of the device can refer to the implementation of the automated testing method, and the repeated parts will not be repeated.

[0068] like Figure 4 As shown, it is a schematic diagram of an automated testing device provided by an embodiment of the present invention, comprising: an embedding module 401, a data acquisition module 402, and a first sending module 403; wherein,

[0069] An embedding module 401 is used to embed the probe program in the system to be tested;

[0070] A data acquisition module 402 is used to control the probe program to acquire the production data of the system under test;

[0071] The first sending module 403 is used to send the production data to the test management system through the probe program, so that the test management system processes the production data to obtain first data, and the first data is used for performing automated testing.

[0072] In another embodiment of the present invention, Figure 5 As shown, the above-mentioned automatic testing device also includes:

[0073] A first receiving module 501 is used for receiving, through the probe program, the first test request message sent by the test management system when the system under test is in a development environment and the test management system generates a first test request message according to the first data;

[0074] A first processing module 502, configured to process the first test request message based on the first business logic of the system under test, and generate a first test response message;

[0075] The second sending module 503 is used to send the first test response message to the test management system through the probe program, so that the test management system compares the first test response message with the first expected response message in the first data to generate a first test report.

[0076] In another embodiment of the present invention, Figure 6 As shown, the above-mentioned automatic testing device also includes:

[0077] The second processing module 601 is used to process the first test request message based on the second business logic of the system under test to generate a second test request message;

[0078] A third sending module 602 is used to send the second test request message to the test management system through the probe program, so that the test management system queries the second expected response message corresponding to the second test request message from the first data;

[0079] A second receiving module 603, configured to receive the second expected response message sent by the test management system;

[0080] The third processing module 604 is used to process the second expected response message based on the third service logic of the system under test to generate a fourth test response message.

[0081] In a possible implementation manner, the second sending module is specifically configured to:

[0082] The fourth test response message is sent to the test management system through the probe program, so that the test management system compares the fourth test response message with the second expected response message in the first data, and compares the second test request message with the first expected request message in the first data to generate a second test report.

[0083] In an embodiment of the present invention, a probe program is embedded in the system to be tested; the probe program is controlled to obtain production data of the system to be tested; the production data is sent to a test management system through the probe program, so that the test management system processes the production data to obtain first data, and the first data is used for automated testing. In this way, the production data of the system to be tested can be obtained through the probe program, and the first data generated based on the production data can be used for automated testing, which can reduce the cost of manually constructing data and improve the efficiency of automated testing of the system.

[0084] Based on the above invention concept, Figure 7 As shown, an embodiment of the present invention further provides a computer device 700, including a memory 710, a processor 720, and a computer program 730 stored in the memory 710 and executable on the processor 720, wherein the processor 720 implements the above-mentioned automated testing method when executing the computer program 730.

[0085] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above-mentioned automated testing method.

[0086] In an embodiment of the present invention, a probe program is embedded in the system to be tested; the probe program is controlled to obtain production data of the system to be tested; the production data is sent to a test management system through the probe program, so that the test management system processes the production data to obtain first data, and the first data is used for automated testing. Compared with the technical solutions for automated testing in the prior art, the production data of the system to be tested can be obtained through the probe program, and the first data generated based on the production data can be used for automated testing, which can reduce the cost of manually constructing data and improve the efficiency of automated testing of the system.

[0087] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

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

[0089] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0090] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.

[0091] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An automated testing method, characterized in that: include: Embed the probe program in the system under test; Controlling the probe program to obtain production data of the system under test; Sending the production data to a test management system through the probe program, so that the test management system processes the production data to obtain first data, wherein the first data is used for performing automated testing; Also includes: When the system under test is in a development environment and the test management system generates a first test request message according to the first data, receiving the first test request message sent by the test management system through the probe program; Based on the first business logic of the system under test, the first test request message is processed to generate a first test response message; Sending the first test response message to the test management system through the probe program, so that the test management system compares the first test response message with the first expected response message in the first data to generate a first test report; After receiving the first test request message sent by the test management system through the probe program, the method further includes: Based on the second business logic of the system to be tested, the first test request message is processed to generate a second test request message; Sending the second test request message to the test management system through the probe program, so that the test management system queries the second expected response message corresponding to the second test request message from the first data; Receiving the second expected response message sent by the test management system; Based on the third service logic of the system under test, the second expected response message is processed to generate a fourth test response message.

2. The method according to claim 1, characterized in that Also includes: The fourth test response message is sent to the test management system through the probe program, so that the test management system compares the fourth test response message with the second expected response message in the first data, and compares the second test request message with the first expected request message in the first data to generate a second test report.

3. An automated testing device, characterized in that: include: An embedding module is used to embed the probe program in the system under test; A data acquisition module, used for controlling the probe program to acquire the production data of the system to be tested; A first sending module, used for sending the production data to a test management system through the probe program, so that the test management system processes the production data to obtain first data, wherein the first data is used for performing automated testing; Also includes: A first receiving module is used to receive the first test request message sent by the test management system through the probe program when the system under test is in a development environment and the test management system generates a first test request message according to the first data; A first processing module, configured to process the first test request message based on the first business logic of the system to be tested, and generate a first test response message; A second sending module, used for sending the first test response message to the test management system through the probe program, so that the test management system compares the first test response message with the first expected response message in the first data to generate a first test report; The device also includes: A second processing module, used to process the first test request message based on the second business logic of the system to be tested, and generate a second test request message; A third sending module, configured to send the second test request message to the test management system through the probe program, so that the test management system queries the second expected response message corresponding to the second test request message from the first data; A second receiving module, used for receiving the second expected response message sent by the test management system; The third processing module is used to process the second expected response message based on the third business logic of the system under test to generate a fourth test response message.

4. The device according to claim 3, characterized in that The second sending module is specifically used for: The fourth test response message is sent to the test management system through the probe program, so that the test management system compares the fourth test response message with the second expected response message in the first data, and compares the second test request message with the first expected request message in the first data to generate a second test report.

5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 2 is implemented.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the method according to any one of claims 1 to 2.