System testing method, device and computer-readable storage medium

By optimizing and automating the original test case set in system testing, the problem of low manual testing efficiency is solved, and efficient and comprehensive system testing is achieved.

CN111552631BActive Publication Date: 2025-06-20CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010227884.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-27
Publication Date
2025-06-20
Estimated Expiration
2040-03-27

AI Technical Summary

Technical Problem

System testing usually relies on manual labor, resulting in problems such as long time, high workload and low fault tolerance.

Method used

By obtaining the original test case set in the system to be tested, performing optimization processing to generate the optimized test case set, and loading it into an automated test statement, executing the test cases using a pre-built test script to generate a test report.

Benefits of technology

It improves the efficiency of system testing, reduces test time and cost, and improves fault tolerance, achieving comprehensive testing of the test system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111552631B_ABST
    Figure CN111552631B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of software testing, and discloses a system testing method, including: obtaining an original test case set in a system to be tested, performing optimization processing on the original test case set to obtain an optimized test case set; loading the optimized test case set into an automated test statement of the system to be tested to obtain an optimized test case statement; using a pre-built test script to execute the optimized test case statement on the system to be tested to generate a test report of the system to be tested. The present invention also provides a system testing device, an electronic device, and a computer-readable storage medium. The present invention can achieve efficient 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 technical field of software testing, and particularly to a method, device, electronic device and computer-readable storage medium for system testing. Background Art

[0002] Software testing is an inescapable core business for almost all companies mainly engaged in information technology. Through testing, it can be ensured that the developed system can run normally. Currently, system testing usually verifies the functions of the system to be tested based on manual methods. Conducting system testing manually has problems such as long time, large workload, and low fault tolerance rate. Summary of the Invention

[0003] The present invention provides a method, device, electronic device and computer-readable storage medium for system testing, and its main purpose is to provide a technical solution for system testing to help users solve the problems of long time, large workload and low fault tolerance rate that occur during system testing.

[0004] To achieve the above object, a system testing method provided by the present invention includes:

[0005] Obtain the original test case set in the system to be tested, and perform optimization processing on the original test case set to obtain an optimized test case set;

[0006] Load the optimized test case set into the automated test statements of the system to be tested to obtain optimized test case statements;

[0007] Use a pre-constructed test script to execute the optimized test case statements on the system to be tested, and generate a test report of the system to be tested.

[0008] Optionally, the performing optimization processing on the original test case set to obtain an optimized test case set includes:

[0009] Calculate the cost function value of the original test case set to obtain the cost function value set of the original test case set;

[0010] Compare each cost function value in the cost function value set with a preset threshold, screen out the original test case set with a cost function value less than the preset threshold, and use the screened original test case set as the optimized test case set.

[0011] Optionally, the calculating the cost function value of the original test case set includes:

[0012] Use the following formula to calculate the cost function value cost of the original test case set i :

[0013]

[0014] where t ic is the CPU running time of the i-th original test case in the system to be tested, is the data length of the i-th original test case, s im is the memory space consumption of the i-th original test case in the system to be tested, is the data type of the i-th original test case, m i is the cost of running the i-th original test case by the system to be tested, m average is the average cost of running similar services by the system to be tested.

[0015] Optionally, loading the optimized test case set into the automated test statement of the system to be tested includes:

[0016] Obtain the configuration file of the automated test statement, configure the path of the file parameters for the optimized test case set according to the configuration file, and obtain the file transfer path;

[0017] According to the file transfer path, transfer the data in the optimized test case set to the automated test statement in a preset manner.

[0018] Optionally, before executing the optimized test case statement on the system to be tested using the pre-built test script, the method further includes:

[0019] Use the pre-built script generator to identify whether the client and server of the system to be tested can ensure normal data communication.

[0020] Optionally, using the pre-built script generator to identify whether the client and server of the system to be tested can have normal data communication includes:

[0021] Use the script generator to receive the data stream sent by the client of the system to be tested, identify the file transfer protocol in the data stream, record the file transfer protocol and forward it to the server of the system to be tested;

[0022] If the server can identify the file transfer protocol, it is determined that the client and server of the system to be tested can ensure normal data communication, and the corresponding data stream is returned to the client;

[0023] If the server cannot identify the file transfer protocol, it is determined that the client and server of the system to be tested cannot ensure normal data communication, and the data stream sent by the client is received again.

[0024] Optionally, executing the optimized test case statements on the system to be tested using the pre-built test script to generate a test report for the system to be tested, including:

[0025] Starting the optimized test case statements using the pre-built test script;

[0026] Testing all function nodes of the system to be tested according to the started optimized test case statements to obtain a node test report;

[0027] Performing regression testing on important function nodes in the system to be tested according to the started optimized test case statements to obtain an important node test report;

[0028] Performing path testing on conditional control nodes in the system to be tested according to the started optimized test case statements to obtain a control node test report;

[0029] Merging the node test report, the important node test report, and the control node test report to form the test report for the system to be tested.

[0030] To solve the above problems, the present invention also provides a system testing device, the device includes:

[0031] An optimization module, configured to obtain an original test case set in the system to be tested, perform optimization processing on the original test case set to obtain an optimized test case set;

[0032] A loading module, configured to load the optimized test case set into the automated test statements of the system to be tested to obtain optimized test case statements;

[0033] A testing module, configured to execute the optimized test case statements on the system to be tested using a pre-built test script to generate a test report for the system to be tested.

[0034] To solve the above problems, the present invention also provides an electronic device, the electronic device includes:

[0035] A memory, storing at least one instruction; and

[0036] A processor, executing the instructions stored in the memory to implement the system testing method described in any one of the above.

[0037] To solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the system testing method described in any one of the above.

[0038] In an embodiment of the present invention, by obtaining the original test case set in the system to be tested, optimizing the original test case set to obtain an optimized test case set, the fault tolerance rate during the testing of the system to be tested is ensured. Loading the optimized test case set into the automated test statements of the system to be tested to obtain optimized test case statements saves testing time and costs. Executing the optimized test case statements on the system to be tested in combination with a pre-constructed test script to generate a test report for the system to be tested realizes the comprehensiveness during the testing of the system to be tested. Therefore, the system testing method, device, and computer-readable storage medium proposed by the present invention can help users improve the efficiency during system testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a schematic flowchart of the system testing method provided by an embodiment of the present invention;

[0040] Figure 2 It is a schematic flowchart of the data communication identification method provided by an embodiment of the present invention;

[0041] Figure 3 It is a schematic module diagram of the system testing method provided by an embodiment of the present invention;

[0042] Figure 4 It is a schematic internal structure diagram of an electronic device for the system testing method provided by an embodiment of the present invention;

[0043] The realization, functional features, and advantages of the object of the present invention will be further described in conjunction with the embodiments with reference to the drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0045] The present invention provides a system testing method. Refer to Figure 1 As shown, it is a schematic flowchart of the system testing method provided by an embodiment of the present invention. This method can be executed by a device, and the device can be implemented by software and / or hardware.

[0046] In this embodiment, the system testing method includes:

[0047] S1. Obtain the original test case set in the system to be tested, and optimize the original test case set to obtain an optimized test case set.

[0048] In a preferred embodiment of the present invention, the original test case set includes: the business historical data set in the system to be tested and the data set constructed by the system to be tested to ensure the comprehensiveness of testing.

[0049] In the embodiments of the present invention, since the system to be tested contains a large number of data sets, many useless test case sets will be generated. Therefore, preferably, the embodiments of the present invention optimize the original test case set to obtain the optimized test case set.

[0050] Specifically, the optimization process includes:

[0051] Calculate the cost function values of the original test case set to obtain the cost function value set of the original test case set; compare each cost function value in the cost function value set with a preset threshold, and filter out the original test case sets with cost function values less than the preset threshold. The filtered original test case sets are used as the optimized test case set. The preset threshold in the embodiments of the present invention is 0.1.

[0052] The calculation method for calculating the cost function values of the original test case set includes:

[0053]

[0054] where t ic is the CPU running time of the i-th original test case in the system to be tested, is the data length of the i-th original test case, s im is the memory space consumption of the i-th original test case in the system to be tested, is the data type of the i-th original test case, m i is the cost of the system to be tested running the i-th original test case, m average is the average cost of the system to be tested running similar services.

[0055] Based on the above embodiments, the original test case set is optimized to ensure the efficiency when testing the system to be tested.

[0056] S2. Load the optimized test case set into the automated test statements of the system to be tested to obtain optimized test case statements.

[0057] In at least one embodiment of the present invention, the automated test statements are obtained by compilation when constructing the system to be tested. The corresponding test case requests can be executed using the automated test statements, and the automated test statements can be obtained by compilation using the Python or Java programming language.

[0058] Specifically, the step of loading the optimized test case set into the automated test statements of the system to be tested includes:

[0059] Obtain the configuration file of the automated test statement, configure the path of the file parameters for the optimized test case set according to the configuration file to obtain a file transfer path, and transfer the data in the optimized test case set to the automated test statement in a preset manner according to the file transfer path to obtain the optimized test case statement. The preset manner can be to construct a data transfer script for data transfer or to use an automated data transfer tool for data transfer.

[0060] Based on the above embodiments, the embodiments of the present invention can implement a single test on a certain project in the system to be tested by loading the optimized test case set into the automated test statement of the system to be tested, saving test time and cost.

[0061] S3. Use the pre-built test script to execute the optimized test case statement on the system to be tested to generate a test report for the system to be tested.

[0062] In at least one embodiment of the present invention, the pre-built test script is equivalent to a driver program. By executing the corresponding optimized test case statement through the test script, the pre-built test script can be obtained by compilation according to user requirements in a compilation environment. Preferably, before using the pre-built test script to execute the optimized test case statement on the system to be tested, the pre-built script generator is used to identify whether the client and the server of the system to be tested can communicate normally with data, which can be referred to Figure 2 as shown. Among them, the client is called the request side, and the server side is called the response side. In the embodiments of the present invention, the client can represent a computer connected to the network during system testing, and the server side can represent a system that accepts services and returns service results during system testing. The pre-built script generator is obtained by compiling a compilation language.

[0063] Specifically, the specific real-time steps for the pre-built script generator to identify whether the client and the server of the system to be tested can maintain normal data communication include:

[0064] S30. Use the script generator to receive the data stream sent by the client of the system to be tested.

[0065] S31. Identify the file transfer protocol in the data stream.

[0066] S32. Record the file transfer protocol and forward it to the server of the system to be tested.

[0067] S33. Determine whether the server recognizes the file transfer protocol.

[0068] If the server side recognizes the file transfer protocol, execute S34, determine whether the client and server side of the system to be tested can ensure normal data communication, and return the corresponding data stream to the client.

[0069] If the server side fails to recognize the file transfer protocol, execute S35, determine that the client and server side of the system to be tested cannot ensure normal data communication, and receive the data stream sent by the client again.

[0070] Through the above implementation method, the embodiment of the present invention uses a pre-built script generator to identify whether the client and server side of the system to be tested can ensure normal data communication, ensuring that the test of the system to be tested can proceed normally.

[0071] Preferably, in the embodiment of the present invention, the optimized test case statements are executed on the system to be tested by using the pre-built test script, and a test report of the system to be tested is generated, including: starting the optimized test case statements by using the pre-built test script; testing all function nodes of the system to be tested according to the started optimized test case statements to obtain a node test report; performing regression testing on important function nodes in the system to be tested according to the started optimized test case statements to obtain an important node test report; performing path testing on conditional control nodes in the system to be tested according to the started optimized test case statements to obtain a control node test report; and merging the node test report, the important node test report, and the control node test report to form the test report of the system to be tested.

[0072] In the embodiment of the present invention, the important function nodes are screened according to the business logic, and the business logic includes: key business nodes in the system to be tested, nodes that can represent the business process characteristics of the system to be tested, and nodes that can affect the final operation result of the business process of the system to be tested. For example: if the system to be tested is a securities company business system, then the important function points in the business process are: client data loading program node, brokerage market monitoring program node, securities real-time trading program node, etc.

[0073] In the embodiments of the present invention, the regression test includes an ordinary test and a stress test. The ordinary test tests the important function nodes through the optimized test case statements; the stress test constructs a parameter file, and the optimized test case statements read the parameter file to test the important function nodes, obtaining the important node test report. The parameter file can simulate various extreme business scenarios by adjusting the included parameters. For example, if the system to be tested is a securities company business system, then the following can be adjusted in the parameter file: the peak and valley values of the number of concurrent online trading customers, the peak and valley values of the number of business requests sent by customers, and the peak and valley values of the amount of files transferred concurrently during the execution of the business, etc.

[0074] In the embodiments of the present invention, the conditional control node in the system to be tested refers to a node that, after judging the input data, inputs the judged data into different transmission paths. For example, for

[0075] if(x>y){temp=x,x=y,y=temp}

[0076] if(x>z){temp=x,x=z,z=temp}

[0077] if(y>z){temp=y,y=z,z=temp}

[0078] This conditional control node has a total of 6 transmission paths, namely: x>y, x>z, y>z, x<y, x<z, y<z. Preferably, in the embodiments of the present invention, the optimized test case statements read the transmission paths in the conditional control node to implement path testing on the conditional control node in the system to be tested, obtaining the control node test report.

[0079] Based on the above implementation, by performing regression testing on all function nodes and important function nodes of the system to be tested and testing the conditional control node, the comprehensiveness of testing the system to be tested is achieved.

[0080] As Figure 3 shown, it is a functional module diagram of the system test device of the present invention.

[0081] The system test device 100 of the present invention can be installed in an electronic device. According to the implemented functions, the system test device may include an optimization module 101, a loading module 102, and a testing module 103. The modules of the present invention can also be referred to as units, which refer to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.

[0082] In this embodiment, the functions of each module / unit are as follows:

[0083] The optimization module 101 is configured to obtain an original test case set in the system to be tested, and perform optimization processing on the original test case set to obtain an optimized test case set.

[0084] The loading module 102 is configured to load the optimized test case set into the automated test statements of the system to be tested to obtain optimized test case statements.

[0085] The testing module 103 is configured to execute the optimized test case statements on the system to be tested by using a pre-constructed test script, and generate a test report of the system to be tested.

[0086] Specifically, the specific implementation steps of each module of the system testing device are as follows:

[0087] The optimization module 101 obtains an original test case set in the system to be tested, and performs optimization processing on the original test case set to obtain an optimized test case set.

[0088] In a preferred embodiment of the present invention, the original test case set includes: a business historical data set in the system to be tested and a data set constructed by the system to be tested to ensure comprehensive testing.

[0089] In an embodiment of the present invention, since the system to be tested contains a large amount of data sets, many useless test case sets will be generated. Therefore, preferably, in an embodiment of the present invention, the original test case set is subjected to optimization processing to obtain the optimized test case set.

[0090] Specifically, the optimization processing includes:

[0091] Calculating a cost function value of the original test case set to obtain a cost function value set of the original test case set; comparing each cost function value in the cost function value set with a preset threshold, screening out the original test case set with a cost function value less than the preset threshold, and using the screened original test case set as the optimized test case set. The preset threshold in the embodiment of the present invention is 0.1.

[0092] The calculation method for calculating the cost function value of the original test case set includes:

[0093]

[0094] where t ic is the CPU running time of the i-th original test case in the system to be tested, is the data length of the i-th original test case, s im is the memory space consumption of the i-th original test case in the system to be tested, is the data type of the i-th original test case, m i is the cost of the i-th original test case executed by the system under test, m average is the average cost of the system under test running similar services.

[0095] Based on the above implementation, the original test case set is optimized, ensuring the efficiency of testing the system under test.

[0096] The loading module 102 loads the optimized test case set into the automated test statements of the system under test to obtain optimized test case statements.

[0097] In at least one embodiment of the present invention, the automated test statements are obtained by compilation when constructing the system under test. The corresponding test case requests can be executed using the automated test statements, and the automated test statements can be compiled using the Python or Java programming language.

[0098] Specifically, loading the optimized test case set into the automated test statements of the system under test includes:

[0099] Obtain the configuration file of the automated test statements, configure the path of the file parameters for the optimized test case set according to the configuration file to obtain a file transfer path, and transfer the data in the optimized test case set to the automated test statements in a preset manner according to the file transfer path to obtain the optimized test case statements. The preset manner can be to construct a data transfer script for data transfer or use an automated data transfer tool for data transfer.

[0100] Based on the above implementation, the embodiment of the present invention can achieve single testing of a certain project in the system under test by loading the optimized test case set into the automated test statements of the system under test, saving testing time and cost.

[0101] The testing module 103 executes the optimized test case statements on the system under test using a pre-constructed test script to generate a test report of the system under test.

[0102] In at least one embodiment of the present invention, the pre-built test script is equivalent to a driver, and corresponding optimized test case statements are executed through the test script. The pre-built test script can be obtained by compiling according to user requirements in a compilation environment. Preferably, before the optimized test case statements are executed on the system under test by using the pre-built test script, the pre-built script generator is used to identify whether the client and the server of the system under test can perform normal data communication, which can be referred to Figure 2 as shown. Among them, the client is called the requestor, and the server is called the responder. In the embodiment of the present invention, the client can represent a computer connected to the network during system testing, and the server can represent a system that receives services and returns service results during system testing. The pre-built script generator is obtained by compiling a compilation language.

[0103] Specifically, the specific real-time steps for identifying whether the client and the server of the system under test can maintain normal data communication through the pre-built script generator include: receiving the data stream sent by the client of the system under test by using the script generator; identifying the file transfer protocol in the data stream; recording the file transfer protocol and forwarding it to the server of the system under test; judging whether the server can identify the file transfer protocol; if the server can identify the file transfer protocol, it is judged that the client and the server of the system under test can ensure normal data communication, and the corresponding data stream is returned to the client; if the server cannot identify the file transfer protocol, it is judged that the client and the server of the system under test cannot ensure normal data communication, and the data stream sent by the client is received again.

[0104] Through the above implementation method, the embodiment of the present invention uses the pre-built script generator to identify whether the client and the server of the system under test can ensure normal data communication, ensuring that the test of the system under test can proceed normally.

[0105] Preferably, in the embodiment of the present invention, the optimized test case statements are executed on the system to be tested by using the pre-constructed test script, and a test report of the system to be tested is generated, including: starting the optimized test case statements by using the pre-constructed test script; testing all function nodes of the system to be tested according to the started optimized test case statements to obtain a node test report; performing regression testing on important function nodes in the system to be tested according to the started optimized test case statements to obtain an important node test report; performing path testing on conditional control nodes in the system to be tested according to the started optimized test case statements to obtain a control node test report; and merging the node test report, the important node test report, and the control node test report to form the test report of the system to be tested.

[0106] In the embodiment of the present invention, the important function nodes are screened according to the business logic, and the business logic includes: key business nodes in the system to be tested, nodes that can represent the business process characteristics of the system to be tested, and nodes that can affect the final operation result of the business process of the system to be tested. For example: if the system to be tested is a securities company business system, then the important function points in the business process are: customer data loading program node, brokerage market monitoring program node, securities real-time trading program node, etc.

[0107] In the embodiment of the present invention, the regression testing includes ordinary testing and stress testing. The ordinary testing tests the important function nodes through the optimized test case statements; the stress testing constructs a parameter file, and the optimized test case statements read the parameter file to test the important function nodes to obtain the important node test report. The parameter file can simulate various extreme business scenarios by adjusting the included parameters. For example: if the system to be tested is a securities company business system, then the following can be adjusted in the parameter file: the peak and valley values of the number of customers trading online simultaneously, the peak and valley values of the number of business requests sent by customers, and the peak and valley values of the amount of files transmitted simultaneously during the execution of the business.

[0108] In the embodiment of the present invention, the conditional control nodes in the system to be tested refer to those that, after judging the input data, input the judged data into different transmission paths. For example, for

[0109] if(x>y){temp=x,x=y,y=temp}

[0110] if(x>z){temp=x,x=z,z=temp}

[0111] if(y>z){temp=y,y=z,z=temp}

[0112] The conditional control node has a total of six transmission paths, namely: x > y, x > z, y > z, x < y, x < z, y < z. Preferably, in the embodiment of the present invention, the transmission paths in the conditional control node are read through the optimized test case statements, so as to perform path testing on the conditional control node in the system to be tested, and obtain a control node test report.

[0113] Based on the above implementation manners, by performing regression testing on all functional nodes and important functional nodes of the system to be tested and testing the conditional control nodes, the comprehensiveness of testing the system to be tested is achieved.

[0114] As Figure 4 shown, it is a schematic structural diagram of an electronic device for the method of implementing system testing in the present invention.

[0115] The electronic device 1 may include a processor 10, a memory 11, and a bus, and may further include a computer program stored in the memory 11 and executable on the processor 10, such as a system test program 12.

[0116] Among them, the memory 11 includes at least one type of readable storage medium. The readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as the mobile hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 can be used not only to store application software installed on the electronic device 1 and various types of data, such as the code of the system test program, but also to temporarily store data that has been output or will be output.

[0117] In some embodiments, the processor 10 may be composed of an integrated circuit. For example, it may be composed of a single packaged integrated circuit, or may be composed of multiple packaged integrated circuits with the same or different functions, including a combination of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control core (Control Unit) of the electronic device, connecting all components of the entire electronic device through various interfaces and circuits, and by running or executing programs or modules (such as system test programs, etc.) stored in the memory 11, and calling data stored in the memory 11, to perform various functions of the electronic device 1 and process data.

[0118] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is set to enable connection communication between the memory 11 and at least one processor 10, etc.

[0119] Figure 4 Only the electronic device with components is shown. Those skilled in the art can understand that Figure 4 the shown structure does not constitute a limitation on the electronic device 1, and it may include fewer or more components than shown, or combine certain components, or have a different component layout.

[0120] For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for powering each component. Preferably, the power source can be logically connected to the at least one processor 10 through a power management device, so as to implement functions such as charge management, discharge management, and power consumption management through the power management device. The power source may also include any components such as one or more DC or AC power sources, a recharge device, a power failure detection circuit, a power converter or inverter, and a power status indicator. The electronic device 1 may also include various sensors, a Bluetooth module, a Wi-Fi module, etc., which will not be elaborated here.

[0121] Furthermore, the electronic device 1 may further include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0122] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), and optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, and is used to display the information processed in the electronic device 1 and to display a visual user interface.

[0123] It should be understood that the above embodiments are only for illustration purposes and are not limited by this structure in the scope of the patent application.

[0124] The system test program 12 stored in the memory 11 of the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can achieve:

[0125] Obtain the original test case set in the system to be tested, perform optimization processing on the original test case set to obtain an optimized test case set;

[0126] Load the optimized test case set into the automated test statements of the system to be tested to obtain optimized test case statements;

[0127] Use a pre-built test script to execute the optimized test case statements on the system to be tested to generate a test report of the system to be tested.

[0128] Use a data graphing tool to display the report result data set on a web platform.

[0129] Specifically, for the specific implementation method of the above instructions by the processor 10, reference may be made to Figure 1 the description of the relevant steps in the corresponding embodiments, which will not be elaborated here.

[0130] Furthermore, if the modules / units integrated in the electronic device 1 are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only Memory).

[0131] In several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation.

[0132] The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical units, that is, they can 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.

[0133] In addition, in each embodiment of the present invention, the functional modules can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a combination of hardware and software functional modules.

[0134] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above-mentioned exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms.

[0135] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present invention. Any associated drawing marks in the claims should not be regarded as limiting the claims involved.

[0136] In addition, obviously, the word "including" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or apparatuses stated in the system claims can also be implemented by one unit or apparatus through software or hardware. Words such as "second" are used to denote names and do not denote any specific order.

[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not restrictive. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A system testing method, characterized in that, The method includes: Obtain the original test case set in the system to be tested, calculate the cost function value of the original test case set to obtain the cost function value set of the original test case set, compare each cost function value in the cost function value set with a preset threshold, and filter out the original test case set whose cost function value is less than the preset threshold to obtain an optimized test case set. The calculation of the cost function value of the original test case set The formula is as follows: wherein, is the CPU running time of the i-th original test case in the system to be tested, is the data length of the i-th original test case, is the memory space consumption of the i-th original test case in the system to be tested, is the data type of the i-th original test case, is the cost of running the i-th original test case in the system to be tested, is the average cost of running similar services in the system to be tested; Loading the optimized test case set into the automated test statements of the system to be tested to obtain optimized test case statements, including: obtaining the file transfer path for loading the optimized test case set into the automated test statements, and according to the file transfer path, transferring the data in the optimized test case set to the automated test statements in a preset manner to obtain the optimized test case statements; Executing the optimized test case statements on the system to be tested by using a pre-constructed test script to generate a test report for the system to be tested.

2. The system testing method according to claim 1, characterized in that, The obtaining of the file transfer path for loading the optimized test case set into the automated test statements includes: Obtaining the configuration file of the automated test statements, and performing path configuration of file parameters on the optimized test case set according to the configuration file to obtain the file transfer path.

3. The system testing method according to claim 1, characterized in that, Before executing the optimized test case statements on the system to be tested by using the pre-constructed test script, the method further includes: Using a pre-constructed script generator to identify whether the client and the server of the system to be tested can perform normal data communication.

4. The system testing method according to claim 3, characterized in that, The using of the pre-constructed script generator to identify whether the client and the server of the system to be tested can perform normal data communication includes: Using the script generator to receive the data stream sent by the client of the system to be tested, identifying the file transfer protocol in the data stream, recording the file transfer protocol and forwarding it to the server of the system to be tested; If the server can identify the file transfer protocol, determining that the client and the server of the system to be tested can ensure normal data communication, and returning the corresponding data stream to the client; If the server cannot identify the file transfer protocol, determining that the client and the server of the system to be tested cannot ensure normal data communication, and re-receiving the data stream sent by the client.

5. The system testing method according to any one of claims 1 to 4, characterized in that, The using of the pre-constructed test script to execute the optimized test case statements on the system to be tested to generate a test report for the system to be tested includes: Starting the optimized test case statements by using the pre-constructed test script; Testing all function nodes of the system to be tested according to the started optimized test case statements to obtain a node test report; Performing regression testing on important function nodes in the system to be tested according to the started optimized test case statements to obtain an important node test report; Performing path testing on conditional control nodes in the system to be tested according to the started optimized test case statements to obtain a control node test report; Merging the node test report, the important node test report, and the control node test report to form the test report for the system to be tested.

6. A system testing device, characterized in that, The device includes: An optimization module, configured to obtain an original test case set in a system to be tested, calculate a cost function value of the original test case set to obtain a cost function value set of the original test case set, compare each cost function value in the cost function value set with a preset threshold, filter out the original test case set whose cost function value is less than the preset threshold to obtain an optimized test case set, and calculate the cost function value of the original test case set The formula is as follows: Among them, is the CPU running time of the i-th original test case in the system to be tested, is the data length of the i-th original test case, is the memory space consumption of the i-th original test case in the system to be tested, is the data type of the i-th original test case, is the cost of running the i-th original test case in the system to be tested, is the average cost of running similar services in the system to be tested; A loading module, configured to load the optimized test case set into the automated test statements of the system to be tested, so as to obtain optimized test case statements, including: obtaining a file transfer path for loading the optimized test case set into the automated test statements, and according to the file transfer path, transferring the data in the optimized test case set to the automated test statements in a preset manner, so as to obtain the optimized test case statements; A testing module, configured to execute the optimized test case statements on the system to be tested by using a pre-built test script, and generate a test report of the system to be tested.

7. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the system testing method according to any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the system testing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and system for optimizing software test case

    CN103810104A

  • Automated test method and system and computer-readable storage medium

    CN107861864A