Regression testing methods, apparatus, equipment and storage media
By acquiring real customer requests from the production environment during regression testing, processing them sequentially in parallel, and combining database comparison with manual judgment, the problem of existing regression testing being unable to determine the correctness of business operations is solved. This enables accurate judgment of both the system environment and business operations simultaneously, improving the accuracy and efficiency of testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNDSUN TECH
- Filing Date
- 2022-08-03
- Publication Date
- 2026-07-17
AI Technical Summary
Existing regression testing methods cannot effectively determine the correctness of business systems, and the test case data used is missing or not realistic enough, resulting in inaccurate test results. In particular, the timing is inconsistent during high-concurrency testing, making it impossible to effectively detect the correctness of the system environment and business.
By acquiring real customer requests from the business system in the production environment, processing them sequentially and in parallel, and comparing the processing results with both the production and release environments, the system environment and business processes can be judged simultaneously.
It improves the accuracy of regression testing, ensures the authenticity and efficiency of regression test results, and can simultaneously determine the correctness of the system environment and business, thereby enhancing the accuracy of testing.
Smart Images

Figure CN115292175B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a regression testing method, apparatus, device, and storage medium. Background Technology
[0002] With the full development of microservice systems, the design of distributed systems is becoming increasingly complex and diverse, resulting in increasingly large production systems with more and more functions or services.
[0003] Currently, testing is often used to ensure the reliability of system upgrades or modifications. Among these tests, regression coverage testing is a necessary step in system testing, and it can prevent any impact on the existing functions of the system.
[0004] However, the regression tests mentioned above can only test whether there are problems with the system environment, and cannot test the correctness of the business logic. Summary of the Invention
[0005] In view of this, embodiments of this application provide a regression testing method, apparatus, device, and storage medium for performing regression testing on the release environment of a business system.
[0006] In a first aspect, embodiments of this application provide a regression testing method, including:
[0007] Retrieve multiple customer requests from the business system in the production environment;
[0008] Sort the multiple customer requests;
[0009] Using the production environment, multiple sorted customer requests are processed sequentially to obtain multiple first processing results in the production environment;
[0010] Using the pre-release environment of the business system, the sorted customer requests are processed sequentially to obtain multiple second processing results in the pre-release environment;
[0011] Based on the multiple first processing results and the multiple second processing results, regression testing is performed on the environment to be released to obtain the regression test results of the environment to be released.
[0012] In an optional implementation, the step of performing regression testing on the environment to be released based on the plurality of first processing results and the plurality of second processing results to obtain the regression test results of the environment to be released includes:
[0013] If the first processing result of the same customer request in the plurality of first processing results is the same as the second processing result of the same customer request in the plurality of second processing results, then the regression test result is obtained by comparing the first database of the production environment and the second database of the environment to be released.
[0014] The first database is used to store operation data corresponding to the multiple customer requests in the production environment, and the second database is used to store operation data corresponding to the multiple customer requests in the release environment.
[0015] In an optional implementation, before processing the sorted customer requests sequentially in the production environment to obtain multiple first processing results in the production environment, the method further includes:
[0016] The data content of the first database is backed up to obtain the second database;
[0017] The regression test results are obtained by comparing the first database in the production environment and the second database in the release environment, including:
[0018] If the data content in the first database is the same as the data content in the second database, then the regression test result is determined to be a passed test.
[0019] If the data content in the first database is different from the data content in the second database, then the regression test result is determined to be a failed test.
[0020] In an optional implementation, the step of performing regression testing on the environment to be released based on the plurality of first processing results and the plurality of second processing results to obtain the regression test results of the environment to be released further includes:
[0021] If among the multiple customer requests there is a target customer request whose first processing result and second processing result are different, a judgment prompt will be pushed to prompt the input of judgment information on whether the target customer request is a customer request that can be ignored;
[0022] The regression test results are obtained based on the input judgment information regarding the target customer's request.
[0023] In an optional implementation, obtaining the regression test result based on the input judgment information regarding the target customer's request includes:
[0024] If the judgment information indicates that the target customer request is the negligible customer request, then the production environment is used to process other customer requests after the target customer request to obtain a first processing result of the other customer requests, and the environment to be released is used to process the other customer requests to obtain a second processing result of the other customer requests.
[0025] The regression test results are obtained based on the first processing result and the second processing result of the other customer requests.
[0026] In an optional implementation, obtaining the regression test result based on the input judgment information regarding the target customer's request further includes:
[0027] If the judgment information indicates that the target customer request is a non-negligible customer request, then the processing of the other customer requests is stopped, and the regression test result is determined to be a test failure.
[0028] In an optional implementation, prior to obtaining multiple customer requests from the business system in a production environment, the method further includes:
[0029] Obtain the full-link logs of the production environment, wherein the full-link logs are the logs corresponding to the multiple client requests;
[0030] The acquisition of multiple customer requests from the business system in the production environment includes:
[0031] The multiple client requests are obtained based on the full-link logs.
[0032] Secondly, embodiments of this application also provide a regression testing apparatus, comprising:
[0033] The acquisition module is used to acquire multiple customer requests from the business system in the production environment;
[0034] A sorting module is used to sort the multiple customer requests;
[0035] The processing module is used to process multiple sorted customer requests sequentially in the production environment to obtain multiple first processing results in the production environment.
[0036] The processing module is further configured to use the pre-release environment of the business system to process the sorted multiple customer requests sequentially to obtain multiple second processing results in the pre-release environment;
[0037] The testing module is used to perform regression testing on the environment to be released based on the plurality of first processing results and the plurality of second processing results, and to obtain the regression test results of the environment to be released.
[0038] In an optional implementation, the test module is specifically used for:
[0039] If the first processing result of the same customer request in the plurality of first processing results is the same as the second processing result of the same customer request in the plurality of second processing results, then the regression test result is obtained by comparing the first database of the production environment and the second database of the environment to be released.
[0040] The first database is used to store operation data corresponding to the multiple customer requests in the production environment, and the second database is used to store operation data corresponding to the multiple customer requests in the release environment.
[0041] In an optional implementation, the apparatus further includes:
[0042] The backup module is used to back up the data content of the first database to obtain the second database;
[0043] The test module is specifically used for:
[0044] If the data content in the first database is the same as the data content in the second database, then the regression test result is determined to be a passed test.
[0045] If the data content in the first database is different from the data content in the second database, then the regression test result is determined to be a failed test.
[0046] In an optional implementation, the test module is specifically used for:
[0047] If among the multiple customer requests there is a target customer request whose first processing result and second processing result are different, a judgment prompt will be pushed to prompt the input of judgment information on whether the target customer request is a customer request that can be ignored;
[0048] The regression test results are obtained based on the input judgment information regarding the target customer's request.
[0049] In an optional implementation, the test module is specifically used for:
[0050] If the judgment information indicates that the target customer request is the negligible customer request, then the production environment is used to process other customer requests after the target customer request to obtain a first processing result of the other customer requests, and the environment to be released is used to process the other customer requests to obtain a second processing result of the other customer requests.
[0051] The regression test results are obtained based on the first processing result and the second processing result of the other customer requests.
[0052] In an optional implementation, the test module is specifically used for:
[0053] If the judgment information indicates that the target customer request is a non-negligible customer request, then the processing of the other customer requests is stopped, and the regression test result is determined to be a test failure.
[0054] In an optional implementation, the acquisition module is further configured to:
[0055] Obtain the full-link logs of the production environment, wherein the full-link logs are the logs corresponding to the multiple client requests;
[0056] The acquisition module is specifically used for:
[0057] The multiple client requests are obtained based on the full-link logs.
[0058] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the regression testing method described in any one of the first aspects.
[0059] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the regression testing method described in any of the first aspects.
[0060] This application provides a regression testing method, apparatus, device, and storage medium. The method includes: acquiring multiple customer requests from a business system in a production environment; sorting the customer requests; processing the sorted customer requests sequentially in the production environment to obtain multiple first processing results in the production environment; processing the sorted customer requests sequentially in the business system's release environment to obtain multiple second processing results in the release environment; and performing regression testing on the release environment based on the first and second processing results to obtain regression test results for the release environment. By collecting customer requests from a real production environment, processing the customer requests sequentially and in parallel in both the production and release environments, and comparing the processing results, regression test results are obtained. This allows for simultaneous assessment of the correctness of both the system environment and the business logic, improving the accuracy of regression testing.
[0061] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0062] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0063] Figure 1 A flowchart illustrating the regression testing method provided in the embodiments of this application. Figure 1 ;
[0064] Figure 2 A flowchart illustrating the regression testing method provided in the embodiments of this application. Figure 2 ;
[0065] Figure 3 A flowchart illustrating the regression testing method provided in the embodiments of this application. Figure 3 ;
[0066] Figure 4 A flowchart illustrating the regression testing method provided in the embodiments of this application. Figure 4 ;
[0067] Figure 5 A flowchart illustrating the regression testing method provided in the embodiments of this application. Figure 5 ;
[0068] Figure 6 A schematic diagram of the architecture of the regression testing method provided in the embodiments of this application;
[0069] Figure 7 A schematic diagram illustrating a specific regression testing method provided in an embodiment of this application;
[0070] Figure 8 This is a schematic diagram of the structure of the regression testing device provided in the embodiments of this application;
[0071] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0072] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0073] In the financial industry, including securities and futures, the richness of innovative businesses has developed rapidly due to the influence of the Internet and users. Systems can be rapidly expanded through distributed features to support business and transaction volume. System stability is particularly important. Currently, testing is used to ensure the reliability of system upgrades or modifications. Among these tests, regression coverage testing is a necessary step for the system to avoid impacting existing functions.
[0074] However, the test case data currently used in regression testing is either incomplete or not realistic enough. Furthermore, most regression tests are used to detect obvious problems in the system environment, such as whether there are error logs. They mainly test and verify the system program and cannot check the correctness of the business logic. In addition, if real data generated by the production environment of the business system is used for regression testing, the test results may be different due to the high concurrency of the data and inconsistent timing, so the correctness of the business logic cannot be determined. If serial testing is performed, the results are correct but the efficiency is low.
[0075] To address the aforementioned issues, this application provides a regression testing method that replays customer requests from a real production environment. It processes customer requests sequentially and in parallel within both the production and release environments, resolving the problems of existing technologies that lack real-world data testing, data timing, and sequential testing. By comparing the processing results, regression test results are obtained. This method combines system environment and business logic for regression testing, enabling simultaneous assessment of both system environment and business correctness, thus improving the accuracy of regression testing. The regression test case data coverage more closely aligns with user needs, and the parallel processing mechanism across multiple environments significantly improves efficiency.
[0076] The regression testing method provided in this application will be described below with reference to several specific embodiments.
[0077] Figure 1 A flowchart illustrating the regression testing method provided in the embodiments of this application. Figure 1In this embodiment, the executing entity can be an electronic device, such as a server, terminal device, or other device with data processing capabilities.
[0078] like Figure 1 As shown, the method includes:
[0079] S101. Obtain multiple customer requests from the business system in the production environment.
[0080] The business system can be, for example, a financial business system. The production environment is the system environment in which the business system provides services to the outside world and users use the production version of the system. Multiple customer requests in the production environment are multiple customer requests that access the business system in the production environment, such as entrustment requests, wealth management requests, etc. These multiple customer requests can be customer requests within a preset historical time period, which can be the time period from Monday to Friday.
[0081] S102. Sort multiple customer requests.
[0082] The system obtains multiple customer requests from the business system in the production environment, sorts these requests, and assigns each request a unique sequence number.
[0083] In some embodiments, multiple customer requests can be sorted according to their access time. The earlier the access time, the higher the ranking and the smaller the sequence number; the later the access time, the lower the ranking and the larger the sequence number. For example, customer requests on Monday are ranked earlier and have smaller sequence numbers, while customer requests on Tuesday are ranked later and have larger sequence numbers. This allows regression testing to be performed according to the actual time sequence of customer requests, improving the accuracy of regression testing.
[0084] S103. Using the production environment, process the sorted customer requests sequentially to obtain multiple first processing results in the production environment.
[0085] S104. Using the pending environment of the business system, process the sorted customer requests in sequence to obtain multiple second processing results in the pending environment.
[0086] The environment to be released for a business system can be the next version of the production environment of the business system, such as the environment for upgrading or testing a version. In other words, the environment to be released is the new version to be released, while the production environment is the old version.
[0087] In the production environment, multiple customer requests are processed sequentially according to their order, resulting in multiple first processing results in the production environment. Each first processing result corresponds to one customer request. In the pre-release environment of the business system, multiple customer requests are processed sequentially according to their order, resulting in multiple second processing results in the pre-release production environment. Each second processing result corresponds to one customer request.
[0088] That is, the production system and the system to be released of the business system are used to process the sorted customer requests in parallel, and multiple first processing results and multiple second processing results are obtained for the multiple customer requests. The first processing result can be the response result of the production environment to the customer request, such as successful delegation, and the second processing result can be the response result of the system to the customer request, such as successful delegation or failed delegation.
[0089] It should be noted that in step S103, the production environment can be switched to a temporary test environment first, and multiple customer requests can be processed in the temporary test environment. For example, the production environment can be switched to a temporary test environment from Saturday to Sunday.
[0090] S105. Based on multiple first processing results and multiple second processing results, perform regression testing on the environment to be released to obtain the regression test results of the environment to be released.
[0091] Based on multiple first processing results and multiple second processing results, regression testing is performed on the environment to be released. Each first processing result and each second processing result can be assigned a sequence number corresponding to a customer request. Therefore, the first processing results and second processing results with the same sequence number can be compared. If the first processing results and second processing results with the same sequence number are the same, the regression test result of the environment to be released is determined to be a pass. If the first processing results and second processing results with any of the same sequence number are different, the regression test result of the environment to be released is determined to be a fail. The multiple first processing results in the production environment are considered as standard results. Therefore, by comparing them with the first processing results, the correctness of the environment to be released and the business can be determined.
[0092] It should be noted that when comparing the first and second processing results of the same customer request, the status field in the first and second processing results can be compared. This status field can be used to indicate whether the delegation was successful or failed. That is, if both the first and second processing results of the same customer request contain this status field, then the first and second processing results of the same customer request are determined to be the same.
[0093] In the regression testing method of this embodiment, multiple customer requests from the business system in a production environment are acquired, sorted, and processed sequentially in the production environment to obtain multiple first processing results. Then, in the pre-release environment of the business system, the sorted customer requests are processed sequentially to obtain multiple second processing results. Based on the multiple first and second processing results, regression testing is performed on the pre-release environment to obtain the regression test results. In this application, customer requests from a real production environment are collected, and the customer requests are processed sequentially and in parallel in both the production and pre-release environments of the business system. By comparing the processing results, regression test results are obtained, thereby enabling simultaneous determination of the correctness of both the system environment and the business logic.
[0094] Figure 2 A flowchart illustrating the regression testing method provided in the embodiments of this application. Figure 2 ,like Figure 2 As shown, based on multiple first processing results and multiple second processing results, regression testing is performed on the environment to be released, yielding regression test results for the environment to be released, including:
[0095] S201. If the first processing result of the same customer request in multiple first processing results is the same as the second processing result of the same customer request in multiple second processing results, then the regression test results are obtained by comparing the first database in the production environment and the second database in the release environment.
[0096] Multiple customer requests are processed in the production environment to obtain multiple first processing results. Multiple customer requests are then processed in the release environment to obtain multiple second processing results. If the first processing result of the same customer request in the multiple first processing results is the same as the second processing result of the same customer request in the multiple second processing results, the first database in the production environment and the second database in the release environment are compared to obtain the regression test results of the release environment.
[0097] The first database is used to store operation data corresponding to multiple customer requests in the production environment, and the second database is used to store operation data corresponding to multiple customer requests in the release environment.
[0098] In a production environment, the operation data corresponding to multiple customer requests is the operation record of the production environment processing multiple customer requests. For example, if three customer requests are to entrust 100 requests, cancel 300 requests, and entrust 100 requests, the operation data generated by the production environment processing these three customer requests can be stored in the data table of the first database. That is, the data table records the three operation records of entrusting 100 requests, canceling 300 requests, and entrusting 100 requests.
[0099] Similarly, the operation data corresponding to multiple customer requests in the pending environment is the operation record of the background process of multiple customer requests in the pending environment. For example, if three customer requests are to entrust 100 requests, cancel 300 requests, and entrust 100 requests, then the pending environment processes these three customer requests, and the resulting operation data can be stored in the data table of the second database. That is, the data table records the three operation records of entrusting 100 requests, canceling 300 requests, and entrusting 100 requests.
[0100] In this embodiment, if the first processing result and the second processing result of the same customer request are the same, in order to avoid the second processing result of the release environment being the same as the first processing result of the production environment due to the failure of the release environment, the first database of the production environment and the second database of the release environment are further compared. If the data content of the first database is the same as the data content of the second database, it means that the regression test result of the release environment is a successful test.
[0101] S202. If among multiple customer requests there is a target customer request whose first processing result and second processing result are different, a judgment prompt will be pushed to prompt the input of judgment information on whether the target customer request is a customer request that can be ignored.
[0102] S203. Based on the input judgment information regarding the target customer's request, obtain the regression test results.
[0103] Multiple customer requests are processed in the production environment to obtain multiple first processing results. Multiple customer requests are also processed in the pre-release environment to obtain multiple second processing results. If, during the processing, there is a target customer request whose first processing result differs from the second processing result, a judgment prompt is pushed to ask for judgment information on whether the target customer request is an ignorable customer request. That is, the human judges whether the target customer request is an ignorable customer request. Among them, non-ignorable customer requests can be, for example, client requests that modify the data content in the database, such as delegated client requests. Ignoreable customer requests can be, for example, client requests that do not modify the data content in the database, such as password login requests.
[0104] Based on the push notification's judgment information, users can input judgment information regarding the target customer's request. Then, regression test results are obtained based on the input judgment information. For example, if the input judgment information is that the target customer's request is an ignorable customer request, it means that the inconsistency between the first and second processing results of the target customer's request can be ignored. In this case, the processing result of the target customer's request is not used to determine whether the regression test in the release environment passes. This is because during parallel processing, the login request to the production environment and the login request to the release environment may use different login passwords.
[0105] If the input judgment information indicates that the target customer request is a non-negligible customer request, it means that the regression test in the release environment has failed. For example, if the first processing result of the target customer request in the production environment is a delegation failure, and the second processing result of the target customer request in the release environment is a delegation success, it means that the regression test result in the release environment is a test failure.
[0106] In the regression testing method of this embodiment, if the first processing result of the same customer request in multiple first processing results is the same as the second processing result of the same customer request in multiple second processing results, the regression test result is obtained by comparing the first database in the production environment and the second database in the release environment. If there is a target customer request among multiple customer requests whose first and second processing results are different, a judgment prompt is pushed to ask for judgment information on whether the target customer request is an ignorable customer request. The regression test result is obtained based on the input judgment information for the target customer request. When the first and second processing results are the same, the regression test result is determined by database comparison; when the first and second processing results are different, manual intervention is used to determine the regression test result. This allows for simultaneous judgment of the correctness of the system environment and business, improving the accuracy of regression testing.
[0107] Figure 3 A flowchart illustrating the regression testing method provided in the embodiments of this application. Figure 3 ,like Figure 3 As shown, based on the input judgment information regarding the target customer's request, the regression test results are obtained, including:
[0108] S301. If the information indicates that the target customer request is a negligible customer request, then the production environment is used to process other customer requests after the target customer request to obtain the first processing result of other customer requests, and the release environment is used to process other customer requests to obtain the second processing result of other customer requests.
[0109] S302. Based on the first processing result of other customer requests and the second processing result of other customer requests, obtain the regression test results.
[0110] If the user-input judgment information indicates that the target customer request is an ignorable customer request, then the target customer request is ignored, and the production environment is used to process other customer requests following the target customer request to obtain the first processing result of the other customer requests. Then, the production environment is used to process the other customer requests to obtain the second processing result of the other customer requests. That is, during the processing, the first processing result and the second processing result of the same customer request are compared sequentially. If the first processing result and the second processing result of the target customer request are different, and the user determines that the target customer request is an ignorable customer request, then the processing of other customer requests following the target customer request continues.
[0111] Then, the first processing result of other customer requests and the second processing result of other customer requests are compared to obtain the regression test result. If the first processing result of other customer requests and the second processing result of other customer requests are the same, then step S201 can be referred to to compare the first database in the production environment and the second database in the release environment to obtain the regression test result. If the first processing result of other customer requests and the second processing result of other customer requests are different, then steps S202-S203 can be referred to to obtain the regression test result.
[0112] S303. If the information indicates that the target customer request is a non-negligible customer request, then stop processing other customer requests and determine that the regression test result is a test failure.
[0113] If the information indicates that the target customer request is a non-negligible customer request, then the regression test result is determined to be a test failure, and the processing of other customer requests after the target customer request is stopped. That is, the production environment and the release environment stop processing other customer requests.
[0114] In the regression testing method of this embodiment, if the judgment information indicates that the target customer request is a negligible customer request, then other customer requests following the target customer request are processed in the production environment to obtain a first processing result for the other customer requests. Then, the other customer requests are processed in the pre-release environment to obtain a second processing result for the other customer requests. Based on the first and second processing results of the other customer requests, the regression test result is obtained. If the judgment information indicates that the target customer request is a non-negligible customer request, then the processing of other customer requests is stopped, and the regression test result is determined to be a test failure. Manually determining whether to continue processing other customer requests improves the accuracy of regression testing, and stopping processing when it is determined not to process saves processing resources.
[0115] Figure 4 A flowchart illustrating the regression testing method provided in the embodiments of this application. Figure 4 ,like Figure 4 As shown, in a production environment, before processing multiple sorted customer requests sequentially to obtain multiple first processing results in the production environment, the method further includes:
[0116] S401. Back up the data in the first database to obtain the second database.
[0117] The first database stores data from the business system in the production environment. Before comparing the first and second databases, the data in the first database is backed up to obtain the second database. This ensures that multiple customer requests are processed under the same data baseline, thereby updating the first and second databases. The first database stores the operation data corresponding to multiple customer requests in the production environment, while the second database stores the operation data corresponding to multiple customer requests in the release environment.
[0118] Accordingly, by comparing the first database in the production environment with the second database in the release environment, regression test results are obtained, including:
[0119] S402. If the data content in the first database is the same as the data content in the second database, then the regression test result is determined to be a successful test.
[0120] S403. If the data content in the first database is different from the data content in the second database, then the regression test result is determined to be a failed test.
[0121] If the data content in the first database is the same as the data content in the second database, the regression test result for the deployment environment is determined to be a pass; if the data content in the first database is different from the data content in the second database, the regression test result for the deployment environment is determined to be a fail.
[0122] In the regression testing method of this embodiment, the data content of the first database is backed up to obtain the second database. If the data content of the first database is the same as that of the second database, the regression test result is determined to be a pass; if the data content of the first database is different from that of the second database, the regression test result is determined to be a fail. Data backup ensures database comparison under the same benchmark, improving the accuracy of database comparison and thus improving the accuracy of regression testing.
[0123] Figure 5 A flowchart illustrating the regression testing method provided in the embodiments of this application. Figure 5 ,like Figure 5 As shown, before obtaining multiple customer requests from the business system in the production environment, the method further includes:
[0124] S501, Obtain the full-link logs of the production environment.
[0125] Among them, the full-link logs are the logs corresponding to multiple customer requests. When a customer requests access the production environment of the business system, the backend can record the logs corresponding to the customer request.
[0126] Accordingly, multiple customer requests from the business system in the production environment are obtained, including:
[0127] S502. Based on the full-link logs, multiple customer requests are obtained.
[0128] If regression testing is required on the pre-release environment of the business system, the full-link logs of the production environment can be obtained. These full-link logs can be full-link logs for a preset historical time period. Then, the full-link logs can be assembled to obtain multiple customer requests.
[0129] In some embodiments, target logs that meet the custom filtering conditions can be determined from the end-to-end logs according to the custom filtering conditions, and then the target logs can be assembled to obtain multiple customer requests. The custom filtering conditions include, but are not limited to, date, business function number, business type, etc. Different business functions correspond to different business function numbers. For example, business functions may include fund business, bond business, and entrustment business. Business types may include cash type and wealth management type.
[0130] In other words, the entire chain log can be filtered based on date, business function number, and business type. Then, multiple customer requests are obtained by assembling the customized filtered logs, so that the obtained multiple customer requests are customer requests that meet the filtering conditions.
[0131] In the above Figures 1 to 5 Based on the embodiments, the following is combined with Figures 6-7 The embodiments illustrate the regression testing method provided in this application.
[0132] Figure 6 This is a schematic diagram of the architecture of the regression testing method provided in an embodiment of this application. This architecture can be implemented using electronic devices. Figure 6 As shown, the architecture includes:
[0133] Production environment: A distributed system environment where services are officially provided to the public and users are using the production version.
[0134] The production environment includes multiple services used to store operational data from the production environment into the production environment's database (i.e., the first database).
[0135] Log center system: It has collection service, preprocessing service and query service.
[0136] The system comprises three parts: a collection service for collecting system logs from the production environment (such as end-to-end logs, system error logs, and business record logs) and storing them in the log center system's database; a preprocessing service for preprocessing the end-to-end logs from the third database; and a query service for retrieving logs from the log center system's database. The log center system's database can be the first database.
[0137] Log replay service: This service retrieves end-to-end logs from the log center system. It can query logs using customized criteria such as date, business function number, and business type, and assembles the logs to generate multiple client requests, which are then sent to the message sequence number sorting service.
[0138] Message Sequence Number Sorting Service: This service sorts and saves multiple client requests sent by the log replay service, ensuring that each request is sent to the downstream synchronous call feedback service in a unique order. There are two synchronous call feedback services, one for the production environment and one for the deployment environment. Typically, each message is assigned a unique sequence number and sent to both synchronous call feedback modules using a reliable, one-to-many delivery method.
[0139] The synchronous call feedback module receives multiple client requests from the message sequence number sorting service, and synchronously processes these requests in both the production and release environments according to the order they were sent. It then sends the request queue number, the first processing result, and the second processing result to the request result comparison and termination module. During this process, the production environment can be switched to a temporary test environment.
[0140] Request Result Comparison and Abort Module: Compares the first and second processing results of the same request queue number, and feeds back the comparison result to the synchronous call feedback module. If the comparison results are inconsistent, the synchronous call feedback module stops execution and waits for troubleshooting.
[0141] Release environment: The environment in which the upgrade or test version is prepared. It is generally used to test the correctness of the business and may not be the same as the production environment.
[0142] The environment to be released has multiple services used to store operational data from the environment to be released into the database of the environment to be released.
[0143] Database (DB) comparison service: This refers to a service that can compare data tables in the first database of the production environment and the second database of the release environment. It allows for some personalized settings, such as ignoring certain fields based on manual screening.
[0144] Figure 7 This is a schematic diagram of a specific regression testing method provided in an embodiment of this application, as shown below. Figure 7As shown, the execution steps are as follows:
[0145] The first step is to back up the data in the first database of the production environment to obtain the second database for the release environment.
[0146] The second step is to prepare the production environment and the environment to be released.
[0147] The third step is to extract the full-link logs from the log center system.
[0148] Step 4: Filter the logs across the entire link using the log replay service based on custom filtering criteria.
[0149] Based on the filtered logs, identify the multiple client requests to be replayed (i.e., multiple client requests used for regression testing) and send them to the message sequence number sorting service.
[0150] Step 5: The message sequence number sorting service sorts multiple customer requests and assigns them a unified number.
[0151] Generally, the numbers are incremented and saved, and then forwarded reliably to the synchronous call feedback module in the production environment and the synchronous call feedback module in the release environment.
[0152] Step 6: The synchronous call feedback module of the production environment and the synchronous call feedback module of the release environment call the production environment and the release environment respectively to process multiple customer requests, and send the request queue number, the first processing result and the second processing result to the request result comparison and termination module.
[0153] Step 7: The request result comparison and abort module compares the first and second processing results for the same request queue number and feeds back the comparison result to the synchronous call feedback module. If they match, it determines whether the replay has ended (i.e., whether the regression test has ended). If it has not ended, it continues to step 6. Otherwise, the DB comparison service performs a data table comparison and then ends. If they do not match, the synchronous call feedback module aborts the work.
[0154] Step 8: If the inconsistency issue in Step 7 is confirmed by the user to be negligible, the request result comparison termination module will notify the synchronous call feedback module to continue Step 6; otherwise, the process ends.
[0155] The following is combined with Figure 8 The regression testing apparatus corresponding to the above method embodiments will be described.
[0156] Figure 8 This is a schematic diagram of the regression testing device provided in an embodiment of this application. This device can be integrated into an electronic device. Figure 8 As shown, the device includes:
[0157] The acquisition module 601 is used to acquire multiple customer requests from the business system in the production environment.
[0158] The sorting module 602 is used to sort multiple customer requests;
[0159] The processing module 603 is used to process multiple sorted customer requests sequentially in a production environment to obtain multiple first processing results in the production environment.
[0160] The processing module 603 is also used to process multiple sorted customer requests sequentially in the publishing environment of the business system to obtain multiple second processing results in the publishing environment.
[0161] Test module 604 is used to perform regression testing on the environment to be released based on multiple first processing results and multiple second processing results, and obtain the regression test results of the environment to be released.
[0162] In an optional implementation, test module 604 is specifically used for:
[0163] If the first processing result of the same customer request in multiple first processing results is the same as the second processing result of the same customer request in multiple second processing results, then the regression test results are obtained by comparing the first database in the production environment and the second database in the release environment.
[0164] The first database is used to store operation data corresponding to multiple customer requests in the production environment, and the second database is used to store operation data corresponding to multiple customer requests in the release environment.
[0165] In an optional embodiment, the device further includes:
[0166] Backup module 605 is used to back up the data content of the first database to obtain the second database;
[0167] Test module 604 is specifically used for:
[0168] If the data content in the first database is the same as the data content in the second database, then the regression test result is determined to be a successful test.
[0169] If the data content in the first database is different from the data content in the second database, then the regression test result is determined to be a failed test.
[0170] In an optional implementation, test module 604 is specifically used for:
[0171] If among multiple customer requests there is a target customer request with a different first processing result and a different second processing result, a judgment prompt will be pushed to ask for judgment information on whether the target customer request is a customer request that can be ignored.
[0172] The regression test results are obtained based on the input judgment information regarding the target customer's request.
[0173] In an optional implementation, test module 604 is specifically used for:
[0174] If the information indicates that the target customer request is a negligible customer request, then the production environment is used to process other customer requests following the target customer request to obtain the first processing result of other customer requests, and the release environment is used to process other customer requests to obtain the second processing result of other customer requests.
[0175] The regression test results are obtained based on the first processing results of other customer requests and the second processing results of other customer requests.
[0176] In an optional implementation, test module 604 is specifically used for:
[0177] If the information indicates that the target customer's request is a non-negligible customer request, then processing of other customer requests is stopped, and the regression test result is determined to be a test failure.
[0178] In an optional implementation, the acquisition module 601 is further configured to:
[0179] Obtain the full-chain logs of the production environment, which are logs corresponding to multiple client requests;
[0180] Module 601 is used specifically for:
[0181] Based on the end-to-end logs, multiple customer requests were obtained.
[0182] It should be noted that the acquisition module in this embodiment can be implemented through the above-mentioned log center system and log replay service, the sorting module can be implemented through the above-mentioned message sequence number sorting service, the processing module can be implemented through the above-mentioned synchronous call feedback module, and the testing module can be implemented through the above-mentioned DB comparison service and request result comparison abort module.
[0183] The implementation principle and process of the regression testing device in this embodiment can be found in the regression testing method described above, and will not be repeated here.
[0184] Figure 9 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 9As shown, the device includes a processor 701, a memory 702, and a bus 703. The memory 702 stores machine-readable instructions that can be executed by the processor 701. When the electronic device is running, the processor 701 communicates with the memory 702 through the bus 703. The processor 701 executes the machine-readable instructions to perform the regression testing method provided in the above method embodiment.
[0185] This application also provides a computer-readable storage medium storing a computer program, which is executed by a processor, and the processor executes the regression testing method provided in the above method embodiments.
[0186] In this embodiment, the computer program, when run by the processor, can also execute other machine-readable instructions to perform other methods as described in the embodiments. For details on the specific execution steps and principles, please refer to the description of the embodiments, which will not be repeated here.
[0187] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0188] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0189] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0190] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0191] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0192] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A regression testing method, characterized in that, include: Retrieve multiple customer requests from the business system in the production environment; Sort the multiple customer requests; Using the production environment, multiple sorted customer requests are processed sequentially to obtain multiple first processing results in the production environment; Using the pre-release environment of the business system, the sorted customer requests are processed sequentially to obtain multiple second processing results in the pre-release environment; Based on the plurality of first processing results and the plurality of second processing results, regression testing is performed on the environment to be released to obtain the regression test results of the environment to be released. The step of performing regression testing on the environment to be released based on the plurality of first processing results and the plurality of second processing results to obtain the regression test results of the environment to be released includes: If the first processing result of the same customer request in the plurality of first processing results is the same as the second processing result of the same customer request in the plurality of second processing results, then the regression test result is obtained by comparing the first database of the production environment and the second database of the environment to be released. The first database is used to store operation data corresponding to the multiple customer requests in the production environment, and the second database is used to store operation data corresponding to the multiple customer requests in the release environment.
2. The method according to claim 1, characterized in that, Before processing the sorted customer requests sequentially in the production environment to obtain multiple first processing results in the production environment, the method further includes: The data content of the first database is backed up to obtain the second database; The regression test results are obtained by comparing the first database in the production environment and the second database in the release environment, including: If the data content in the first database is the same as the data content in the second database, then the regression test result is determined to be a passed test. If the data content in the first database is different from the data content in the second database, then the regression test result is determined to be a failed test.
3. The method according to claim 1, characterized in that, The step of performing regression testing on the environment to be released based on the plurality of first processing results and the plurality of second processing results to obtain the regression test results of the environment to be released further includes: If among the multiple customer requests there is a target customer request whose first processing result and second processing result are different, a judgment prompt will be pushed to prompt the input of judgment information on whether the target customer request is a customer request that can be ignored; The regression test results are obtained based on the input judgment information regarding the target customer's request.
4. The method according to claim 3, characterized in that, The step of obtaining the regression test result based on the input judgment information regarding the target customer's request includes: If the judgment information indicates that the target customer request is the negligible customer request, then the production environment is used to process other customer requests after the target customer request to obtain a first processing result of the other customer requests, and the environment to be released is used to process the other customer requests to obtain a second processing result of the other customer requests. The regression test results are obtained based on the first processing result and the second processing result of the other customer requests.
5. The method according to claim 4, characterized in that, The step of obtaining the regression test result based on the input judgment information regarding the target customer's request further includes: If the judgment information indicates that the target customer request is a non-negligible customer request, then the processing of the other customer requests is stopped, and the regression test result is determined to be a test failure.
6. The method according to claim 1, characterized in that, Before acquiring multiple customer requests from the business system in a production environment, the method further includes: Obtain the full-link logs of the production environment, wherein the full-link logs are the logs corresponding to the multiple client requests; The acquisition of multiple customer requests from the business system in the production environment includes: The multiple client requests are obtained based on the full-link logs.
7. A regression testing device, characterized in that, include: The acquisition module is used to acquire multiple customer requests from the business system in the production environment; A sorting module is used to sort the multiple customer requests; The processing module is used to process multiple sorted customer requests sequentially in the production environment to obtain multiple first processing results in the production environment. The processing module is further configured to use the pre-release environment of the business system to process the sorted multiple customer requests sequentially to obtain multiple second processing results in the pre-release environment; The testing module is used to perform regression testing on the environment to be released based on the plurality of first processing results and the plurality of second processing results, and obtain the regression test results of the environment to be released. The test module is specifically used for: If the first processing result of the same customer request in the plurality of first processing results is the same as the second processing result of the same customer request in the plurality of second processing results, then the regression test result is obtained by comparing the first database of the production environment and the second database of the environment to be released. The first database is used to store operation data corresponding to the multiple customer requests in the production environment, and the second database is used to store operation data corresponding to the multiple customer requests in the release environment.
8. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the regression testing method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the regression testing method according to any one of claims 1-6.