Regression testing method, device and equipment based on SDK (Software Development Kit) and medium
By integrating the data acquisition SDK on the application side, intercepting and storing network request metric data, and performing replay verification in the target database after database replacement, the problem of low efficiency and reliability of the existing regression testing methods is solved, and high efficiency is achieved , the automated regression testing process ensures the system stability and performance after database replacement.
Patent Information
- Application Number
- CN202411193765.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-13
AI Technical Summary
The existing regression testing methods are less efficient and reliable in the database replacement process and require more manual intervention, resulting in incomplete testing.
By integrating the data acquisition SDK on the application side, intercepting network requests and responses, collecting request metric data and storing it in the source database. After the database is replaced, the request metric data within the specified test range is obtained from the source database and performing it in the target database. Replay and check to generate regression test results.
It improves the efficiency and reliability of regression testing, reduces manual operations, quickly responds to code changes through automated processes, promptly discovers and fixes problems, and ensures system stability and performance after database replacement.
Smart Images

Figure CN119127691A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and is applied to regression testing scenarios of financial software under database replacement, and in particular to a regression testing method, device, equipment and medium based on SDK. Background Art
[0002] In the banking sector, for reasons of cost-effectiveness, technological autonomy, and compliance requirements, domestic databases such as Oracle, which were commonly used in the past, are being replaced. In the context of database replacement, financial applications need to be regressed to ensure that after the database is replaced, all existing functions of the application still work as expected without introducing new errors or problems. By performing regression testing, banks can ensure that database replacement is a smooth process that does not interfere with business operations, while ensuring the stability, security, and reliability of the system.
[0003] Currently, the industry usually uses three methods such as full retesting, priority-based retesting, or selective retesting to perform automated regression testing. Full retesting is to execute all existing regression tests on the code base; priority-based retesting is to execute test cases in order of importance and urgency; selective retesting is to select a subset of the regression test suite to execute.
[0004] Among the existing regression testing methods, the regression cost of full retesting is high, while priority-based retesting or selective retesting has the problem of incomplete regression. In addition, these methods require a lot of manual intervention, which makes the efficiency and reliability of regression testing when replacing the database low. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide an SDK-based regression testing method, device, equipment and medium that can be applied to financial technology or other related fields, and its main purpose is to improve the efficiency and reliability of application regression testing.
[0006] The technical solution of the present invention is as follows:
[0007] A first aspect of the present invention provides a regression testing method based on SDK, comprising:
[0008] Integrate a data collection SDK on the application side, wherein the data collection SDK is pre-set based on the requested indicator collection requirements of the application side;
[0009] When a network request is received, the network request and the request response are intercepted by the data collection SDK, and corresponding request indicator data is collected from the intercepted content and stored in the source database;
[0010] After the source database is replaced with the target database, in response to the regression test instruction, request indicator data of the application within the specified test range is obtained from the source database and replayed and verified in the target database;
[0011] Generate corresponding regression test results based on the replay and verification results of the request indicator data applied within the specified test range.
[0012] In one embodiment, the setting process of the data acquisition SDK includes:
[0013] Determine the request indicators that need to be collected by the application side, where the request indicators include at least one of request ID, request URI, request type, request parameters, request user, request time, response result, and response code;
[0014] A corresponding data collection SDK is constructed and set according to the request indicator and the data collection strategy, wherein the data collection strategy includes an interception collection mechanism, a data processing mechanism and a data storage mechanism.
[0015] In one embodiment, when a network request is received, the network request and the request response are intercepted by the data collection SDK, and corresponding request indicator data is collected from the intercepted content and stored in the source database, including:
[0016] When the application side receives a network request initiated by the browser, the data collection SDK intercepts the network request based on the interception and collection mechanism before sending the network request to the corresponding business server, and collects the first request indicator data in the network request according to the request indicator;
[0017] Forwarding the network request to the business server through the data collection SDK, intercepting the request response after the business server returns the request response based on the interception and collection mechanism, and collecting second request indicator data in the request response according to the request indicator;
[0018] The first request indicator data and the second request indicator data are stored in a source database.
[0019] In one embodiment, storing the first request indicator data and the second request indicator data in a source database includes:
[0020] After performing data processing on the first request indicator data and the second request indicator data based on the data processing mechanism by the data collection SDK, the processed request indicator data is obtained;
[0021] Acquire a data storage structure according to the data storage mechanism;
[0022] The processed request indicator data is stored in the source database according to the data storage structure.
[0023] In one embodiment, after the source database is replaced with the target database, in response to the regression test instruction, request indicator data of the application within the specified test range is obtained from the source database and replayed and verified in the target database, including:
[0024] After the source database is replaced with the target database, a regression test instruction is received and parsed to obtain a specified test scope, where the specified test scope includes applications and functions to be tested;
[0025] Exporting corresponding request indicator data from the source database according to the application and function to be tested;
[0026] Importing the exported request indicator data into the target database and executing a preset test case, wherein the test case is used to simulate the original request of the application and function to be tested to the business server;
[0027] The simulated response returned by the business server to the simulated request is obtained, and the simulated response is compared with the expected response to obtain the replay and verification results under the preset test case.
[0028] In one embodiment, comparing the simulated response with the expected response to obtain a replay and verification result under a preset test case includes:
[0029] comparing the simulated response to an expected response and identifying a difference between the simulated response and the expected response;
[0030] Perform difference analysis on all differences to obtain the corresponding difference type, difference location and difference content;
[0031] Classifying each difference into a critical difference and a non-critical difference according to the type of difference;
[0032] Eliminate the non-critical differences and confirm whether the difference position and difference content of the critical differences are within an acceptable range. If so, the verification passes; otherwise, the verification fails.
[0033] In one embodiment, generating corresponding regression test results according to the replay and verification results of the request indicator data applied within the specified test range includes:
[0034] Obtain the replay and verification results of the request indicator data applied within the specified test scope under each test case;
[0035] Summarize the replay and verification results of all test cases, analyze the summary results according to the preset analysis dimensions, and generate multi-dimensional test result analysis data;
[0036] Analyzing data based on the multi-dimensional test results using a preset visualization tool to generate a corresponding heat map;
[0037] Hot spot and cold spot analysis and bottleneck identification are performed on the heat map to obtain hot spot areas, cold spot areas and performance bottleneck areas covered by the regression test as corresponding regression test results.
[0038] A second aspect of the present invention provides a regression testing device based on SDK, comprising:
[0039] An integration module, used to integrate a data collection SDK on the application side, wherein the data collection SDK is pre-set based on the requested indicator collection requirements of the application side;
[0040] The interception and collection module is used to intercept the network request and the request response through the data collection SDK when receiving the network request, and collect the corresponding request indicator data from the intercepted content and store it in the source database;
[0041] A data replay module, for obtaining request indicator data of an application within a specified test range from the source database in response to a regression test instruction after the source database is replaced with the target database, and replaying and verifying the data in the target database;
[0042] The test output module is used to generate corresponding regression test results based on the replay and verification results of the request indicator data applied within the specified test range.
[0043] A third aspect of the present invention provides a computer device, comprising at least one processor; and
[0044] a memory communicatively connected to the at least one processor; wherein,
[0045] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above SDK-based regression testing method.
[0046] A fourth aspect of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned SDK-based regression testing method.
[0047] Beneficial effects: The present invention discloses a regression testing method, device, equipment and medium based on SDK. Compared with the prior art, the embodiment of the present invention integrates a data collection SDK on the application side; when a network request is received, the network request and request response are intercepted by the data collection SDK, and the corresponding request indicator data is collected from the intercepted content and stored in the source database; after the source database is replaced with the target database, in response to the regression test instruction, the request indicator data of the application within the specified test range is obtained from the source database and replayed and verified in the target database; the corresponding regression test results are generated according to the replay and verification results of the request indicator data of the application within the specified test range. By integrating the data collection SDK, it can ensure that the indicator data of the network request and response are accurately captured and stored, which provides a real and reliable data foundation for subsequent regression testing, and automatically extracts the request indicator data from the source database, and replays and verifies it in the target database, reducing manual operations. Through the automated regression testing process, it can quickly respond to code changes, discover and fix problems in a timely manner, and improve test efficiency and consistency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the scheme in the present invention, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0049] Figure 1 A flow chart of a regression testing method based on SDK provided in an embodiment of the present invention;
[0050] Figure 2 A flow chart of setting a data acquisition SDK in the SDK-based regression testing method provided in an embodiment of the present invention;
[0051] Figure 3 A flow chart of step S102 in the SDK-based regression testing method provided in an embodiment of the present invention;
[0052] Figure 4 A flow chart of step S303 in the SDK-based regression testing method provided in an embodiment of the present invention;
[0053] Figure 5 A flow chart of step S103 in the SDK-based regression testing method provided in an embodiment of the present invention;
[0054] Figure 6 A flow chart of step S504 in the SDK-based regression testing method provided in an embodiment of the present invention;
[0055] Figure 7 A flow chart of step S104 in the SDK-based regression testing method provided in an embodiment of the present invention;
[0056] Figure 8 A schematic diagram of the functional modules of a regression testing device based on SDK provided in an embodiment of the present invention;
[0057] Fig. 9 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.
[0059] In the banking sector, for reasons of cost-effectiveness, technological autonomy, and compliance requirements, domestic databases such as Oracle, which were commonly used in the past, are being replaced. In the context of database replacement, financial applications need to be regressed to ensure that after the database is replaced, all existing functions of the application still work as expected without introducing new errors or problems. By performing regression testing, banks can ensure that database replacement is a smooth process that does not interfere with business operations, while ensuring the stability, security, and reliability of the system.
[0060] Currently, the industry usually uses three methods such as full retesting, priority-based retesting, or selective retesting to perform automated regression testing. Full retesting is to execute all existing regression tests on the code base; priority-based retesting is to execute test cases in order of importance and urgency; selective retesting is to select a subset of the regression test suite to execute.
[0061] Among the existing regression testing methods, the regression cost of full retesting is high, while priority-based retesting or selective retesting has the problem of incomplete regression. In addition, these methods require a lot of manual intervention, which makes the efficiency and reliability of regression testing when replacing the database low.
[0062] In order to solve the above problems, the present invention proposes a regression testing method based on SDK, please refer to Figure 1 , Figure 1The flowchart of an embodiment of the SDK-based regression testing method provided by the present invention. The system architecture of the SDK-based regression testing method provided in this embodiment may include a first terminal device, a second terminal device, a third terminal device, a network and a server. The network is used to provide a medium for a communication link between the first terminal device, the second terminal device, the third terminal device and the server. The network may include various connection types, such as wired and / or wireless communication links, etc.
[0063] The user may use the first terminal device, the second terminal device, and the third terminal device to interact with the server through the network to receive or send messages, etc. Various communication client applications may be installed on the first terminal device, the second terminal device, and the third terminal device, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only as examples).
[0064] The first terminal device, the second terminal device, and the third terminal device may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0065] The server may be a server that provides various services, such as a background management server that provides support for the content browsed by the user using the first terminal device, the second terminal device, and the third terminal device (for example only). The background management server may analyze and process the received data such as the user request, and feed back the processing results (such as web pages, information, or data obtained or generated according to the user request) to the terminal device. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.
[0066] It should be noted that the SDK-based regression testing method provided in the embodiment of the present invention can generally be executed by the first terminal device, the second terminal device or the third terminal device. Correspondingly, the SDK-based regression testing device provided in the embodiment of the present invention can also be set in the first terminal device, the second terminal device or the third terminal device.
[0067] Alternatively, the SDK-based regression testing method provided in the embodiment of the present invention may also be generally executed by a server. Accordingly, the SDK-based regression testing device provided in the embodiment of the present invention may generally be arranged in a server. The SDK-based regression testing method provided in the embodiment of the present invention may also be executed by a server or server cluster that is different from the server and can communicate with the first terminal device, the second terminal device, the third terminal device and / or the server. Accordingly, the SDK-based regression testing device provided in the embodiment of the present invention may also be arranged in a server or server cluster that is different from the server and can communicate with the first terminal device, the second terminal device, the third terminal device and / or the server.
[0068] It should be understood that the numbers of the above terminal devices, networks and servers are only illustrative. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0069] like Figure 1 As shown, the SDK-based regression testing method provided in this embodiment specifically includes the following steps:
[0070] S101 . Integrate a data collection SDK on the application side, where the data collection SDK is pre-set based on the requested indicator collection requirements of the application side.
[0071] In this embodiment, a pre-set data collection SDK is integrated on the application side to integrate the data collection function into the application. SDK is the abbreviation of Software Development Kit, which is a set of tools, libraries, documents and guidelines provided to software developers to help developers build, test and deploy software applications. A data collection SDK is pre-set based on the request indicator collection requirements on the application side and integrated on the application side to capture the data generated when the application is running, such as user behavior data, system performance indicators, network request and response data, etc., so that developers do not need to build data collection logic from scratch, and can quickly and efficiently implement data collection and analysis functions in the application.
[0072] In one embodiment, Figure 2 As shown, the setting process of the data acquisition SDK includes:
[0073] S201. Determine the request indicators that need to be collected by the application side, where the request indicators include at least one of request ID, request URI, request type, request parameters, request user, request time, response result, and response code;
[0074] S202. Construct and set a corresponding data collection SDK according to the request indicator and the data collection strategy, wherein the data collection strategy includes an interception collection mechanism, a data processing mechanism and a data storage mechanism.
[0075] In this embodiment, an SDK for collecting request indicator data is pre-developed and set up. The data collection needs of the application side are first analyzed to determine the request indicators that need to be collected on the application side, such as request ID, request URI, request type, request parameters, requesting user, request time (request start time and request end time), response time (response start time and response end time), response result, and response code. At least one of the following may also be used to set other request indicators according to other needs, such as request header, response header, request body, response body, etc. This embodiment does not limit this.
[0076] According to the request indicators and data collection strategies determined by analysis, the corresponding data collection SDK is constructed and set. The specific data collection strategy includes interception collection mechanism, data processing mechanism and data storage mechanism. The architecture of the SDK involved in the data collection strategy includes, for example, corresponding data collection module, data processing module, data storage module, etc. Then, the corresponding data collection SDK is obtained by selecting appropriate technology stacks such as Java, Python, Node.js, etc. to develop each module and perform performance testing, security testing, etc. Ensure that the developed HTTP indicator collection SDK can not only meet the basic data collection requirements, but also be robust and reliable in terms of security, performance, maintainability, etc.
[0077] S102: When a network request is received, the network request and the request response are intercepted by the data collection SDK, and corresponding request index data is collected from the intercepted content and stored in a source database.
[0078] In this embodiment, a data collection SDK is integrated on the application side. When a network request enters the application, the network request and request response are intercepted by the integrated data collection SDK, and the corresponding request indicator data is automatically collected from the intercepted content and stored in the source database. By intercepting network requests and responses and automatically collecting and storing network request data, the regression testing process can be simplified, the impact of new code or application updates on existing functions can be quickly verified, and the test scenarios can be covered more comprehensively, thereby improving the test coverage and quality.
[0079] In one embodiment, Figure 3 As shown, step S102 includes:
[0080] S301. When the application side receives a network request initiated by the browser, the data collection SDK intercepts the network request based on the interception and collection mechanism before sending the network request to the corresponding business server, and collects the first request indicator data in the network request according to the request indicator;
[0081] S302, forwarding the network request to the business server through the data collection SDK, intercepting the request response after the business server returns the request response based on the interception and collection mechanism, and collecting second request indicator data in the request response according to the request indicator;
[0082] S303: Store the first request indicator data and the second request indicator data in a source database.
[0083] In this embodiment, the interception and collection mechanism when setting the data collection SDK is used to determine the data collection points, that is, to determine which points in the life cycle of network requests and responses need to collect data, such as before the request is initiated, after the request is sent, before the response is received, etc.; and to determine the request indicators for each collection and then realize data extraction. The specific interception and extraction implementation method can be, for example, HTTP interceptors, middleware, decorators, AOP (aspect-oriented programming), etc., to extract the required data from HTTP requests and responses.
[0084] Specifically, the browser first initiates a network request to the application, which may be an http request. When the http request enters the application, the data collection SDK intercepts the network request based on the interception and collection mechanism built during construction before sending the network request to the corresponding business server, and collects the first request indicator data in the network request based on the request indicators determined by the analysis, including the request URI, request type (GET, POST), Cookie, requesting user, request input parameters, request ID, request URI, request time and other information.
[0085] After collecting the first request indicator data in the request phase, the network request is forwarded to the corresponding business server through the data collection SDK to execute the corresponding business logic in the business server. After the execution is completed, the business server will return the corresponding execution result, that is, the request response returned to the network request. At this time, the data collection SDK also intercepts the request response after the business server returns the request response based on the interception collection mechanism, and collects the second request indicator data in the request response according to the request indicator, including the response code, that is, the http status code and the response content. After storing the collected first request indicator data and second request indicator data in the source database, the intercepted request response is returned to the browser, so that the request and response data are automatically collected during the life cycle of the normal network request and response initiated on the application side. For the application side, it only needs to integrate the SDK to complete the data collection for subsequent application regression testing, without the need for additional development, which improves the efficiency of regression testing.
[0086] In one embodiment, Figure 4 As shown, step S303 includes:
[0087] S401, after performing data processing on the first request indicator data and the second request indicator data based on the data processing mechanism through the data collection SDK, obtaining processed request indicator data;
[0088] S402, acquiring a data storage structure according to the data storage mechanism;
[0089] S403: Store the processed request indicator data in the source database according to the data storage structure.
[0090] In this embodiment, the data processing mechanism when setting the data collection SDK is used to determine the processing method of the collected data, such as cleaning, formatting and necessary conversion processing of the collected first request indicator data and the second request indicator data, removing invalid or erroneous data, and ensuring that the first request indicator data and the second request indicator data are consistent in format, type and structure; and the data storage mechanism is used to determine the data storage structure, convert the collected and processed request indicator data into structured information according to the data storage structure and store it in the source database, providing processed and formatted test data for regression testing, and ensuring the accuracy and repeatability of the test.
[0091] S103: After the source database is replaced with the target database, in response to the regression test instruction, request indicator data of the application within the specified test range is obtained from the source database and replayed and verified in the target database.
[0092] In this embodiment, when a database change occurs in an application and the source database is replaced with a target database, regression testing of the application is required to ensure that the behavior of the application in the new environment is consistent with expectations. During the test, in response to the regression test instructions input by the user, the request indicator data of the application within the specified test scope is obtained from the source database, that is, the user can determine the scope of the test by inputting the regression test instructions, such as full test, partial test, priority test, etc., which can be flexibly selected according to needs. Automatically obtaining the request indicator data of the application within the specified test scope from the source database and replaying it in the target database improves the efficiency and coverage of the regression test. By replaying the request indicator data in the source database, it is verified whether the target database can correctly process the same request and return the expected results, thereby comparing the performance of the application on the source database and the target database, and evaluating the impact of database replacement on performance.
[0093] In one embodiment, Figure 5 As shown, step S103 includes:
[0094] S501, after the source database is replaced with the target database, receiving a regression test instruction and parsing to obtain a specified test scope, where the specified test scope includes applications and functions to be tested;
[0095] S502, exporting corresponding request indicator data from the source database according to the application and function to be tested;
[0096] S503, importing the exported request indicator data into the target database and executing a preset test case, wherein the test case is used to simulate the original request of the application and function to be tested to the business server;
[0097] S504: Obtain a simulated response returned by the business server to the simulated request, compare the simulated response with the expected response, and obtain a replay and verification result under a preset test case.
[0098] In this embodiment, after the source database is replaced with the target database, a regression test instruction is received from the automated test platform or the test team, and the application and function scope to be tested are determined by parsing the test instruction, and the test environment is configured to ensure that all necessary test data and resources are available. Based on the specified test scope, the relevant request indicator data in the source database is queried, and the corresponding request indicator data is exported to the test environment through a database export tool or script, etc., to provide accurate input for subsequent tests, and the efficiency of test preparation is improved through the automated export process. During the test, the exported request indicator data is imported into the target database, and preset test cases are configured and executed. These test cases can simulate the original request of the application to the business server, thereby ensuring that the test covers all key application functions and business scenarios, and by executing the preset test cases and monitoring the test process, the response of the business server to the simulated request is captured, and these simulated responses are compared and analyzed with the expected response. The expected response is specifically the response information extracted from the exported request indicator data, and the simulated response is compared with the expected response to obtain the replay and verification results under the preset test case, so as to quickly identify possible problems or deviations in the new environment, ensure that the stability and performance of the application are not affected after the database is replaced, and improve the automation level and efficiency of the test.
[0099] In one embodiment, Figure 6 As shown, step S504 includes:
[0100] S601, comparing the simulated response with the expected response, and identifying the difference between the simulated response and the expected response;
[0101] S602, performing difference analysis on all differences to obtain corresponding difference types, difference locations and difference contents;
[0102] S603, classifying each difference into key differences and non-key differences according to the difference type;
[0103] S604: Eliminate the non-critical differences and confirm whether the difference position and difference content of the critical differences are within an acceptable range. If so, the verification passes; otherwise, the verification fails.
[0104] In this embodiment, the simulated response is compared with the expected response, for example, the difference between the simulated response and the expected response is identified by text comparison, JSON comparison, XML comparison and other methods, so as to provide a basis for replay verification analysis; all identified differences are analyzed for differences, and the difference type (such as content difference, structural difference, etc.), difference location and specific difference content are determined. Based on the difference type, each difference is divided into key differences and non-key differences, that is, according to the business logic and importance standards, which differences are key and which are non-key are pre-defined. Key differences may affect the function or performance of the application, while non-key differences (such as format differences, annotation differences, etc.) usually do not affect. The types of key differences and non-key differences can be set for matching and identification, or a machine learning model can be used to automatically identify key differences, etc. Since non-key differences usually do not affect the function or performance of the application, non-key differences in all differences can be eliminated first when obtaining the verification results to improve the verification efficiency. For key differences, by confirming whether the difference location and difference content are within an acceptable range, for example, for some responses (such as images or large files), a threshold can be set to determine whether the difference is within an acceptable range. If so, the verification passes, otherwise the verification fails. By distinguishing between critical differences and non-critical differences and judging critical differences, we ensure that only critical issues that truly affect the business are marked as failures, allowing a certain degree of flexibility to adapt to the needs of different business scenarios, ensuring the accuracy and operability of test results, and also improving the efficiency and quality of testing, thereby quickly responding to problems that may arise after database replacement or upgrade.
[0105] S104: Generate corresponding regression test results according to the replay and verification results of the request indicator data applied within the specified test range.
[0106] In this embodiment, based on the replay and verification results of the request indicator data of the application within the specified test scope, the replay and verification results are analyzed to determine whether the test passes or fails, and the analysis results are integrated to generate and display the corresponding regression test results in a visual manner. For example, a visual regression test report can be generated through an automated testing tool or script, including test coverage, passed / failed test cases, detailed information on key differences, etc., so that the development and testing team can formulate subsequent repair plans or optimization strategies based on the test results, and track the progress of problem solving, to ensure that the software's functions and performance still meet the expected quality standards after the database is replaced.
[0107] In one embodiment, Figure 7 As shown, step S104 includes:
[0108] S701, obtaining the replay and verification results of the request indicator data of the application within the specified test scope under each test case;
[0109] S702, summarizing the replay and verification results under all test cases, performing test result analysis on the summary results according to preset analysis dimensions, and generating multi-dimensional test result analysis data;
[0110] S703, using a preset visualization tool to analyze data according to the multi-dimensional test results to generate a corresponding heat map;
[0111] S704: Perform hot spot and cold spot analysis and bottleneck identification on the heat map to obtain hot spot areas, cold spot areas, and performance bottleneck areas covered by the regression test as corresponding regression test results.
[0112] In this embodiment, when aggregating all replay and verification results and then generating regression test results, first collect the replay and verification results of the request indicator data under each test case. Specifically, the automated testing framework can be used to record the execution status and results of each test case to ensure that the execution of each test case is tracked and recorded in detail, providing a data basis for subsequent analysis; the replay and verification results of all test cases are summarized, and the summarized results are analyzed in multiple dimensions according to preset analysis dimensions (such as functional modules, code files, classes, methods, etc.) to generate multi-dimensional test result analysis data, such as summarizing the number of test cases that pass the test under all test cases, and calculating the test pass rate data for each analysis dimension distribution (that is, the number of test cases that pass the test under each dimension divided by the total number of test cases), and evaluating the test coverage and quality from multiple dimensions.
[0113] Based on multi-dimensional analysis data, the corresponding heat map is generated through preset visualization tools (such as Python's Matplotlib, Seaborn library, or commercial software such as Tableau, etc.). The heat map can represent areas with different test pass rates with different colors, intuitively display the test results, and quickly identify the distribution of test results through visualization, thereby enhancing the readability and comprehensibility of the test results. Through the color distribution in the heat map, the heat map is analyzed for hot spots and cold spots and bottlenecks are identified, and the hot spots, cold spots and performance bottlenecks covered by the regression test are obtained as the corresponding regression test results. Existing analysis and identification methods such as the Getis-Ord Gi statistical method can be used to identify hot spots and cold spots, and bottleneck identification algorithms or models such as queue theory and statistical process control can be used to identify performance bottleneck areas.
[0114] Among them, the hot spots in the heat map are areas with high test pass rates, which may indicate good and stable test coverage; the cold spots in the heat map are areas with low test pass rates, which may be high-risk areas with insufficient test coverage or defects; the performance bottleneck areas in the heat map are areas with low test pass rates and may affect the overall test performance. By automatically and visually generating visual test results based on replay and verification results, the analysis efficiency and accuracy of the test results are improved, problems in software testing can be more effectively identified and solved, and the accuracy and reliability of regression testing can be improved.
[0115] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0116] Further references Figure 8 , as a response to the above Figure 1 The present invention provides an embodiment of a regression testing device based on SDK. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0117] like Figure 8 As shown, the SDK-based regression testing device 80 described in this embodiment includes:
[0118] Integration module 801, used to integrate a data collection SDK on the application side, wherein the data collection SDK is pre-set based on the requested indicator collection requirements of the application side;
[0119] The interception and collection module 802 is used to intercept the network request and the request response through the data collection SDK when receiving the network request, and collect the corresponding request indicator data from the intercepted content and store it in the source database;
[0120] A data replay module 803 is used to obtain the request indicator data of the application within the specified test range from the source database in response to the regression test instruction after the source database is replaced with the target database, and replay and verify it in the target database;
[0121] The test output module 804 is used to generate corresponding regression test results according to the replay and verification results of the request indicator data applied within the specified test range.
[0122] The module referred to in the present invention refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the SDK-based regression test execution process than a program. For the specific implementation of each module, please refer to the corresponding method embodiment above, which will not be repeated here.
[0123] In one embodiment, the device 80 further includes:
[0124] An indicator determination module, used to determine the request indicator that needs to be collected by the application side, wherein the request indicator includes at least one of a request ID, a request URI, a request type, a request parameter, a request user, a request time, a response result, and a response code;
[0125] The SDK construction module is used to construct and set the corresponding data collection SDK according to the request indicators and data collection strategy, wherein the data collection strategy includes an interception collection mechanism, a data processing mechanism and a data storage mechanism.
[0126] In one embodiment, the interception collection module 502 includes:
[0127] A request interception and collection unit, configured to intercept the network request before sending the network request to the corresponding business server through the data collection SDK based on the interception and collection mechanism when the application side receives the network request initiated by the browser, and collect the first request indicator data in the network request according to the request indicator;
[0128] A response interception and collection unit, used for forwarding the network request to the business server through the data collection SDK, intercepting the request response after the business server returns the request response based on the interception and collection mechanism, and collecting second request indicator data in the request response according to the request indicator;
[0129] A data storage unit is used to store the first request indicator data and the second request indicator data in a source database.
[0130] In one embodiment, the data storage unit includes:
[0131] A data processing unit, configured to process the first request indicator data and the second request indicator data based on the data processing mechanism through the data collection SDK to obtain processed request indicator data;
[0132] A structure acquisition unit, used for acquiring a data storage structure according to the data storage mechanism;
[0133] The storage unit is used to store the processed request indicator data in the source database according to the data storage structure.
[0134] In one embodiment, the data replay module 503 includes:
[0135] An instruction parsing unit, configured to receive a regression test instruction and parse and obtain a specified test scope after the source database is replaced with the target database, wherein the specified test scope includes the application and function to be tested;
[0136] A data export unit, configured to export corresponding request indicator data from the source database according to the application and function to be tested;
[0137] An import execution unit, used to import the exported request indicator data into the target database and execute a preset test case, wherein the test case is used to simulate the original request of the application and function to be tested to the business server;
[0138] The response comparison unit is used to obtain the simulated response returned by the business server to the simulated request, compare the simulated response with the expected response, and obtain the replay and verification results under the preset test case.
[0139] In one embodiment, the response comparison unit comprises:
[0140] a difference identification unit, used to compare the simulated response with the expected response and identify the difference between the simulated response and the expected response;
[0141] The difference analysis unit is used to perform difference analysis on all differences to obtain the corresponding difference type, difference position and difference content;
[0142] A type classification unit, used for classifying each difference into a key difference and a non-key difference according to the difference type;
[0143] The verification unit is used to eliminate the non-critical differences and confirm whether the difference position and difference content of the critical differences are within an acceptable range. If so, the verification passes, otherwise the verification fails.
[0144] In one embodiment, the test output module 504 includes:
[0145] A result acquisition unit, used to obtain the replay and verification results of the request indicator data applied within the specified test scope under each test case;
[0146] The summary analysis unit is used to summarize the replay and verification results under all test cases, analyze the summary results according to the preset analysis dimensions, and generate multi-dimensional test result analysis data;
[0147] A heat map generating unit, configured to generate a corresponding heat map according to the multi-dimensional test result analysis data by using a preset visualization tool;
[0148] The heat map analysis unit is used to perform hot spot and cold spot analysis and bottleneck identification on the heat map, and obtain the hot spot area, cold spot area and performance bottleneck area covered by the regression test as the corresponding regression test results.
[0149] In the above embodiment, the present invention discloses a regression testing device based on SDK, which integrates data collection SDK on the application side; when a network request is received, the network request and request response are intercepted by the data collection SDK, and the corresponding request index data is collected from the intercepted content and stored in the source database; after the source database is replaced with the target database, in response to the regression test instruction, the request index data of the application within the specified test range is obtained from the source database and replayed and verified in the target database; the corresponding regression test results are generated according to the replay and verification results of the request index data of the application within the specified test range. By integrating the data collection SDK, it can ensure that the index data of the network request and response are accurately captured and stored, which provides a real and reliable data foundation for subsequent regression testing, and automatically extracts the request index data from the source database, and replays and verifies it in the target database, reducing manual operations. Through the automated regression testing process, it can quickly respond to code changes, timely discover and fix problems, and improve test efficiency and consistency.
[0150] Another embodiment of the present invention provides a computer device, such as Fig. 9 As shown, the computer device 90 includes:
[0151] One or more processors 901 and memory 902, Fig. 9 A processor 901 is used as an example for the description. The processor 901 and the memory 902 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.
[0152] Processor 901 is used to complete various control logics of computer device 90, which can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component or any combination of these components. In addition, processor 901 can also be any traditional processor, microprocessor or state machine. Processor 901 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.
[0153] The memory 902 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the SDK-based regression testing method in the embodiment of the present invention. The processor 901 executes various functional applications and data processing of the computer device 90 by running the non-volatile software programs, instructions and units stored in the memory 902, that is, implementing the SDK-based regression testing method in the above method embodiment.
[0154] The memory 902 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the computer device 90, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 902 may optionally include a memory remotely arranged relative to the processor 901, and these remote memories may be connected to the computer device 90 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. One or more units are stored in the memory 902, and when executed by one or more processors 901, the steps of the regression testing method based on the SDK in any of the above-mentioned method embodiments are executed.
[0155] In the above embodiment, the present invention discloses a computer device, which integrates a data acquisition SDK on the application side; when a network request is received, the network request and request response are intercepted by the data acquisition SDK, and the corresponding request indicator data is collected from the intercepted content and stored in the source database; after the source database is replaced with the target database, in response to the regression test instruction, the request indicator data of the application within the specified test range is obtained from the source database and replayed and verified in the target database; the corresponding regression test results are generated according to the replay and verification results of the request indicator data of the application within the specified test range. By integrating the data acquisition SDK, it can ensure that the indicator data of the network request and response are accurately captured and stored, which provides a real and reliable data foundation for subsequent regression testing, and automatically extracts the request indicator data from the source database, and replays and verifies it in the target database, reducing manual operations. Through the automated regression test process, it can quickly respond to code changes, discover and fix problems in a timely manner, and improve test efficiency and consistency.
[0156] An embodiment of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the steps of the SDK-based regression testing method in any of the above method embodiments are executed.
[0157] In the above embodiment, the present invention discloses a non-volatile computer-readable storage medium, which integrates a data acquisition SDK on the application side; when a network request is received, the network request and the request response are intercepted by the data acquisition SDK, and the corresponding request index data is collected from the intercepted content and stored in the source database; after the source database is replaced with the target database, in response to the regression test instruction, the request index data of the application within the specified test range is obtained from the source database and replayed and verified in the target database; the corresponding regression test results are generated according to the replay and verification results of the request index data of the application within the specified test range. By integrating the data acquisition SDK, it can ensure that the index data of the network request and response are accurately captured and stored, which provides a real and reliable data foundation for subsequent regression testing, and automatically extracts the request index data from the source database, and replays and verifies it in the target database, reducing manual operations. Through the automated regression test process, it can quickly respond to code changes, timely discover and fix problems, and improve test efficiency and consistency.
[0158] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0159] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0160] In summary, the present invention discloses a regression testing method, device, equipment and medium based on SDK, the method includes: integrating a data acquisition SDK on the application side; when a network request is received, the network request and request response are intercepted by the data acquisition SDK, and the corresponding request indicator data is collected from the intercepted content and stored in the source database; after the source database is replaced with the target database, in response to the regression test instruction, the request indicator data of the application within the specified test range is obtained from the source database and replayed and verified in the target database; the corresponding regression test results are generated according to the replay and verification results of the request indicator data of the application within the specified test range. By integrating the data acquisition SDK, it can ensure that the indicator data of the network request and response are accurately captured and stored, which provides a real and reliable data foundation for subsequent regression testing, and automatically extracts the request indicator data from the source database, and replays and verifies it in the target database, reducing manual operations. Through the automated regression testing process, it can quickly respond to code changes, timely discover and fix problems, and improve test efficiency and consistency.
[0161] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, a floppy disk, a flash memory, an optical storage device, etc.
[0162] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A regression testing method based on SDK, characterized in that: include: Integrate a data collection SDK on the application side, wherein the data collection SDK is pre-set based on the requested indicator collection requirements of the application side; When a network request is received, the network request and the request response are intercepted by the data collection SDK, and corresponding request indicator data is collected from the intercepted content and stored in the source database; After the source database is replaced with the target database, in response to the regression test instruction, request indicator data of the application within the specified test range is obtained from the source database and replayed and verified in the target database; Generate corresponding regression test results based on the replay and verification results of the request indicator data applied within the specified test range.
2. The SDK-based regression testing method according to claim 1, characterized in that: The setting process of the data acquisition SDK includes: Determine the request indicators that need to be collected by the application side, where the request indicators include at least one of request ID, request URI, request type, request parameters, request user, request time, response result, and response code; A corresponding data collection SDK is constructed and set according to the request indicator and the data collection strategy, wherein the data collection strategy includes an interception collection mechanism, a data processing mechanism and a data storage mechanism.
3. The SDK-based regression testing method according to claim 2, characterized in that: When a network request is received, the network request and the request response are intercepted by the data collection SDK, and corresponding request indicator data is collected from the intercepted content and stored in the source database, including: When the application side receives a network request initiated by the browser, the data collection SDK intercepts the network request based on the interception and collection mechanism before sending the network request to the corresponding business server, and collects the first request indicator data in the network request according to the request indicator; Forwarding the network request to the business server through the data collection SDK, intercepting the request response after the business server returns the request response based on the interception and collection mechanism, and collecting second request indicator data in the request response according to the request indicator; The first request indicator data and the second request indicator data are stored in a source database.
4. The SDK-based regression testing method according to claim 3, characterized in that: The storing the first request indicator data and the second request indicator data in the source database includes: After performing data processing on the first request indicator data and the second request indicator data based on the data processing mechanism by the data collection SDK, the processed request indicator data is obtained; Acquire a data storage structure according to the data storage mechanism; The processed request indicator data is stored in the source database according to the data storage structure.
5. The SDK-based regression testing method according to claim 1, characterized in that: After the source database is replaced with the target database, in response to the regression test instruction, request indicator data of the application within the specified test range is obtained from the source database and replayed and verified in the target database, including: After the source database is replaced with the target database, a regression test instruction is received and parsed to obtain a specified test scope, where the specified test scope includes applications and functions to be tested; Exporting corresponding request indicator data from the source database according to the application and function to be tested; Importing the exported request indicator data into the target database and executing a preset test case, wherein the test case is used to simulate the original request of the application and function to be tested to the business server; The simulated response returned by the business server to the simulated request is obtained, and the simulated response is compared with the expected response to obtain the replay and verification results under the preset test case.
6. The SDK-based regression testing method according to claim 5, characterized in that: The comparing the simulated response with the expected response to obtain the replay and verification results under the preset test case includes: comparing the simulated response to an expected response and identifying a difference between the simulated response and the expected response; Perform difference analysis on all differences to obtain the corresponding difference type, difference location and difference content; Classifying each difference into a critical difference and a non-critical difference according to the type of difference; Eliminate the non-critical differences and confirm whether the difference position and difference content of the critical differences are within an acceptable range. If so, the verification passes; otherwise, the verification fails.
7. The SDK-based regression testing method according to claim 5, characterized in that: The generating corresponding regression test results according to the replay and verification results of the request indicator data applied within the specified test range includes: Obtain the replay and verification results of the request indicator data applied within the specified test scope under each test case; Summarize the replay and verification results of all test cases, analyze the summary results according to the preset analysis dimensions, and generate multi-dimensional test result analysis data; Analyzing data based on the multi-dimensional test results using a preset visualization tool to generate a corresponding heat map; Hot spot and cold spot analysis and bottleneck identification are performed on the heat map to obtain hot spot areas, cold spot areas and performance bottleneck areas covered by the regression test as corresponding regression test results.
8. A regression testing device based on SDK, characterized in that: include: An integration module, used to integrate a data collection SDK on the application side, wherein the data collection SDK is pre-set based on the requested indicator collection requirements of the application side; The interception and collection module is used to intercept the network request and the request response through the data collection SDK when receiving the network request, and collect the corresponding request indicator data from the intercepted content and store it in the source database; A data replay module, for obtaining request indicator data of an application within a specified test range from the source database in response to a regression test instruction after the source database is replaced with the target database, and replaying and verifying the data in the target database; The test output module is used to generate corresponding regression test results based on the replay and verification results of the request indicator data applied within the specified test range.
9. A computer device, characterized in that: comprising at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the SDK-based regression testing method described in any one of claims 1-7.
10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the SDK-based regression testing method described in any one of claims 1-7.
Citation Information
Cited By
Model-based data resource automatic testing method and system
CN120029903A
Model-based data resource automatic testing method and system
CN120029903B
