Service flow regression testing method, device, equipment and computer storage medium

By using the regression testing method of business traffic in hotel business testing, by comparing the test response information and real response information, the problems of inconsistency in data and insufficient test coverage in traditional testing methods are solved, and more accurate and efficient testing is achieved.

CN119766700APending Publication Date: 2025-04-04SHENZHEN DIDATRAVEL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411675014.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

Traditional hotel business testing methods cannot effectively evaluate the true performance of the system, and the test environment is inconsistent with the production environment data, resulting in inaccurate test results and inability to implement full-link order testing, which increases system complexity and maintenance costs.

Method used

A regression testing method for business traffic is proposed. By obtaining the traffic data to be tested on the service side, putting it into the preset testing environment of the test server for testing, obtaining the test response information, and comparing it with the real response information of the service side. If it does not match, regression testing will be performed.

Benefits of technology

By using real business traffic for testing, real business scenarios can be more accurately simulated, the accuracy and reliability of tests can be improved, testing efficiency can be improved, full-link order testing can be achieved, and test coverage and personnel work efficiency can be enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766700A_ABST
    Figure CN119766700A_ABST
Patent Text Reader

Abstract

This invention discloses a regression testing method for business traffic, used in a test server, comprising: acquiring test traffic data from the business end; deploying the test traffic data to a preset test environment on the test server, performing tests based on the test traffic data and the preset test environment, and obtaining test response information; acquiring the actual response information from the business end, wherein the actual response information is obtained by the business end performing tests based on the test traffic data; comparing the test response information with the actual response information, and if the test response information and the actual response information do not match, performing regression testing. This invention can more accurately simulate real business scenarios, more comprehensively detect potential problems, and improve the accuracy and efficiency of testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a regression testing method, device, equipment and computer storage medium for business traffic. Background Art

[0002] In the hotel business, due to the complexity of the hotel business, including multiple links such as room reservation, check-in, check-out, payment, as well as different customer types (such as individual travelers, groups, members, etc.) and various promotional policies (such as discounts, coupons, points, etc.), the construction of test data has become extremely difficult. Traditional testing methods often cannot effectively evaluate the real performance of the system, and the data in the test environment cannot be completely consistent with the data in the production environment. This data inconsistency not only affects the accuracy of the test results, but may also cause problems in the actual production environment for tests that pass in the test environment. In addition, traditional testing methods rely on developers to develop code for testing and need to construct complex test data. They can often only test a single system or module, and cannot implement full-link order testing, so they cannot fully evaluate the performance and stability of the system, and also increase the complexity and maintenance cost of the system. Summary of the invention

[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a regression test method for service traffic, which is applied to a server and can detect existing problems more comprehensively, improve the efficiency of the test, and improve the accuracy and reliability of the test.

[0004] The present invention also provides a regression test device for service flow.

[0005] The present invention also provides a regression test device for service flow.

[0006] The present invention also provides a computer-readable storage medium.

[0007] In a first aspect, an embodiment of the present invention provides a regression test method for service traffic, which is applied to a test server, and the method includes:

[0008] Get the traffic data to be tested on the business side;

[0009] The flow data to be tested is delivered to a preset test environment of a test server, and a test is performed according to the flow data to be tested and the preset test environment to obtain test response information;

[0010] Acquire real response information of the service end, where the real response information is obtained by the service end performing a test according to the flow data to be tested;

[0011] A comparison is performed based on the test response information and the real response information. If the test response information and the real response information do not match, a regression test is performed.

[0012] The embodiments of the present invention have at least the following beneficial effects: obtaining the traffic data to be tested on the business end, performing a test on the traffic data to be tested and the preset test environment in the test server to obtain test response information; comparing the aforementioned test response information with the real response information captured by the business end to obtain a matching result. If the test response information does not match the real response information, a regression test is performed to detect possible problems. By using real business traffic for testing, real business scenarios can be more accurately simulated, improving the accuracy and reliability of the test; testing in an online environment can improve the efficiency of the test; and through full-link order testing, possible problems can be detected more comprehensively, improving the coverage of the test, and improving the work efficiency of the testers.

[0013] According to some other embodiments of the present invention, the traffic data to be tested is delivered to a preset test environment of a test server, and a test is performed according to the traffic data to be tested and the preset test environment to obtain test response information, including: obtaining an initial execution path of the traffic data to be tested; performing a simulated replay operation in the preset test environment according to the traffic data to be tested and the initial execution path; and obtaining data generated in the simulated replay operation as the test response information.

[0014] According to some other embodiments of the present invention, the comparing the test response information and the real response information includes: comparing the test response information and the real response information to obtain a response matching degree; obtaining a preset matching interval; and comparing the response matching degree and the preset matching interval to obtain a matching result.

[0015] According to some other embodiments of the present invention, the method also includes constructing the preset test environment, including: setting up an initialization test environment; performing data isolation operations on the traffic data to be tested to obtain traffic data to be verified; obtaining an automated test script; and performing test operations on the initialization test environment based on the traffic data to be verified and the automated test script until the preset test environment is obtained.

[0016] According to some other embodiments of the present invention, if the test response information and the real response information do not match, regression detection is performed, which specifically includes: performing data cleaning on the test response information to obtain data to be detected; obtaining preset detection data; matching the data to be detected with the preset detection data, and if the data to be detected and the preset detection data do not match, outputting a detection exception.

[0017] According to some other embodiments of the present invention, the data to be detected includes at least one of the following: a response data structure, response key information, and response dynamic data; the preset detection data includes at least one of the following: a preset data structure, preset key information, and a preset dynamic tolerance; correspondingly, the matching based on the data to be detected and the preset detection data includes at least one of the following: matching the response data structure with the preset data structure to obtain a structural matching degree; or, matching the response key information with the preset key information to obtain a key matching degree; or, matching the response dynamic data with the preset dynamic tolerance to obtain a dynamic matching degree.

[0018] According to some other embodiments of the present invention, before obtaining the traffic data to be tested of the service end, the method further includes: obtaining original traffic data; and performing desensitization processing on the original traffic data to obtain the traffic data to be tested.

[0019] In a second aspect, an embodiment of the present invention provides a regression test device for service traffic, characterized in that the device comprises:

[0020] A first acquisition unit, used to acquire the traffic data to be tested of the service end;

[0021] An execution test unit, used for delivering the flow data to be tested to a preset test environment of a test server, performing an execution test according to the flow data to be tested and the preset test environment, and obtaining test response information;

[0022] A second acquisition unit is used to acquire real response information of the service end, where the real response information is obtained by the service end performing a test according to the flow data to be tested;

[0023] A regression unit is used to compare the test response information with the real response information, and if the test response information does not match the real response information, perform regression detection.

[0024] The embodiments of the present invention have at least the following beneficial effects: through the above-mentioned device, by using real business traffic for testing, the real business scenario can be simulated more accurately, thereby improving the accuracy and reliability of the test; by testing in an online environment, the efficiency of the test can be improved; and through full-link order testing, possible problems can be detected more comprehensively, thereby improving the test coverage and the work efficiency of the testers.

[0025] In a third aspect, an embodiment of the present invention provides a regression test control device for service traffic, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following is achieved:

[0026] The regression testing method for service flow as proposed in the first aspect of the present invention;

[0027] or,

[0028] A regression testing device for service traffic as proposed in the second aspect of the present invention.

[0029] The embodiments of the present invention have at least the following beneficial effects: by using real business traffic for testing, real business scenarios can be simulated more accurately, thereby improving the accuracy and reliability of the test; by conducting testing in an online environment, the efficiency of the test can be improved; and by full-link order testing, possible problems can be detected more comprehensively, thereby improving the test coverage and the work efficiency of testers.

[0030] In a seventh aspect, an embodiment of the present invention provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to:

[0031] The regression testing method for service flow as proposed in the first aspect of the present invention;

[0032] or,

[0033] A regression testing device for service traffic as proposed in the second aspect of the present invention.

[0034] The embodiments of the present invention have at least the following beneficial effects: by using real business traffic for testing, real business scenarios can be simulated more accurately, thereby improving the accuracy and reliability of the test; by conducting testing in an online environment, the efficiency of the test can be improved; and by full-link order testing, possible problems can be detected more comprehensively, thereby improving the test coverage and the work efficiency of testers. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0036] Figure 1 A flow chart of a regression test method for service traffic according to an embodiment of the present invention;

[0037] Figure 2 A schematic diagram of a process of executing a test and obtaining response information according to an embodiment of the present invention;

[0038] Figure 3 A schematic diagram of a process for constructing a preset test environment according to an embodiment of the present invention;

[0039] Figure 4A schematic diagram of a process for obtaining flow data to be tested according to an embodiment of the present invention;

[0040] Figure 5 The figure is a schematic diagram of the structure of a regression test device for service traffic according to an embodiment of the present invention. DETAILED DESCRIPTION

[0041] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0042] Reference Figure 1 , according to an embodiment of the present invention Figure 1 The flow chart of an embodiment of a regression test method for service traffic is shown in FIG. 1 , and the regression test method for service traffic is used to test a server. The embodiment of the present invention also provides another regression test method for service traffic, which is applied to a test terminal. The regression test method for service traffic applied to a test server includes:

[0043] Step S100, obtaining the traffic data to be tested at the service end.

[0044] Among them, the business end is a system or platform for supporting the daily business operations of merchant services for customers. Taking the hotel industry as an example, the business end can be a third-party online booking platform, such as Ctrip, Meituan Travel, Qunar, Fliggy, etc., or a hotel official website and mobile application; it can also be other online business ends, such as social media platforms, including but not limited to WeChat, Weibo, Douyin, etc., or email marketing, such as customers booking services to the hotel by sending emails. The traffic data to be tested includes but is not limited to the following: customer price inquiry data, such as customers querying all hotels in a certain destination and the lowest quoted prices of each hotel; customer price verification data, such as data on customers checking the specific quotation information of a hotel after selecting a hotel; customer order data, such as data on customers filling in relevant information and paying for an order after selecting a hotel; customer order inquiry data, such as data on customers being able to query their own reservation information; customer cancellation data, such as data on customers being able to cancel an order after placing an order. Similarly, taking the performance industry as an example, the traffic data to be tested includes but is not limited to customer order data, customer order inquiry data, customer cancellation data, and other data generated when customers order tickets for art performances, concerts, plays, dances, and other art performances. At the same time, the traffic data to be tested also includes response metadata, such as response status, time consumption, etc. Optionally, the above-mentioned traffic data to be tested can be captured in the online environment of the business end using a network packet capture tool (such as Wireshark, Tcpdump, etc.) or a proxy server (such as Fiddler, Charles Proxy, etc.). By using real business traffic for testing, real business scenarios can be simulated more accurately, improving the accuracy and reliability of the test. Optionally, after capturing the aforementioned traffic data, the traffic data can also be desensitized to ensure the privacy and security of customers.

[0045] Step S110, delivering the traffic data to be tested to a preset test environment of a test server, performing a test according to the traffic data to be tested and the preset test environment, and obtaining test response information.

[0046] Optionally, the test server can be connected to the business end in communication, and the traffic data to be tested on the business end can be directed to the test server. For example, an automated script or a specific traffic replay tool (such as Apache JMeter, Gatling, etc., or using tools such as tcpreplay in a Linux environment) can be used to put the processed traffic data into a preset test environment, and then the test can be performed without affecting the online environment of the business end, thereby improving the efficiency of the test. Among them, the preset test environment can be a pre-set simulation test environment, which can be constructed based on the real inventory data of the online environment of the business end, including the same database status, configuration files, and service dependencies, etc., to achieve full-link testing of orders. Putting the data to be tested into the preset test environment can be using an automated script or a specific traffic replay tool (such as Apache JMeter, Gatling, etc., or using tools such as tcpreplay in a Linux environment) to send the processed traffic data to the preset test environment. Based on the preset test environment of the test server and the diverted test traffic data, the execution test is performed according to the original execution path of the test traffic data. Optionally, the execution test can be to replay the test traffic data according to the original execution path, that is, to simulate the customer's real operation in the test environment according to the original access mode. Among them, the test response information can be the response data obtained after the execution of the test, such as the response of the test server to the execution of the test. Taking the hotel industry or the performance industry as an example, it includes but is not limited to the reservation success, payment status, query results, etc. of the reservation order or ticket purchase order obtained by the test, as well as the specific content such as the response status and time consumption. By diverting the traffic to the test server for testing, the test can be performed without affecting the online environment, thereby improving the efficiency of the test.

[0047] Step S120, obtaining the real response information of the service end, where the real response information is obtained by the service end by performing a test based on the traffic data to be tested.

[0048] Among them, the real response information can be the execution test information captured in the online environment of the business end, that is: based on the traffic data to be tested, the same execution test operation as that in the test server is executed in the real environment of the business end, and the actual response obtained includes but is not limited to the booking success, payment status, query results, etc. in the real environment, as well as the status of the response, time consumption and other specific content.

[0049] Step S130: compare the test response information with the real response information. If the test response information does not match the real response information, a regression test is performed.

[0050] Optionally, the test response information and the real response information are compared one by one to determine whether the response in the simulation environment matches the response in the real environment. Among them, it can be determined whether the two are completely consistent; a dynamic matching interval can also be set. If the two are not completely consistent, or the matching degree of the two cannot fall within the dynamic matching interval, it is confirmed that the test response information does not match the real response information, and further regression detection operations are required to detect possible problems. For example, detection can be performed through statistical analysis, anomaly detection, data comparison, state analysis, result analysis, response analysis, etc., to find possible problems and repair them, so that possible problems can be detected more comprehensively and the coverage of the test can be improved. Optionally, after repairing the problems found in the regression test, the above steps can be repeated for testing until all key problems are solved. Optionally, if the two are completely consistent or the matching degree of the two falls within the dynamic matching interval, it is confirmed that the test response information matches the real response information, and then the next round of regression testing of business traffic is performed.

[0051] The above-mentioned business traffic testing method obtains the traffic data to be tested on the business side, performs a test on the traffic data to be tested and the preset test environment in the test server to obtain test response information; the aforementioned test response information is compared with the real response information captured by the business side to obtain a matching result. If the test response information does not match the real response information, regression detection is performed to detect possible problems. By using real business traffic for testing, real business scenarios can be more accurately simulated, and the accuracy and reliability of the test can be improved; testing in an online environment can improve the efficiency of the test; and through full-link order testing, possible problems can be detected more comprehensively, the test coverage can be improved, and the work efficiency of testers can be improved.

[0052] In some specific implementations of the present invention, the flow data to be tested is put into a preset test environment of a test server, and a test is performed according to the flow data to be tested and the preset test environment to obtain test response information, including:

[0053] Step S200, obtaining an initial execution path of the flow data to be tested.

[0054] The initial execution path can be the original execution path or original access mode of the traffic data to be tested in the real environment of the business end. Optionally, the initial execution path can be captured directly from the online environment of the business end, by adding logging statements, or by using a proxy server or packet capture tool to capture detailed information of network requests and responses, or by using a debugger to track the execution path of the program, etc. In this way, the initial execution path of the traffic data to be tested can be obtained, and the real environment can be further simulated to obtain more realistic and accurate test response information.

[0055] Step S210, performing a simulated replay operation in a preset test environment according to the traffic data to be tested and the initial execution path.

[0056] Optionally, the traffic data to be tested is replayed according to the initial execution path, including but not limited to the order of requests, time intervals, protocol types, etc., that is, the actual operations of the customers are simulated in a preset test environment according to the original access mode, which can ensure that the captured data is accurate and complete.

[0057] Step S220, obtaining data generated in the simulated replay operation as test response information.

[0058] During the simulation replay process, the generated data is captured. This data can be the test server's response to the simulation replay operation, including but not limited to booking success, payment status, query results, etc., while recording the status of the response, time consumption, etc. By accurately simulating the real business scenario, the accuracy of the regression test results can be ensured.

[0059] In some specific embodiments of the present invention, comparing the test response information with the real response information includes:

[0060] The test response information is compared with the actual response information to obtain the response matching degree.

[0061] The response matching degree may be the similarity or difference between the test response information and the real response information. Optionally, the similarity between the test response information and the real response information may be calculated as the response matching degree. The response matching degree may be used to measure the matching degree between the test response information in the simulated preset test environment and the real response information in the real environment, and to determine whether the two are consistent.

[0062] Get the preset matching interval.

[0063] Among them, the preset matching interval can also be an interval range. Only when the response matching degree falls within the interval can the test response information and the real response information be confirmed to be valid or meet the requirements. For example, when the preset matching interval is an interval, the preset matching interval can be set to 90-100. Optionally, the preset matching interval can also be a threshold corresponding to the response matching degree. Only when the response matching degree exceeds the threshold can the test response information and the real response information be confirmed to be valid or meet the requirements. For example, when the preset matching interval is a threshold, the preset matching interval can be set to 95.

[0064] The matching result is obtained by comparing the response matching degree with the preset matching interval.

[0065] For example, if the response matching degree is 91 and the preset matching interval is 90-100, the response matching degree falls within the preset matching interval, and the matching result that the test response information matches the real response information can be confirmed; if the response matching degree is 75 and the preset matching interval is 90-100, the response matching degree is outside the preset matching interval, and the matching result that the test response information does not match the real response information can be confirmed. By comparing the response matching degree and the preset matching interval, the similarity between the test response information and the real response information can be accurately measured to improve the test efficiency.

[0066] In some specific implementations of the present invention, the regression test method of the service traffic further includes building a preset test environment, including:

[0067] Step S300, building an initial test environment.

[0068] Among them, the initialization test environment can be the software environment required for regression testing. The initialization test environment can be built according to the corresponding regression test requirements. For example, taking the specific requirements of the hotel business as an example, it includes but is not limited to the requirements of business processes, user behaviors, data interactions, etc. Specifically, first, you can choose the environment type, you can choose a fixed environment, or you can choose a dynamic environment. Taking the hotel industry as an example, because there is a fluctuation range in hotel pricing, you can choose a dynamic environment. You can use automated tools (such as Noah environment management system) to create an initialization test environment, so that you can quickly respond to business changes and improve the efficiency of environmental delivery. Secondly, you can configure environmental resources. According to the needs of regression testing, you can configure sufficient servers, storage, network and other resources. For example, you can install necessary software, including but not limited to databases (such as MySQL), Web servers (such as Apache or Nginx), Java development environments (such as JDK), etc., to ensure that the initialization test environment is consistent or similar to the production environment in hardware and software configuration to improve the accuracy of the test. Then, you can deploy application services. In the initial test environment, you can deploy hotel business-related application services, including front-end pages, back-end interfaces, databases, etc. For example, configure database connection information, Web server port number, etc. to ensure that the version of the application service is consistent with the test target; finally, you can set up the data environment and import the data required for regression testing, including but not limited to user information, order information, inventory information, etc. In this way, you can build an initial test environment.

[0069] Step S310, performing data isolation operation on the flow data to be tested to obtain the flow data to be verified.

[0070] Among them, the traffic data to be verified can be traffic data that has been processed by data isolation and is used to verify the functional correctness, performance stability and compatibility of the business end when processing the traffic data to be tested. Since the traffic data to be tested contains different types of data, in order to ensure the isolation of different data in storage, processing and access, to prevent the leakage of sensitive data, data confusion and data conflicts, data isolation operations can be performed on the traffic data to be tested to ensure that the test data and production data are independent of each other to avoid data pollution. Optionally, different data can be isolated through storage isolation, access control, encryption protection, network isolation, virtual isolation and network isolation equipment, database isolation and other technical means to prevent data leakage and unauthorized access, thereby obtaining the traffic data to be verified.

[0071] Step S320, obtaining an automated test script.

[0072] Among them, the automated test script can be a computer program for automatically executing software tests. Optionally, the automated test script can be written in various programming languages, such as JavaScript, Java, Python, PHP, etc., or it can be an executable program deployed through scripts, configuration management tools (such as Ansible, Puppet, etc.) or container technologies (such as Docker). Automated testing can be achieved through automated test scripts to complete tasks such as software installation, configuration updates, and environment verification, greatly improving the delivery speed and accuracy of the preset test environment, and improving test efficiency and quality.

[0073] Step S330, based on the traffic data to be verified and the automated test script, a test operation is performed on the initialized test environment until a preset test environment is obtained.

[0074] Optionally, the traffic data to be verified can be put into the initialization test environment, and the initialization test environment can be optimized based on the automated test deployment of the automated test script. Specifically, regression testing can be implemented in the initialization test environment based on the traffic data to be verified and the automated test script, including real business traffic, such as request and response data, to ensure that the recorded traffic covers all business scenarios in the test target; then replay the business traffic, simulate real user behavior, and verify the functional correctness, performance stability and compatibility of the business end when processing these traffic; finally, collect and analyze logs, monitoring data, etc. during the test process, evaluate the achievement of the test objectives, and formulate corresponding optimization measures. By continuously looping the test operation until an efficient, stable and secure preset test environment is obtained, it can not only improve the work efficiency of testers, but also achieve full-link testing of orders by building a real test environment.

[0075] In some specific embodiments of the present invention, if the test response information does not match the real response information, a regression test is performed, which specifically includes:

[0076] The test response information is cleaned to obtain the data to be tested.

[0077] The data to be tested refers to the number of business flows that need to be tested. Optionally, the captured test response information can be cleaned as necessary to remove some data that does not participate in the test comparison, such as timestamps, dynamically generated IDs, etc. Since these data are usually labeled during data modeling, data cleaning can be performed based on the labels. After removing unnecessary data, the remaining data can be used as the data to be tested to ensure the accuracy of the test.

[0078] Get preset detection data.

[0079] The preset detection data may include, but are not limited to, preset data structures, preset key information, preset dynamic tolerances, etc. The preset data structures may include fields in JSON or XML, the preset key information may include business data, status codes, error messages, etc., and the preset dynamic tolerance may be a certain error range allowed for dynamically changing data.

[0080] The data to be detected is matched with the preset detection data. If the data to be detected does not match the preset detection data, a detection abnormality is output.

[0081] Optionally, the data to be tested and the preset test data can be matched to obtain the matching degree of the two. For example, it is possible to check whether the structure of the response data in the data to be tested is consistent with the preset data structure in the preset test data; key content such as business data, status code, error information, etc. can be extracted from the data to be tested to determine whether the data to be tested and the preset test data are consistent. Because rules are established for different data types during data modeling, such as whether they need to be completely consistent, the allowed range of differences, etc., similarity (i.e., matching degree) can be obtained by comparing the two; relevant rules can be established for data that may change dynamically, such as hotel quotations, etc., and tolerance comparison algorithms can be used to determine whether they exceed the allowed range, etc. Optionally, before performing the comparison, anomaly detection can also be performed to identify abnormal situations such as response time and error codes, and to promptly discover potential problems. If the regression test fails, the problem can be identified through comparison analysis, for example: state analysis, viewing the relevant execution status, and understanding the problems that may occur during the processing of the business end system. If the online traffic is normal, but the test execution returns an error status, it may indicate that the business change has introduced a problem. It is necessary to analyze the problem in detail, output the detection anomaly, and correct the anomaly. For result analysis, you can view the comparison results of the execution. For example, if the order is successful but the order price exceeds the tolerance range, you need to view the system log to further analyze the cause, whether the system price-related configuration is abnormal or there is a problem with the system calculation. If there is a problem, output the relevant problem to facilitate the tester to correct it. For response analysis, you can view the relevant data of the execution, such as the response time. If the order is successful but the response time is too long, you need to consider whether there is a performance problem in the system. If there is a related problem, you need to eliminate the problem before going online. Through full-link regression testing, you can detect possible problems more comprehensively and improve the coverage of regression testing.

[0082] In some specific embodiments of the present invention, the data to be detected includes at least one of the following: a response data structure, response key information, and response dynamic data, and the preset detection data includes at least one of the following: a preset data structure, preset key information, and a preset dynamic tolerance. Correspondingly, matching is performed based on the data to be detected and the preset detection data, including at least one of the following:

[0083] Match the response data structure with the preset data structure to obtain a structure matching degree; or,

[0084] Match the response key information with the preset key information to obtain the key matching degree; or,

[0085] The response dynamic data is matched with the preset dynamic tolerance to obtain a dynamic matching degree.

[0086] Among them, the response data structure can be the structure of the test response data in the data to be tested; the response key information can be the key information in the data to be tested for detecting possible problems, such as business data, status code, error information, etc. in the data to be tested; the response dynamic data can be data that is constantly updated over time. Taking the hotel industry as an example, it can be customer check-in time, customer consumption data (including but not limited to average consumption level, consumption range, consumption frequency, etc.), customer satisfaction data, market competition data, etc. Among them, the dynamic data included in the preset dynamic tolerance can also be preset customer check-in time, preset customer consumption data, preset customer satisfaction data, preset market competition data, etc. The structural matching degree can be the similarity between the response data structure and the preset data structure, the key matching degree can be the similarity between the response key information and the preset key information, and the dynamic matching degree can be the similarity between the response dynamic data and the preset dynamic tolerance.

[0087] Among them, according to the matching of the data to be detected and the preset detection data, the response data structure can be matched with the preset data structure to determine whether the two are consistent and obtain the structural matching degree; the response key information can also be matched with the preset key information to determine whether the two are consistent or within the allowable difference range to obtain the key matching degree; the response dynamic data can also be matched with the preset dynamic tolerance to determine whether it exceeds the allowable range through the tolerance comparison algorithm to obtain the dynamic matching degree. Through automated matching testing, the efficiency of the test can be improved.

[0088] In some specific embodiments of the present invention, before obtaining the traffic data to be tested of the service end, the method further includes:

[0089] Step S400, obtaining original traffic data.

[0090] The raw traffic data may be real business traffic captured from an online environment and not processed. The raw traffic data may be raw data directly obtained from a third-party online booking platform or other online business terminals, including but not limited to directly captured online traffic data, including but not limited to customer price inquiry data, customer price verification data, customer order data, etc. Optionally, in some specific embodiments, the raw traffic data may be directly used as the traffic data to be tested for regression detection.

[0091] Step S410, desensitizing the original traffic data to obtain the traffic data to be tested.

[0092] Optionally, the captured raw traffic data can be desensitized to protect user privacy. For example, a data replacement method can be used to replace sensitive information such as name, contact information, etc. with false data; a data masking method can be used to partially mask credit card numbers, etc.; a data encryption method can be used to encrypt sensitive data of ID card numbers to ensure that even if the data is leaked, it cannot be interpreted. In some specific embodiments, the object of desensitization can be personal information, including but not limited to the customer's name, address, telephone number, email address, etc.; it can also be payment information, including but not limited to credit card number, bank account information, payment password, etc.; it can also be identity authentication information, such as password, PIN code, biometric information, etc. Through desensitization, user privacy can be protected and sensitive data leakage can be avoided. In some specific embodiments, the raw traffic data can also be further processed. For example, the captured raw traffic data can be filtered, edited or rearranged to remove unnecessary information (such as session ID, timestamp, etc.). By desensitizing sensitive information, user privacy is further protected and the captured data is ensured to comply with the privacy policy.

[0093] like Figure 5 As shown, an embodiment of the present invention further provides a regression test device for service traffic, the device comprising:

[0094] The first acquisition unit 500 is used to acquire the traffic data to be tested of the service end;

[0095] The test execution unit 510 is used to deliver the traffic data to be tested to the preset test environment of the test server, perform the test according to the traffic data to be tested and the preset test environment, and obtain the test response information;

[0096] The second acquisition unit 520 is used to acquire the real response information of the service end, where the real response information is obtained by the service end performing a test according to the flow data to be tested;

[0097] The regression unit 530 is used to compare the test response information with the real response information, and if the test response information does not match the real response information, perform regression detection.

[0098] Through the above-mentioned device, by using real business traffic for testing, the real business scenario can be simulated more accurately, and the accuracy and reliability of the test can be improved; testing in an online environment can improve the efficiency of the test; and through full-link order testing, possible problems can be detected more comprehensively, the test coverage can be improved, and the work efficiency of testers can be improved.

[0099] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0100] The present invention also provides a regression test control device for service flow, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the following Figure 1 The regression testing method for the business traffic is shown.

[0101] The present invention also provides a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the above-mentioned Figure 1 The regression testing method for the business traffic is shown.

[0102] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0103] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the technical field without departing from the purpose of the present invention. In addition, the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

Claims

1. A regression test method for service traffic, used for testing a server, characterized in that: The method comprises: Get the traffic data to be tested on the business side; The flow data to be tested is delivered to a preset test environment of a test server, and a test is performed according to the flow data to be tested and the preset test environment to obtain test response information; Acquire real response information of the service end, where the real response information is obtained by the service end performing a test according to the flow data to be tested; A comparison is performed based on the test response information and the real response information. If the test response information and the real response information do not match, a regression test is performed.

2. The method according to claim 1, characterized in that The step of placing the traffic data to be tested into a preset test environment of a test server, performing a test according to the traffic data to be tested and the preset test environment, and obtaining test response information includes: Obtaining an initial execution path of the flow data to be tested; Performing a simulated replay operation in the preset test environment according to the traffic data to be tested and the initial execution path; The data generated in the simulated replay operation is acquired as the test response information.

3. The method according to claim 1, characterized in that The comparing the test response information with the real response information includes: Compare the test response information with the real response information to obtain a response matching degree; Get the preset matching interval; A comparison is performed based on the response matching degree and the preset matching interval to obtain a matching result.

4. The method according to claim 3, characterized in that The method further includes constructing the preset test environment, including: Build an initial test environment; Performing data isolation operation on the flow data to be tested to obtain flow data to be verified; Get automated test scripts; Based on the traffic data to be verified and the automated test script, a test operation is performed on the initialized test environment until the preset test environment is obtained.

5. The method according to claim 1, characterized in that If the test response information does not match the real response information, regression detection is performed, specifically including: Performing data cleaning on the test response information to obtain data to be tested; Obtain preset detection data; Matching is performed based on the data to be detected and the preset detection data. If the data to be detected does not match the preset detection data, a detection abnormality is output.

6. The method according to claim 5, characterized in that The data to be detected includes at least one of the following: a response data structure, response key information, and response dynamic data; the preset detection data includes at least one of the following: a preset data structure, preset key information, and a preset dynamic tolerance; and correspondingly, the matching according to the data to be detected and the preset detection data includes at least one of the following: Matching the response data structure with the preset data structure to obtain a structure matching degree; or, Matching the response key information with the preset key information to obtain a key matching degree; or, The response dynamic data is matched with the preset dynamic tolerance to obtain a dynamic matching degree.

7. The method according to claim 1, characterized in that Before obtaining the traffic data to be tested of the service end, the method further includes: Get raw traffic data; The original flow data is desensitized to obtain the flow data to be tested.

8. A regression test device for service flow, characterized in that: The device comprises: A first acquisition unit, used to acquire the traffic data to be tested of the service end; An execution test unit, used for delivering the flow data to be tested to a preset test environment of a test server, performing an execution test according to the flow data to be tested and the preset test environment, and obtaining test response information; A second acquisition unit is used to acquire real response information of the service end, where the real response information is obtained by the service end performing a test according to the flow data to be tested; A regression unit is used to compare the test response information with the real response information, and if the test response information does not match the real response information, perform regression detection.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the regression testing method for the service traffic according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the regression testing method for the service traffic according to any one of claims 1 to 7 is implemented.