Automated testing method and device
By writing automated test cases based on the operational concerns of each process node and executing them in parallel, the problems of high coupling and low efficiency in automated test design are solved, and the testing efficiency and coverage are improved, which is suitable for automated test design of internal production systems of the enterprise.
Patent Information
- Application Number
- CN201810877589.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-08-03
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2038-08-03
AI Technical Summary
Due to the high coupling of existing interface-based automated test design methods, multiple process nodes are involved in adding and modifying automated test cases, resulting in code defects, and different business processes cannot be tested in parallel, reducing the efficiency of automation testing.
According to the operational concerns of each process node, it writes automated test cases separately, obtains historical data and basic data, writes them to the test environment database, restarts the system, and executes automated test cases in parallel to reduce the coupling and correlation between use cases. Allows new operational concerns to be added just to write application examples without modifying other use case codes.
It significantly improves the efficiency of automated testing, improves test coverage, reduces the proficiency requirements for business processes, facilitates the team to organize automated testing, and realizes parallel testing of business processes.
Smart Images

Figure CN110795332B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an automated testing method and device. Background Art
[0002] Automated testing is an important regression testing method, and interface-based automated testing is an important branch. For production systems used within an enterprise, the system interface rarely changes, unlike portal-based systems that need to be frequently revised. However, the backend processes and data of the enterprise's internal system change relatively quickly. Therefore, for the enterprise's internal production system, using interface-based automated testing is a relatively effective method.
[0003] The existing interface-based automated testing design method is generally based on process-oriented design, which splits the overall business functions according to business processes. Each time the automated test is executed, from the beginning to the end of a process, the intermediate process nodes are executed in sequence, and then the next process is executed until all processes are executed.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] Due to the large coupling, adding and modifying automated test cases will involve many process nodes, which will cause defects in the automated test code; different business processes cannot be tested in parallel, which greatly reduces the efficiency of automated testing. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides an automated testing method and device, which can solve the problem of large coupling between process nodes and low automated testing efficiency.
[0007] To achieve the above object, according to one aspect of an embodiment of the present invention, there is provided an automated testing method, comprising:
[0008] According to the operational concerns involved in each process node, write the automated test cases corresponding to each process node respectively; wherein the operational concerns represent the operational process from the query window to the processing window involved in the process node;
[0009] Obtain historical data and basic data, write the historical data and basic data into the test environment database, and restart the system to be tested;
[0010] Start and execute the automated test case.
[0011] Optionally, writing the historical data and basic data into the test environment database includes:
[0012] Clear the historical test data table in the test environment database, and write the historical data into the historical test data table;
[0013] The basic data is synchronized to the basic data table in the test environment database.
[0014] Optionally, starting and executing the automated test case includes:
[0015] Split the test execution machine according to the automated test cases;
[0016] Deploy the execution machine environment and deploy a test case application corresponding to the automated test case on each execution machine;
[0017] The test case application deployed on the execution machine is started, and the execution machine begins to execute the automated test case.
[0018] Optionally, it also includes:
[0019] If there is data that fails the test during the execution of the automated test case, the unique identifier of the data will be written into the local log file of the execution machine, and a subdirectory will be created with the unique identifier of the data to save screenshots of the data during this operation, checkpoints during the execution of the data by the automated test case, the log context of the system under test within the operation time period, and the log information of the automated test script itself as failed data information; and the pause status of the data will be saved in the test environment database.
[0020] Optionally, it also includes: collecting statistical results of the test environment database and execution results of automated test cases.
[0021] Optionally, the statistical result includes the percentage of the quantity of test data in different states and detailed data, and the execution result includes failure data information stored on each execution machine.
[0022] In addition, according to another aspect of the embodiment of the present invention, there is provided an automated testing device, comprising:
[0023] A use case module is used to write an automated test case corresponding to each process node according to the operation focus involved in each process node; wherein the operation focus represents the operation process from the query window to the processing window involved in the process node;
[0024] A writing module is used to obtain historical data and basic data, write the historical data and basic data into the test environment database, and restart the system to be tested;
[0025] The test module is used to start and execute the automated test case.
[0026] Optionally, writing the historical data and basic data into the test environment database includes:
[0027] Clear the historical test data table in the test environment database, and write the historical data into the historical test data table;
[0028] The basic data is synchronized to the basic data table in the test environment database.
[0029] Optionally, the test module is used to:
[0030] Split the test execution machine according to the automated test cases;
[0031] Deploy the execution machine environment and deploy a test case application corresponding to the automated test case on each execution machine;
[0032] The test case application deployed on the execution machine is started, and the execution machine begins to execute the automated test case.
[0033] Optionally, the test module is further used to:
[0034] If there is data that fails the test during the execution of the automated test case, the unique identifier of the data will be written into the local log file of the execution machine, and a subdirectory will be created with the unique identifier of the data to save screenshots of the data during this operation, checkpoints during the execution of the data by the automated test case, the log context of the system under test within the operation time period, and the log information of the automated test script itself as failed data information; and the pause status of the data will be saved in the test environment database.
[0035] Optionally, it also includes:
[0036] The result module is used to collect the statistical results of the test environment database and the execution results of the automated test cases.
[0037] Optionally, the statistical result includes the percentage of the quantity of test data in different states and detailed data, and the execution result includes failure data information stored on each execution machine.
[0038] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, including:
[0039] one or more processors;
[0040] a storage device for storing one or more programs,
[0041] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.
[0042] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in any one of the above embodiments is implemented.
[0043] An embodiment of the above invention has the following advantages or beneficial effects: because the technical means of writing the automated test cases corresponding to each process node separately according to the operational concerns involved in each process node is adopted, the technical problem of large coupling between process nodes and low efficiency of automated testing is overcome; the present invention writes the automated test cases corresponding to each process node separately according to the operational concerns involved in each process node, reduces the coupling and correlation between automated test cases, and if a new operational concern is added, it is only necessary to write automated test cases for the operational concern without modifying other existing automated test case codes; by executing in a column-first-row-later manner, each business process can be tested in parallel, which significantly improves the efficiency of automated testing. Moreover, the embodiment of the present invention can also improve the test coverage of automated testing, reduce the proficiency requirements of automated testers for business processes, facilitate task decomposition, and organize automated testing in a team form.
[0044] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0046] Figure 1 is a schematic diagram of the main process of the automated testing method according to an embodiment of the present invention;
[0047] Figure 2 is a schematic diagram of the main process of an automated testing method according to a reference embodiment of the present invention;
[0048] Figure 3 is a schematic diagram of main modules of an automated testing device according to an embodiment of the present invention;
[0049] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0050] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0052] The existing interface-based automated test design methods are generally based on process-oriented design, which splits the overall business functions according to business processes. Each time the automated test is executed, from the beginning to the end of a process, the intermediate process nodes are executed in sequence, and then the next process is executed until all processes are executed. Taking the order system in an enterprise's internal production system as an example, different processes include different process nodes, as shown in Table 1, and each process node in each process is executed in sequence.
[0053] Table 1
[0054] Order Type Process node name Process node name Process node name Process node name 1 A B D 2 A B C 3 B C 4 B C D
[0055] Among them, the order type can be fresh food order, department store order, virtual product order, etc., and the process node name can be locating the receiving point, picking, reviewing, packing, etc.
[0056] In the prior art, the corresponding process and process nodes are determined according to the different order types, and the corresponding automated test cases are written. When executing, the data and cases of the same order type are combined together for execution. For example, for a certain type of order, the automated tester will determine the corresponding process according to the type of order, further determine the interface involved in the corresponding process node, sort out the corresponding data required for the type of order while establishing the interface, and finally write the case. After the process can run normally, the automation of other types of order processes will be carried out until all processes are executed.
[0057] It can be seen that the prior art has the following problems:
[0058] 1) Data in the same row and between different process nodes are shared. For example, the order ID and output data of process node A will be used as input data of process node B. That is, there is code coupling and data coupling in the test cases between different columns in the same row. Due to the large coupling, when adding and modifying automated test cases, many process nodes will be involved, which will cause defects in the automated test code.
[0059] 2) Different business processes cannot be tested in parallel, which greatly reduces the efficiency of automated testing. There is a large reliance on data, and automated testing is usually performed on relatively fixed data (for example, the relevant data for generating documents uses known basic data), which also leads to low test coverage. Each process needs to be considered one by one, and some niche processes or data from special sources will not be automated, resulting in low test coverage.
[0060] 3) The automated test case writers need to understand the entire process of the system being tested before they can design the automated test cases, which makes it inconvenient to split the automated test case design.
[0061] Figure 1 FIG. 1 is a schematic diagram of the main process of the automated testing method according to an embodiment of the present invention. Figure 1 As shown, as an embodiment of the present invention, the automated testing method may include:
[0062] Step 101, write the automation test cases corresponding to each process node according to the operation concerns involved in each process node.
[0063] In the embodiment of the present invention, the operation focus point represents the operation process from the query window to the processing window involved in the process node. The processing window may include multiple processing sub-windows or only one processing window, which is not limited in the embodiment of the present invention.
[0064] For example, taking the order system as an example, a certain process node needs to query and obtain the order ID to be processed based on the order ID and the query conditions of the process node (such as using different order types as query conditions). Therefore, it will enter the order processing window from the order query window, and modify the order status and order data corresponding to the order ID to be processed through the interface operation of the order processing window to complete the operation of the process node. This series of related operations is an operation focus. Generally speaking, the order ID displayed in the query window is the output result of the previous process node, and the order ID to be processed obtained by filtering the query conditions is displayed in the processing window, so that the interface operation corresponding to the process node is performed on these orders to be processed to obtain the output result of the process node.
[0065] In the embodiment of the present invention, the automated test case corresponding to each operation concern is used as an independent application. Therefore, the automated test case writing method of the embodiment of the present invention is different from the general traditional automated test case method. In the embodiment of the present invention, an automated test case only processes one operation concern, and an automated test case is an application that can be deployed and started.
[0066] The automation testers implement the automation test cases corresponding to the operation focus points, that is, they design the automation interface and verify the corresponding interface and background data for the operation focus points. Therefore, the automation testers do not need to understand the entire process of the system being tested. As long as they understand a certain process node, they can write the automation test cases corresponding to the process node.
[0067] Optionally, the generalized use case process of the embodiment of the present invention is as follows:
[0068] The automated test case searches for the first piece of data that meets the conditions through the query interface, enters the processing interface, and performs corresponding interface operations. After the operation is completed, it continues to search for the next piece of data that meets the conditions in the query interface until there is no data that meets the conditions within the preset time, and then exits the automated test case.
[0069] The automated test case will process the corresponding data according to the operability of the interface elements in the processing interface, check the status of the corresponding background data, and use the checkpoint to determine whether the test passes. If it fails, the processing of this data will be terminated.
[0070] If there is failed data during the execution process, that is, data that does not pass the test, the unique identifier of the data is written into the local log file of the execution machine. At the same time, a subdirectory is created with the unique identifier of the data to save the screenshots of the data in this operation, the checkpoints in the process of the automated test case executing the data, the log context of the system under test during the operation time period, the log information of the automated test script itself, etc., to facilitate the location of the problem afterwards. It should be pointed out that when querying the data in the interface again, the failed data will no longer be obtained, that is, the data is only used once and not reused.
[0071] Step 102: Obtain historical data and basic data, write the historical data and basic data into a test environment database, and restart the system to be tested.
[0072] The historical data may be historical order data, which is generally data from a period of time in the past, such as order data from the past month; the basic data may be all commodity data, which usually does not change. Both the historical data and the basic data are written into the test environment database, usually by placing the historical data and the basic data in different data tables, such as a historical test data table and a basic data table.
[0073] This step is the preparation stage of test data. In this step, the desensitized historical data and basic data are obtained from the online production environment to ensure that the data in the test environment is consistent with the online environment. The historical test data table in the test environment database is cleared, and the historical data obtained from the online production environment is written into the cleared historical data table. Since the basic data usually does not change much, it does not need to be cleared. Instead, the basic data obtained from the online production environment is updated to the corresponding basic data table by the test deployment program. When a new field is added to the table structure, there will also be a record value corresponding to the new field, so that the basic data in the online environment is synchronized to the basic data table. Then restart the corresponding one or more systems to be tested to make the new data (historical data and basic data) effective. The purpose of this is that when the table structure of the database changes, in order to allow the system under test to read and write the new table structure normally, the application needs to be restarted to make the new data effective. Finally, using the data conversion program, according to the business needs of the system under test, the historical data is converted into a brand new data state after initialization, and the historical data is used as the test input data of the first operation focus (i.e., the first test case application). The historical data can be associated with the basic data so that the detailed data related to the historical data can be found through the basic data.
[0074] The order data of order type 1, order type 2, order type 3, and order type 4 in the existing solution are generated by testers through automated test cases, while the order data of order type 1, order type 2, order type 3, and order type 4 in the embodiment of the present invention are generated from online historical data, making the test results more reliable and trustworthy. It should be pointed out that there are multiple order data under each order type.
[0075] Step 103: Start and execute the automated test case.
[0076] This step is the execution phase of the test case. When all the data is written to the database, the automated scheduling system is notified. The automated scheduling system splits the test execution machine according to the automated test case, and synchronizes the necessary basic information of the test environment, such as the relevant running configuration information, to the execution machine. A test case application corresponding to the automated test case is deployed on each execution machine to complete the deployment of the execution machine environment. Then the test case application on the corresponding execution machine is started, and the execution machine starts to execute the automated test case.
[0077] It should be pointed out that after the system under test is started, the automated test is triggered, and the automated scheduling system starts the test case application to be automated tested. After the test case application is started, it queries the system under test for historical data and executes the corresponding functions corresponding to the automated test case design phase. Different operation focus points are run by different test execution machines to achieve the purpose of parallel testing. In an embodiment of the present invention, different test case applications can run in parallel, that is, different process nodes can run in parallel together, and the test data under the same process node is performed serially. Therefore, in an embodiment of the present invention, each process node runs on a test execution machine, and parallel operation can be achieved.
[0078] The automated test case searches for the first piece of data that meets the conditions through the query interface, enters the processing interface, and performs the corresponding interface operation. After the operation is completed, it continues to search for the next piece of data that meets the conditions in the query interface until there is no data that meets the conditions within the preset time, and then exits the automated test case. When the test case application ends the test, the test case application notifies the automated scheduling system, and the automated scheduling system can continue to work and continue to complete the work of result collection, comparison, etc.
[0079] In the process of executing the test case, the automated test case will process the corresponding data according to the operability of the interface elements in the processing interface, check the status of the corresponding background data, and use the checkpoint to determine whether the test passes. If it fails, the processing of this data will be terminated. If there is failed data during the execution process, that is, data that does not pass the test, the unique identifier of the data is written into the local log file of the execution machine. At the same time, a subdirectory is established with the unique identifier of the data, which stores the screenshots of the data in this operation, the checkpoints during the execution of the data by the automated case, the log context of the system under test during the operation time period, the log information of the automated test script itself, etc., as the execution result of the automated test case, so as to facilitate the location of the problem afterwards.
[0080] In yet another embodiment of the present invention, after step 103, the method may further include: collecting statistical results of the test environment database and execution results of automated test cases.
[0081] Taking the order system as an example, the statistical results of the test environment database include the ratio of the number of orders that succeeded the test to the number of orders that failed the test in different order types, the data content of the orders that failed the test, and the process node where the orders that failed the test failed. The execution results of the automated test case include the unique identifier of the test failure data written into the local log file of the execution machine, as well as the process screenshots, checkpoints, log context of the system under test, and log information of the automated test script itself saved in the subdirectory.
[0082] This step is the statistical stage of the test results. This step is used to verify the input data that passed the final test and to count the status of each piece of data in the test environment database. If all the test cases corresponding to each process node are completed, that is, the test is successful, the status of the data in the test environment database is changed to completed. If there is data that failed the test, the failed test data will stay in the status of a certain process node and will no longer continue to execute (there will be a stay status of the data that failed the test in the database, and you only need to query this status when doing statistics). At the same time, collect the failed data information on the execution machine corresponding to the process node.
[0083] Finally, the test statistics interface of the automated scheduling system displays the percentage of test data in different states and detailed data, which is convenient for developers and testers to locate problems. At the same time, the operational concerns for which automated testing has not been implemented can also be reflected, which can measure the workload of automated testing to a certain extent. The statistical results are similar to the monitoring and statistical methods of online order data. They simulate the operation methods of the production links for automated testing and use online historical data as test data, which is convincing.
[0084] The status of the test data refers to the process nodes where the completed and failed data are located, etc. The detailed data refers to the specific order content corresponding to a certain order identifier and the related content of the order. The related content can be obtained by associating the basic data.
[0085] Taking the various processes and corresponding process nodes shown in Table 1 as an example, in the technical solution of the present invention, the use case relationship is as follows:
[0086] Test case application A queries the available order data that meets the conditions, namely order type 1 and order type 2, and processes the data of order type 1 and order type 2 one by one.
[0087] Test case application B queries the available order data that meets the conditions, namely order type 1, order type 2, order type 3 and order type 4, and processes the data of order type 1, order type 2, order type 3 and order type 4 one by one.
[0088] Test case application C queries the available order data that meets the conditions, namely order type 2, order type 3 and order type 4, and processes the data of order type 2, order type 3 and order type 4 one by one.
[0089] Test case application D queries the available order data that meets the conditions, namely order type 1 and order type 4, and processes the data of order type 1 and order type 4 one by one.
[0090] It should be noted that, in this embodiment, the historical order data of order type 1 and order type 2 are used as the test input data of test case application A, the test output data of test case application A are used as the test input data of test case application B, and the historical order data of order type 3 and order type 4 are also used as the test input data of test case application B. The same is true for test case application C and test case application D, which will not be described in detail.
[0091] For example, when test case application A has problems processing the data of order type 2 (that is, the test fails), test case application B will not query the order data of order type 2, and the final data will remain in test case application A. Test case application B will not query the order type 2 that meets the conditions. When the test results are counted, the order data of order type 2 that remains in test case application A will be displayed as order data that failed to execute.
[0092] It can be seen from this that the prior art is executed in a row-first, column-later manner, while the technical solution of the present invention is executed in a column-first, row-later manner. In the technical solution of the present invention, order data is obtained from the query window of the first process node. If the data cannot be obtained in the query window, it means that an exception occurs before the first node, which is convenient for relevant personnel to locate the problem. Moreover, if a new order data type is added, it is still applicable to the execution of existing test cases, and the automated testers do not need to modify the code; if a new order data operation focus is added, it is only necessary to write an automated case for the operation focus, without modifying other existing automated test case codes. Therefore, the method provided by the present invention is very suitable for horizontal and vertical expansion, and is also very suitable for automated test design of production systems within an enterprise.
[0093] According to the various embodiments described above, it can be seen that the present invention adopts the technical solution of writing the automated test cases corresponding to each process node according to the operation concerns involved in each process node, which solves the problem of large coupling between process nodes and low efficiency of automated testing. That is to say, in the prior art, due to the large coupling, when adding and modifying automated test cases, many process nodes will be involved, which will cause defects in automated test code; different business processes cannot be tested in parallel, which greatly reduces the efficiency of automated testing. However, the present invention is to write the automated test cases corresponding to each process node according to the operation concerns involved in each process node, reduce the coupling and correlation between automated test cases, if a new operation concern is added, it is only necessary to write the automated test cases for the operation concern, without modifying other existing automated test case codes; in the way of first column and then row, each business process can be tested in parallel, which significantly improves the efficiency of automated testing. Moreover, the embodiment of the present invention can also improve the test coverage of automated testing, reduce the proficiency requirements of automated testers for business processes, facilitate task decomposition, and organize automated testing in the form of a team.
[0094] Figure 2 : is a schematic diagram of the main process of an automated testing method according to a reference embodiment of the present invention, and the automated testing method may include:
[0095] Step 1: Obtain historical data and basic data, and write the historical data and basic data into the test environment database;
[0096] Step 2: Restart the system to be tested;
[0097] Step 3: The system under test triggers automated testing;
[0098] Step 4: The automated scheduling system splits the test execution machine according to the test case;
[0099] Step 5: Deploy the execution machine environment of the automated scheduling system;
[0100] Step 6: Start the test case application deployed on the execution machine;
[0101] Step 7: Execute the test case application;
[0102] Step 8: The test case is applied to the system under test to query historical data;
[0103] Step 9: If the test fails, collect the log context of the system under test and write the failure data information to the local execution machine;
[0104] Step 10: Continue to process the next piece of data;
[0105] Step 11: After processing all the queried data, the test case application exits and the test ends;
[0106] Step 12: The automated scheduling system collects statistical results of the test environment database and execution results of automated test cases;
[0107] Step 13: The automated scheduling system displays the test results on the test statistics interface.
[0108] In addition, the specific implementation content of the automated testing method in a reference embodiment of the present invention has been described in detail in the automated testing method described above, so the repeated content will not be described here.
[0109] Figure 3 Schematic diagram of the main modules of the automated testing device according to an embodiment of the present invention. Figure 3 As shown, the automated testing device 300 includes a use case module 301, a writing module 302 and a testing module 303. The use case module 301 writes the automated test cases corresponding to each process node according to the operation focus points involved in each process node; wherein the operation focus points represent the operation process from the query window to the processing window involved in the process node; the writing module 302 obtains historical data and basic data, writes the historical data and basic data into the test environment database, and restarts the system to be tested; the testing module 303 starts and executes the automated test cases.
[0110] Optionally, writing the historical data and basic data into the test environment database includes:
[0111] Clear the historical test data table in the test environment database, and write the historical data into the historical test data table;
[0112] The basic data is synchronized to the basic data table in the test environment database.
[0113] Optionally, the test module 303 splits the test execution machine according to the automated test case; deploys the execution machine environment, and deploys a test case application corresponding to the automated test case on each execution machine; starts the test case application deployed on the execution machine, and the execution machine starts to execute the automated test case.
[0114] Optionally, if there is data that fails the test during the execution of the automated test case, the test module 303 writes the unique identifier of the data into the local log file of the execution machine, and creates a subdirectory with the unique identifier of the data to save screenshots of the data during the current operation, checkpoints during the execution of the data by the automated test case, the log context of the system under test within the operation time period, and the log information of the automated test script itself as failed data information; and saves the pause status of the data in the test environment database.
[0115] Optionally, a result module is also included, which collects statistical results of the test environment database and execution results of automated test cases.
[0116] Optionally, the statistical result includes the percentage of the quantity of test data in different states and detailed data, and the execution result includes failure data information stored on each execution machine.
[0117] According to the various embodiments described above, it can be seen that the present invention adopts the technical solution of writing the automated test cases corresponding to each process node according to the operation concerns involved in each process node, which solves the problem of large coupling between process nodes and low efficiency of automated testing. That is to say, in the prior art, due to the large coupling, when adding and modifying automated test cases, many process nodes will be involved, which will cause defects in automated test code; different business processes cannot be tested in parallel, which greatly reduces the efficiency of automated testing. However, the present invention is to write the automated test cases corresponding to each process node according to the operation concerns involved in each process node, reduce the coupling and correlation between automated test cases, if a new operation concern is added, it is only necessary to write the automated test cases for the operation concern, without modifying other existing automated test case codes; in the way of first column and then row, each business process can be tested in parallel, which significantly improves the efficiency of automated testing. Moreover, the embodiment of the present invention can also improve the test coverage of automated testing, reduce the proficiency requirements of automated testers for business processes, facilitate task decomposition, and organize automated testing in the form of a team.
[0118] It should be noted that the specific implementation content of the automated testing device of the present invention has been described in detail in the automated testing method described above, so the repeated content will not be described again here.
[0119] Figure 4 An exemplary system architecture 400 is shown to which the automated testing method or automated testing method according to an embodiment of the present invention can be applied.
[0120] like Figure 4As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0121] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0122] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0123] The server 405 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0124] It should be noted that the automated testing method provided in the embodiment of the present invention is generally executed on the server 405, and accordingly, the automated testing device is generally set in the server 405. The automated testing method provided in the embodiment of the present invention can also be executed on the terminal devices 401, 402, and 403, and accordingly, the automated testing device is generally set on the terminal devices 401, 402, and 403.
[0125] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0126] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0127] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0128] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0129] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0130] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0131] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0132] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as follows: a processor includes a use case module, a write module, and a test module, wherein the names of these modules do not constitute a limitation on the modules themselves in some cases.
[0133] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: writing the automated test cases corresponding to each process node according to the operation focus points involved in each process node; wherein the operation focus points represent the operation process from the query window to the processing window involved in the process node; obtaining historical data and basic data, writing the historical data and basic data into the test environment database, restarting the system to be tested; starting and executing the automated test cases.
[0134] According to the technical solution of the embodiment of the present invention, because the technical means of writing the automated test cases corresponding to each process node respectively according to the operational concerns involved in each process node is adopted, the technical problems of large coupling between process nodes and low efficiency of automated testing are overcome; the present invention writes the automated test cases corresponding to each process node respectively according to the operational concerns involved in each process node, reduces the coupling and correlation between automated test cases, and if a new operational concern is added, it is only necessary to write automated test cases for the operational concern without modifying other existing automated test case codes; by executing in a column-first-row-later manner, each business process can be tested in parallel, which significantly improves the efficiency of automated testing. Moreover, the embodiment of the present invention can also improve the test coverage of automated testing, reduce the proficiency requirements of automated testers for business processes, facilitate task decomposition, and organize automated testing in a team form.
[0135] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An automated testing method, characterized in that: include: According to the operational concerns involved in each process node, write the automated test cases corresponding to each process node respectively; wherein the operational concerns represent the operational process from the query window to the processing window involved in the process node; Obtain historical data and basic data, write the historical data and basic data into the test environment database, and restart the system to be tested; Start and execute the automated test case; Start and execute the automated test cases, including: Split the test execution machine according to the automated test cases; Deploy the execution machine environment and deploy a test case application corresponding to the automated test case on each execution machine; The test case application deployed on the execution machine is started, and the execution machine starts to execute the automated test case; wherein different process nodes are run in parallel, and the test data under the same process node is executed serially; If there is data that fails the test during the execution of the automated test case, the unique identifier of the data will be written into the local log file of the execution machine, and a subdirectory will be created with the unique identifier of the data to save screenshots of the data during this operation, checkpoints during the execution of the data by the automated test case, the log context of the system under test during the operation time period, and the log information of the automated test script itself as failed data information; and the pause status of the data will be saved in the test environment database.
2. The method according to claim 1, characterized in that Writing the historical data and basic data into the test environment database includes: Clear the historical test data table in the test environment database, and write the historical data into the historical test data table; The basic data is synchronized to the basic data table in the test environment database.
3. The method according to claim 1, characterized in that Also includes: Collect statistical results of the test environment database and the execution results of automated test cases.
4. The method according to claim 3, characterized in that The statistical results include the quantity ratio and detailed data of the test data in different states, and the execution results include the failure data information stored on each execution machine.
5. An automated testing device, characterized in that: include: A use case module is used to write an automated test case corresponding to each process node according to the operation focus involved in each process node; wherein the operation focus represents the operation process from the query window to the processing window involved in the process node; A writing module is used to obtain historical data and basic data, write the historical data and basic data into the test environment database, and restart the system to be tested; A test module, used to start and execute the automated test cases; The test module is used to: Split the test execution machine according to the automated test cases; Deploy the execution machine environment and deploy a test case application corresponding to the automated test case on each execution machine; The test case application deployed on the execution machine is started, and the execution machine starts to execute the automated test case; wherein different process nodes are run in parallel, and the test data under the same process node is executed serially; The test module is also used to: If there is data that fails the test during the execution of the automated test case, the unique identifier of the data will be written into the local log file of the execution machine, and a subdirectory will be created with the unique identifier of the data to save screenshots of the data during this operation, checkpoints during the execution of the data by the automated test case, the log context of the system under test during the operation time period, and the log information of the automated test script itself as failed data information; and the pause status of the data will be saved in the test environment database.
6. The device according to claim 5, characterized in that Writing the historical data and basic data into the test environment database includes: Clear the historical test data table in the test environment database, and write the historical data into the historical test data table; The basic data is synchronized to the basic data table in the test environment database.
7. The device according to claim 5, characterized in that Also includes: The result module is used to collect the statistical results of the test environment database and the execution results of the automated test cases.
8. The device according to claim 7, characterized in that The statistical results include the quantity ratio and detailed data of the test data in different states, and the execution results include the failure data information stored on each execution machine.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
