Interface-based regression testing method, device, computer equipment and storage medium
Through automated interface regression testing, the problems of low testing efficiency and low accuracy in the existing technology are solved, efficient and accurate interface regression testing is achieved, and project operation costs are reduced.
Patent Information
- Application Number
- CN202210508982.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2042-05-10
AI Technical Summary
When existing regression testing tools perform regression testing of system interfaces, the test efficiency is inefficient and the accuracy cannot be guaranteed, resulting in unavailability of functions and increased project operation costs.
It provides an interface-based regression testing method. By receiving regression testing requests, pulling interface information of the target system, constructing and executing interface requests, generating regression testing analysis reports, and automating the interface regression testing process to reduce manual entry and operational errors.
It improves the efficiency and accuracy of regression testing, reduces the workload and cost of testers, and ensures the processing quality of interface regression testing.
Smart Images

Figure CN114817055B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an interface-based regression testing method, apparatus, computer equipment and storage medium. Background Art
[0002] Regression testing is particularly important for IT systems, especially those with complex business logic. A small change may affect many functional points. If the related modules are not regression tested, there will be a hidden danger of functional unavailability. If the bug is not covered and fixed in the regression testing phase, once it is released to production, it will affect the normal use of user-related functions. Production problems generally need to be fixed through temporary emergency versions, which invisibly increases the cost of project operation and greatly reduces the satisfaction of project stakeholders with the system. Interface regression testing is the last stage before the system goes online. Comprehensive regression testing can ensure that new functions can be launched normally and original functions are not affected when the system has frequent demand iterations, thereby ensuring the accuracy of new and old functions. Therefore, a simple and efficient regression testing tool is particularly important.
[0003] Existing regression testing tools such as TestingWhiz, SahiPro, TestComplete, etc., require testers to record the operation process / script in advance in the corresponding regression testing tool, insert assertions, execute operations, and finally generate reports when performing regression testing of the system interface. This takes a lot of time and manpower costs, has low testing efficiency, and manual recording is prone to operational errors, which leads to the inability to guarantee the accuracy of regression testing. Summary of the invention
[0004] The main purpose of the present application is to provide an interface-based regression testing method, apparatus, computer equipment and storage medium, aiming to solve the technical problems that the existing method of executing system interface regression testing has low testing efficiency and cannot ensure testing accuracy.
[0005] The present application proposes an interface-based regression testing method, the method comprising the steps of:
[0006] receiving a triggered regression test request corresponding to an interface of a target system to be tested;
[0007] Pulling interface information of all interfaces included in the target system from a preset database;
[0008] For each designated interface in the target system, acquiring designated interface information of the designated interface from all the interface information;
[0009] Constructing an interface request corresponding to the specified interface based on the specified interface information;
[0010] Performing a regression test on the designated interface based on the interface request to obtain a designated test result corresponding to the designated interface;
[0011] Based on the specified test results of each of the specified interfaces, an interface regression test analysis report of the target system is generated.
[0012] Optionally, before the step of pulling interface information of all interfaces included in the target system from a preset database, the following steps are included:
[0013] Obtaining an interface regression test evaluation result corresponding to the target system within a preset time period; wherein the number of the interface regression test evaluation results includes a plurality of results, and the interface regression test evaluation results include that all interfaces have passed the regression test or that all interfaces have not passed the regression test;
[0014] Filter out a first result indicating that all interfaces have passed the regression test from all the interface regression test evaluation results, and obtain a first number of the first results;
[0015] Obtaining a second number of all the interface regression test evaluation results;
[0016] Calculate the quotient of the first quantity and the second quantity to obtain the regression test pass rate;
[0017] Determine whether the regression test pass rate is greater than a preset pass rate threshold;
[0018] If the number of interfaces is less than the pass rate threshold, executing the step of pulling interface information of all interfaces included in the target system from the preset database;
[0019] If it is greater than the pass rate threshold, obtain the code change record corresponding to the target system, perform regression testing on the target interface corresponding to the code change record in the target system, and generate a corresponding target interface regression testing analysis report based on the target test result corresponding to the target interface.
[0020] Optionally, the step of obtaining a code change record corresponding to the target system, performing regression testing on a target interface corresponding to the code change record in the target system, and generating a corresponding target interface regression testing analysis report based on a target testing result corresponding to the target interface includes:
[0021] Obtaining a code change record of the target system based on a preset component;
[0022] Finding a target interface corresponding to the code change record from all interfaces included in the target system;
[0023] Acquire target interface information of the target interface;
[0024] constructing a target interface request corresponding to the target interface based on the target interface information;
[0025] Performing a regression test on the target interface based on the target interface request to obtain a target test result corresponding to the target interface;
[0026] A target interface regression test analysis report corresponding to the target system is generated based on the target test result.
[0027] Optionally, the step of performing a regression test on the designated interface based on the interface request to obtain a designated test result corresponding to the designated interface includes:
[0028] Initiating the interface request to the designated interface;
[0029] Determine whether the output result returned by the specified interface is received;
[0030] If the output result is not received, generating a first designated test result indicating that the interface corresponding to the designated interface has failed the regression test;
[0031] If the output result is received, the specified output parameter is parsed from the specified interface information corresponding to the specified interface;
[0032] Determining whether the output result is the same as the specified output parameter;
[0033] If the specified output parameter is the same as the specified output parameter, generating a second specified test result indicating that the interface corresponding to the specified interface passes the regression test;
[0034] If it is different from the designated output parameter, a third designated test result is generated indicating that the interface corresponding to the designated interface fails the regression test.
[0035] Optionally, the regression test request carries user information of the user, and before the step of pulling interface information of all interfaces included in the target system from a preset database, the step includes:
[0036] Acquire a facial image of a user, and acquire a fingerprint image corresponding to a designated finger of the user;
[0037] Based on the face image and the fingerprint image, calling a preset legal face image and a legal fingerprint image to perform identity authentication processing on the user, and judging whether the identity authentication is passed;
[0038] If the identity authentication is passed, extracting the user information from the regression test request;
[0039] Based on the user information, calling the preset classification tree model, role authority level table and business operation authority level table to perform authority verification processing on the user, and judging whether the authority verification is passed;
[0040] If the authority verification is passed, the step of pulling the interface information of all interfaces included in the target system from the preset database is executed.
[0041] Optionally, the step of calling a preset legal face image and a legal fingerprint image to perform identity authentication processing on the user based on the face image and the fingerprint image, and judging whether the identity authentication is passed includes:
[0042] Performing liveness detection on the user and determining whether the liveness detection passes;
[0043] If the liveness detection passes, obtain the pre-stored legal face image, and determine whether there is a specified face image matching the face image among all the legal face images;
[0044] If the specified face image exists, obtaining the specified user information corresponding to the specified face image;
[0045] Filtering out a designated fingerprint image corresponding to the designated finger from all the pre-stored legal fingerprint images corresponding to the designated user information;
[0046] Dividing the finger fingerprint area in the fingerprint image into a plurality of first sub-blocks according to a preset block division rule, and dividing the finger fingerprint area in the designated fingerprint image into a plurality of corresponding second sub-blocks based on the block division rule;
[0047] Obtaining a first number of the first sub-blocks and a second number of a preset similarity algorithm, and determining whether the first number is less than the second number;
[0048] If it is less than the second number, selecting a first number of target similarity algorithms from the similarity algorithms, and generating a one-to-one mapping relationship between each of the target similarity algorithms and each of the first sub-blocks;
[0049] Based on the mapping relationship, using each of the target similarity algorithms, a one-to-one comparison process is performed on all the first sub-blocks included in the fingerprint image and all the second sub-blocks included in the designated fingerprint image to obtain a plurality of similarities after the comparison process;
[0050] Compare the similarities obtained by each of the target similarity algorithms with the similarity thresholds of each of the target similarity algorithms to determine whether each of the similarities is greater than the corresponding similarity threshold;
[0051] If both are greater than the corresponding similarity threshold, the identity authentication is determined to be successful; otherwise, the identity authentication is determined to be unsuccessful.
[0052] Optionally, the step of performing permission verification processing on the user based on the user information by calling a preset classification tree model, a role permission level table, and a business operation permission level table, and determining whether the permission verification is passed includes:
[0053] Calling the classification tree model, the role authority level table and the business operation authority level table;
[0054] Inputting the user information into the classification tree model, and determining the role category corresponding to the user information through the classification tree model;
[0055] Determining a target authority level corresponding to the role category based on the role authority level table;
[0056] Acquire the permission level interval of the business operation corresponding to the execution of regression test based on the business operation permission level table;
[0057] Determining whether the target permission level is within the permission level range;
[0058] If it is within the permission level range, it is determined that the permission verification has passed, otherwise it is determined that the permission verification has not passed.
[0059] The present application also provides an interface-based regression testing device, comprising:
[0060] A receiving module, used for receiving a triggered regression test request corresponding to an interface of a target system to be tested;
[0061] A pulling module, used to pull interface information of all interfaces included in the target system from a preset database;
[0062] A first acquisition module, configured to acquire, for each designated interface in the target system, designated interface information of the designated interface from all the interface information;
[0063] A construction module, used to construct an interface request corresponding to the specified interface based on the specified interface information;
[0064] A testing module, used to perform a regression test on the specified interface based on the interface request to obtain a specified test result corresponding to the specified interface;
[0065] A generation module is used to generate an interface regression test analysis report of the target system based on the specified test results of each of the specified interfaces.
[0066] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0067] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0068] The interface-based regression testing method, apparatus, computer device, and storage medium provided in this application have the following beneficial effects:
[0069] The interface-based regression test method, device, computer equipment and storage medium provided in the present application, when receiving an interface regression test request corresponding to the target system to be tested triggered by a user, will first pull the interface information of all interfaces contained in the target system from the preset database, and then for each specified interface in the target system, obtain the specified interface information of the specified interface from all the interface information, and then construct an interface request corresponding to the specified interface based on the specified interface information, and then perform regression testing on the specified interface based on the interface request to obtain the specified test result corresponding to the specified interface, and finally generate an interface regression test analysis report for the target system based on the specified test result of each specified interface. Through the present application, regression testing of the interface of the target system can be automatically implemented, which can avoid the process of manually entering a large amount of information before testing, reduce the workload of testers, and avoid operational errors in manual recording, save testers' testing time and labor costs, effectively improve the test efficiency of regression testing, ensure the processing accuracy of regression testing, and help improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 It is a flowchart of an interface-based regression testing method according to an embodiment of the present application;
[0071] Figure 2 is a structural diagram of an interface-based regression testing device according to an embodiment of the present application;
[0072] Figure 3 It is a schematic diagram of the structure of a computer device according to an embodiment of the present application.
[0073] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0074] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0075] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.
[0076] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0077] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0078] Reference Figure 1 , an interface-based regression testing method according to an embodiment of the present application comprises:
[0079] S10: receiving a triggered regression test request corresponding to an interface of a target system to be tested;
[0080] S20: Pulling interface information of all interfaces included in the target system from a preset database;
[0081] S30: For each designated interface in the target system, obtaining designated interface information of the designated interface from all the interface information;
[0082] S40: constructing an interface request corresponding to the designated interface based on the designated interface information;
[0083] S50: performing a regression test on the designated interface based on the interface request to obtain a designated test result corresponding to the designated interface;
[0084] S60: Generate an interface regression test analysis report for the target system based on the specified test result of each of the specified interfaces.
[0085] As described in the above steps S10 to S60, the execution subject of the embodiment of the method is an interface-based regression test device. In practical applications, the above-mentioned interface-based regression test device can be implemented by a virtual device, such as software code, or by a physical device with relevant execution code written or integrated, and can interact with the user through a keyboard, mouse, remote control, touchpad or voice control device. The interface-based regression test device in this embodiment can automatically implement regression testing of the interface of the target system, effectively improve the test efficiency of the regression test of the system interface, ensure the processing accuracy of the regression test, and help improve the user experience. Specifically, first receive a triggered regression test request corresponding to the interface of the target system to be tested. Among them, the regression test request refers to a request triggered by the current user to perform a regression test on the interface of the target system to be tested. The target system to be tested is an iterative version of the target system, that is, a target system after the code of the original stable version of the target system is modified, which can also be called a test system after code iteration.
[0086] Then, the interface information of all interfaces included in the target system is pulled from the preset database. Among them, for the target system, in each iterative version system testing phase, the interface information of all interfaces included in the target system can be automatically intercepted and recorded based on AOP (Aspect Oriented Programming), and the interface information may include input parameters, output parameters, URL, request method and other information, and the obtained interface information is stored in a special data table of a preset database. Preferably, when the database records the interface information of the latest iterative version of the target system, the interface information of other previous versions can be deleted. In addition, all interfaces included in the target system may refer to the in-use interfaces of the target system. In addition, the interface information of all interfaces included in the target system can be pulled from the preset database by running a preset automation script. The automation script can be a processing logic code script written and generated by relevant personnel according to actual business usage requirements, such as the requirement to pull the interface information of all interfaces included in the target system from the preset database.
[0087] Then, for each designated interface in the target system, the designated interface information of the designated interface is obtained from all the interface information. Among them, the interface information of each interface used in the target system can be obtained from the database respectively. The interface information includes the input parameters, request methods and output parameters of each interface corresponding to the stable version of the target system before the upgrade. Subsequently, an interface request corresponding to the designated interface is constructed based on the designated interface information. Among them, the designated interface information at least includes the input parameters, output parameters and request methods of the designated interface. The interface request is a test request for regression testing of the target system to be tested. The input parameters are the same as the input parameters input in the target system before the upgrade. In addition, for different test requirements, the format of the test request to be generated may be different. For example, for the test of the query interface in the target system, it can be a request in HTTP format. In addition, constructing the interface request corresponding to the designated interface based on the designated interface information means constructing the interface request corresponding to the designated interface using a preset template based on the input parameters and request methods in the designated interface information. The preset template is data in JSON (a lightweight data exchange format) format. Specifically, all input parameters are placed in the value corresponding to the name "params" in the preset template, and the request method is stored in the value corresponding to the name "method" to generate the interface request.
[0088] After obtaining the interface request, the specified interface is subjected to regression testing based on the interface request to obtain the specified test result corresponding to the specified interface. After receiving the interface request, the specified interface under test can obtain the value corresponding to the "params" through the JSON operation API (an application programming interface specifically used to process JSON data), and after performing business processing on the value corresponding to the "params", finally return the output result, which is the test result corresponding to the interface request. If the generated output result meets the requirements of the output parameter, the test passes. Meeting the requirements of the output parameter may mean that the output result is the same as the output parameter. Finally, based on the specified test results of each of the specified interfaces, an interface regression test analysis report of the target system is generated. Based on the specified test results of all the specified interfaces, the first interface that passed the regression test and the second interface that failed the regression test can be determined, and the interface regression test analysis report of the target system is generated based on the first interface and the second interface. Specifically, a regression test template can be created in advance, in which a fill-in plate for interfaces that have passed verification and a fill-in plate for interfaces that have not passed verification are set. By filling the first interface and the second interface into the corresponding positions in the template, an interface regression test analysis report for the target system can be generated. In addition, based on the interface regression test analysis report, interfaces with abnormalities can be screened out, and the interfaces with abnormalities can be repaired in time to ensure that the new version of the system can be successfully launched.
[0089] In this embodiment, when an interface regression test request corresponding to the target system to be tested is received and triggered by a user, the interface information of all interfaces contained in the target system will be first pulled from the preset database, and then for each designated interface in the target system, the designated interface information of the designated interface will be obtained from all the interface information, and then the interface request corresponding to the designated interface will be constructed based on the designated interface information, and then the designated interface will be regressed based on the interface request to obtain the designated test result corresponding to the designated interface, and finally the interface regression test analysis report of the target system will be generated based on the designated test result of each designated interface. Through this embodiment, the regression test of the interface of the target system can be automatically implemented, which can avoid the process of manually entering a large amount of information before the test, reduce the workload of the tester, and avoid operational errors in manual recording, save the tester's test time and labor costs, effectively improve the test efficiency of the regression test, ensure the processing accuracy of the regression test, and help improve the user experience.
[0090] Furthermore, in an embodiment of the present application, before the above step S20, the following steps are included:
[0091] S200: Obtaining an interface regression test evaluation result corresponding to the target system within a preset time period; wherein the number of the interface regression test evaluation results includes a plurality of results, and the interface regression test evaluation result includes that all interfaces have passed the regression test or that all interfaces have not passed the regression test;
[0092] S201: Filtering out first results, which indicate that all interfaces have passed the regression test, from all the interface regression test evaluation results, and obtaining a first number of the first results;
[0093] S202: Obtain a second number of all the interface regression test evaluation results;
[0094] S203: Calculate the quotient of the first number and the second number to obtain a regression test pass rate;
[0095] S204: Determine whether the regression test pass rate is greater than a preset pass rate threshold;
[0096] S205: If the number of interfaces is less than the pass rate threshold, executing the step of extracting interface information of all interfaces included in the target system from the preset database;
[0097] S206: If it is greater than the pass rate threshold, obtain the code change record corresponding to the target system, perform regression testing on the target interface corresponding to the code change record in the target system, and generate a corresponding target interface regression testing analysis report based on the target test result corresponding to the target interface.
[0098] As described in the above steps S200 to S206, before the step of pulling the interface information of all interfaces included in the target system from the preset database, it may also include: first obtaining the interface regression test evaluation result corresponding to the target system within the preset time period. Among them, the number of the interface regression test evaluation results includes multiple, and the interface regression test evaluation result includes that all interfaces have passed the regression test or that all interfaces have not passed the regression test. In addition, there is no specific limitation on the value of the preset time period, which can be set according to actual needs, for example, it can be one month before the current time. In addition, the interface regression test evaluation result can be generated according to the interface regression test analysis report on the target system within the preset time period. If all interfaces included in any interface regression test analysis report have passed the regression test, an interface regression test evaluation result that all interfaces corresponding to the interface regression test analysis report have passed the regression test will be generated. If at least one interface that has not passed the regression test exists among all interfaces included in any interface regression test analysis report, an interface regression test evaluation result that all interfaces corresponding to the interface regression test analysis report have not passed the regression test will be generated. Then, the first result that all interfaces pass the regression test is selected from all the interface regression test evaluation results, and the first number of the first result is obtained. Then, the second number of all the interface regression test evaluation results is obtained. Subsequently, the quotient of the first number and the second number is calculated to obtain the regression test pass rate. It is judged whether the regression test pass rate is greater than the preset pass rate threshold. Among them, the value of the pass rate threshold is not specifically limited and can be set according to actual needs. If the calculated regression test pass rate is less than the pass rate threshold, it indicates that there are many bugs that are prone to problems in the previous interface regression test of the target system. At this time, it is necessary to perform regression testing on all interfaces included in the target system to achieve the lowest risk of missing regression errors, increase the coverage of regression testing, and ensure the effectiveness of regression testing. If the regression test pass rate is greater than the pass rate threshold, it indicates that the target system has run many regression tests and is unlikely to reveal new errors. At this time, an appropriate strategy will be intelligently selected to perform reduced regression testing, that is, only the target interface corresponding to the code change record in the target system is subjected to regression testing, thereby effectively reducing the huge workload caused by repeated interface regression testing and improving the processing efficiency of regression testing. If the pass rate is less than the pass rate threshold, the step of pulling the interface information of all interfaces included in the target system from the preset database is performed. If the pass rate is greater than the pass rate threshold, the code change record corresponding to the target system is obtained, regression testing is performed on the target interface corresponding to the code change record in the target system, and a corresponding target interface regression test analysis report is generated based on the target test result corresponding to the target interface.Among them, the specific process of performing regression testing on the target interface corresponding to the code change record in the target system and generating a corresponding target interface regression test analysis report based on the target test result corresponding to the target interface can refer to the aforementioned processing of the specified interface, and will not be described in detail here. In this embodiment, different regression test strategies can be used for the target system based on the different evaluation results of the interface regression test of the target system within a preset time period, which can avoid using only a fixed test method for regression testing, and effectively improve the intelligence of the interface regression test.
[0099] Furthermore, in an embodiment of the present application, the above step S206 includes:
[0100] S2060: Acquire a code change record of the target system based on a preset component;
[0101] S2061: Find a target interface corresponding to the code change record from all interfaces included in the target system;
[0102] S2062: Acquire target interface information of the target interface;
[0103] S2063: constructing a target interface request corresponding to the target interface based on the target interface information;
[0104] S2064: Perform regression testing on the target interface based on the target interface request to obtain a target test result corresponding to the target interface;
[0105] S2065: Generate a target interface regression test analysis report corresponding to the target system based on the target test result.
[0106] As described in the above steps S2060 to S2065, the steps of obtaining the code change record corresponding to the target system, performing regression testing on the target interface corresponding to the code change record in the target system, and generating a corresponding target interface regression test analysis report based on the target test result corresponding to the target interface may specifically include: first, obtaining the code change record of the target system based on a preset component. The code change record can be obtained by a preset component, and the preset component can be a functional module generated by a code written and generated by relevant personnel according to actual business usage requirements, such as the requirement of collecting the code change record of the target system. Then, the target interface corresponding to the code change record is found from all interfaces included in the target system. The target interface corresponding to the code change record can be found from all interfaces by a preset algorithm, and the preset algorithm can be a processing logic code written and generated by relevant personnel according to actual business usage requirements, such as the requirement of finding the target interface corresponding to the code change record. Then, the target interface information of the target interface is obtained. After obtaining the target interface information, a target interface request corresponding to the target interface is constructed based on the target interface information. Among them, the construction process of the target interface request can refer to the aforementioned processing of the specified interface, and no further details are given here. Subsequently, the target interface is subjected to regression testing based on the target interface request to obtain a target test result corresponding to the target interface. Among them, the process of performing regression testing on the target interface based on the target interface request can refer to the aforementioned processing of the specified interface, and no further details are given here. Finally, a target interface regression test analysis report corresponding to the target system is generated based on the target test result. Among them, the process of generating a corresponding target interface regression test analysis report based on the target test result can refer to the aforementioned processing of the specified interface, and no further details are given here. In this embodiment, when it is detected that the regression test pass rate is greater than the pass rate threshold, it will be determined that the target system has run many regression tests and is unlikely to reveal new errors. At this time, an appropriate strategy will be intelligently selected for reduced regression testing, that is, by only performing regression testing on the interface corresponding to the code change record in the target system, the workload of the interface regression test can be greatly reduced, and the processing intelligence of the regression test can be effectively improved.
[0107] Furthermore, in an embodiment of the present application, the above step S50 includes:
[0108] S500: Initiate the interface request to the designated interface;
[0109] S501: Determine whether the output result returned by the designated interface is received;
[0110] S502: If the output result is not received, generating a first designated test result indicating that the interface corresponding to the designated interface has failed the regression test;
[0111] S503: if the output result is received, parse the designated output parameter from the designated interface information corresponding to the designated interface;
[0112] S504: Determine whether the output result is the same as the specified output parameter;
[0113] S505: If the output parameter is the same as the specified output parameter, generating a second specified test result that the interface corresponding to the specified interface passes the regression test;
[0114] S506: If the output parameter is different from the specified output parameter, generate a third specified test result indicating that the interface corresponding to the specified interface fails the regression test.
[0115] As described in the above steps S500 to S506, the step of performing regression testing on the designated interface based on the interface request to obtain the designated test result corresponding to the designated interface may specifically include: first, initiating the interface request to the designated interface. Then, determining whether the output result returned by the designated interface is received. The output result is the result generated after the interface regression test is performed on the designated interface under the target system of the current test version using the interface request. In addition, if the interface call fails, no output result will be returned, and the cause of the error can be located according to the error code corresponding to each interface. If the output result is not received, a first designated test result is generated that the interface corresponding to the designated interface fails the regression test. If the output result returned by the designated interface is not received, it indicates that the call to the designated interface fails, indicating that a bug occurs in the designated interface of the test system after the code iteration, and a test result that the interface corresponding to the designated interface fails the test can be generated. If the output result is received, the designated output parameter is parsed from the designated interface information corresponding to the designated interface. The designated output parameter is the result generated after the interface regression test is performed on the designated interface under the target system of the stable version using the interface request. Subsequently, it is determined whether the output result is the same as the specified output parameter. If the output result is the same as the specified output parameter, a second specified test result is generated that the interface corresponding to the specified interface passes the regression test. If the output result is not the same as the specified output parameter, a third specified test result is generated that the interface corresponding to the specified interface fails the regression test. If the output result is not the same as the specified output parameter, it indicates that a bug has occurred in the specified interface of the test system after the code iteration, and a test result that the interface corresponding to the specified interface fails the test can be generated. If the output result is the same as the specified output parameter, it indicates that the specified interface under the target system of the test version has no problem compared to the previous stable version, and can still be called normally, and a test result that the interface corresponding to the specified interface passes the test will be generated. In this embodiment, by initiating the interface request to the specified interface, the specified interface will be determined to have passed the regression test only when the specified interface returns an output result that is the same as the preset specified output parameter. If the specified interface does not return an output result, or the returned output result is different from the specified output parameter, the specified interface will be determined to have failed the regression test, which effectively ensures the accuracy of the generated specified test result corresponding to the specified interface, and is conducive to the subsequent rapid and accurate generation of an interface regression test analysis report for the target system based on the specified test results obtained for each of the specified interfaces.
[0116] Furthermore, in an embodiment of the present application, before the above step S20, the following steps are included:
[0117] S210: Acquire a face image of a user, and acquire a fingerprint image corresponding to a designated finger of the user;
[0118] S211: Based on the face image and the fingerprint image, calling a preset legal face image and a legal fingerprint image to perform identity authentication processing on the user, and determining whether the identity authentication is passed;
[0119] S212: If the identity authentication is passed, extracting the user information from the regression test request;
[0120] S213: Based on the user information, calling a preset classification tree model, a role authority level table, and a business operation authority level table to perform authority verification processing on the user, and determining whether the authority verification is passed;
[0121] S214: If the authority verification is passed, the step of extracting the interface information of all interfaces included in the target system from the preset database is executed.
[0122] As described in the above steps S210 to S214, the regression test request carries the user information of the user. Before executing the step of pulling the interface information of all interfaces included in the target system from the preset database, it may also include: first obtaining the user's face image, and obtaining the fingerprint image corresponding to the specified finger of the user. Among them, there is no limitation on the specified finger, and the specified finger can be determined according to actual needs, for example, it can be the middle finger of the right hand. Then, based on the face image and the fingerprint image, the preset legal face image and the legal fingerprint image are called to perform identity authentication processing on the user, and it is determined whether the identity authentication is passed. Among them, for the specific implementation process of calling the preset legal face image and the legal fingerprint image to perform identity authentication processing on the user based on the face image and the fingerprint image, this application will be further described in detail in the subsequent specific embodiments, and will not be elaborated on here. If the identity authentication is passed, the user information is extracted from the regression test request. Among them, the user information may include the user's name information or the user's ID information. Subsequently, based on the user information, the preset classification tree model, role authority level table and business operation authority level table are called to perform authority verification processing on the user, and it is determined whether the authority verification is passed. Among them, for the specific implementation process of calling the preset classification tree model, role authority level table and business operation authority level table to perform authority verification processing on the user, this application will be further described in detail in the subsequent specific embodiments, and will not be elaborated too much here. If the authority verification is passed, the step of pulling the interface information of all interfaces contained in the target system from the preset database is executed. Among them, if the identity authentication fails or the authority verification fails, the response processing of the regression test request will be restricted. In this embodiment, after receiving the regression test request corresponding to the interface of the target system input by the user, the user will be processed for identity authentication and authority verification. Only when the user passes all the verifications, the interface regression test request input by the user will be responded to later, so as to effectively avoid the situation of providing the system regression test function for illegal users or unauthorized users, improve the standardization and rationality of processing regression test requests, and ensure the security in the interface regression test processing process.
[0123] Furthermore, in one embodiment of the present application, the above step S211 includes:
[0124] S2110: Performing liveness detection on the user, and determining whether the liveness detection passes;
[0125] S2111: If the liveness detection passes, obtain the pre-stored legal face image, and determine whether there is a designated face image matching the face image among all the legal face images;
[0126] S2112: If the designated face image exists, obtaining designated user information corresponding to the designated face image;
[0127] S2113: Filtering out a designated fingerprint image corresponding to the designated finger from all the pre-stored legal fingerprint images corresponding to the designated user information;
[0128] S2114: dividing the finger fingerprint area in the fingerprint image into a plurality of first sub-blocks according to a preset block division rule, and dividing the finger fingerprint area in the designated fingerprint image into a plurality of corresponding second sub-blocks based on the block division rule;
[0129] S2115: Obtain a first number of the first sub-blocks and a second number of a preset similarity algorithm, and determine whether the first number is less than the second number;
[0130] S2116: If it is less than the second number, selecting a first number of target similarity algorithms from the similarity algorithms, and generating a one-to-one mapping relationship between each of the target similarity algorithms and each of the first sub-blocks;
[0131] S2117: Based on the mapping relationship, using each of the target similarity algorithms, respectively, perform one-to-one comparison processing on all the first sub-blocks included in the fingerprint image and all the second sub-blocks included in the designated fingerprint image to obtain a plurality of similarities after the comparison processing;
[0132] S2118: Compare the similarities obtained by each target similarity algorithm with the similarity threshold of each target similarity algorithm, and determine whether each similarity is greater than the corresponding similarity threshold;
[0133] S2119: If both are greater than the corresponding similarity threshold, the identity authentication is determined to be successful; otherwise, the identity authentication is determined to be unsuccessful.
[0134] As described in the above steps S2110 to S2119, the steps of calling the preset legal face image and legal fingerprint image to perform identity authentication processing on the user based on the face image and the fingerprint image, and judging whether the identity authentication is passed, may specifically include: firstly, performing liveness detection on the user, and judging whether the liveness detection is passed. Wherein, liveness detection refers to the detection operation used to determine whether the user is a real live person during the process of identity authentication of the user. The detailed process of performing liveness detection on the user may be: the user, according to the guidance of the identity authentication instruction information, aligns with the preset head frame, completes the combined actions of blinking, opening the mouth, shaking the head, nodding, etc., and uses the facial key point positioning and combined with the face tracking and other technologies to verify whether the user is a real live person. Performing liveness detection on the user can prevent the user from using masks, photos or other methods to deceive the camera to commit fraud. If the liveness detection is passed, the pre-stored legal face image is obtained, and it is judged whether there is a specified face image matching the face image among all the legal face images. Wherein, the legal face image is the face image of the user who has been legally registered and has a legal identity. If the designated face image exists, the designated user information corresponding to the designated face image is obtained. Then, the designated fingerprint image corresponding to the designated finger is screened out from all the pre-stored legal fingerprint images corresponding to the designated user information. The process of determining the designated fingerprint image may include: comparing the blocks containing the middle part of the fingerprint in all the first sub-blocks obtained by dividing the fingerprint image with the middle parts of the fingerprints in multiple pre-stored legal fingerprint images, and determining the target fingerprint image with the highest similarity to the block containing the middle part of the fingerprint from all the legal fingerprint images, and using it as the designated fingerprint image corresponding to the designated finger. After the designated fingerprint image is obtained, the finger fingerprint area in the fingerprint image is divided into multiple first sub-blocks according to a preset block division rule, and the finger fingerprint area in the designated fingerprint image is divided into multiple corresponding second sub-blocks based on the block division rule. There is no specific limitation on the block division rule, and it is only necessary to ensure that the block division rule of the obtained second sub-block is the same as the block division rule of the obtained first sub-block. For example, the block division rule may adopt a cross-shaped division method, a cross-shaped division method, and the like. Then, a first number of the first sub-blocks and a second number of preset similarity algorithms are obtained, and it is determined whether the first number is less than the second number. The similarity algorithm may be an existing image similarity algorithm. If it is less than the second number, a first number of target similarity algorithms are selected from the similarity algorithms, and a one-to-one mapping relationship is generated between each of the target similarity algorithms and each of the first sub-blocks. Multiple target similarity algorithms of the same number as the first number may be randomly selected from the similarity algorithms.Subsequently, based on the mapping relationship, each target similarity algorithm is used to perform a one-to-one comparison process on all the first sub-blocks contained in the fingerprint image and all the second sub-blocks contained in the specified fingerprint image, and multiple similarities after the comparison process are obtained. Among them, the comparison process can be a process of using an image similarity algorithm to calculate the similarity. Finally, the similarities obtained by each target similarity algorithm are compared with the similarity threshold of each target similarity algorithm to determine whether each similarity is greater than the corresponding similarity threshold. Among them, the value of the similarity threshold of each target similarity algorithm is not limited and can be set according to actual needs. If they are all greater than the corresponding similarity threshold, it is determined that the identity authentication is passed, otherwise it is determined that the identity authentication is not passed. In this embodiment, by adopting multiple identity authentication methods such as liveness detection, face image comparison and fingerprint image comparison to achieve accurate identity authentication processing for users, the accuracy and reliability of identity authentication are effectively improved, and adverse consequences caused by responding to interface regression test requests triggered by illegal users are avoided, and the standardization and security of the interface regression test process are effectively guaranteed.
[0135] Furthermore, in an embodiment of the present application, the above step S213 includes:
[0136] S2130: calling the classification tree model, the role authority level table, and the business operation authority level table;
[0137] S2131: inputting the user information into the classification tree model, and determining the role category corresponding to the user information through the classification tree model;
[0138] S2132: Determine a target authority level corresponding to the role category based on the role authority level table;
[0139] S2133: Acquire the permission level interval of the business operation corresponding to the execution of the regression test based on the business operation permission level table;
[0140] S2134: Determine whether the target authority level is within the authority level range;
[0141] S2135: If it is within the permission level range, it is determined that the permission verification has passed; otherwise, it is determined that the permission verification has not passed.
[0142] As described in the above steps S2130 to S2135, the steps of calling the preset classification tree model, the role authority level table and the business operation authority level table based on the user information to perform authority verification processing on the user, and judging whether the authority verification is passed, may specifically include: first calling the classification tree model, the role authority level table and the business operation authority level table. Wherein, the classification tree model is a pre-created model, and each node except the leaf node in the classification tree model corresponds to a classification rule, and each classification rule classifies a type of data in the user information. In addition, a role authority level table is pre-created, and the role authority level table records the authority level corresponding to each role category one by one. And a business operation authority level table is pre-created, and the business operation authority level table records the authority level interval corresponding to each business operation one by one. Specifically, the user information can be classified layer by layer through the classification tree model, and finally the user information is assigned to a leaf node, and the leaf node corresponds to a role category. Afterwards, according to the preset correspondence between the leaf node and the authority level, the target authority level corresponding to the user information can be determined. For example, if the user information includes: "Job level: 8, business department: B, business task: 6", if the root node of the classification tree model is classified by "job level", the second-level node is classified by "business department", and the third-level node is classified by "business task", then through the three-level classification, the user information can be assigned to a leaf node, and then the role category corresponding to the user information can be obtained. Among them, according to the correspondence between the role category and the authority level in the role authority level table, the target authority level corresponding to the role category of the user information can be queried from the color authority level table. Then the user information is input into the classification tree model, and the role category corresponding to the user information is determined by the classification tree model. Then the target authority level corresponding to the role category is determined based on the role authority level table. Subsequently, the authority level interval of the business operation corresponding to the execution of the regression test is obtained based on the business operation authority level table. Finally, it is determined whether the target authority level is within the authority level interval. If it is within the authority level interval, it is determined that the authority verification has passed, otherwise it is determined that the authority verification has not passed. In this embodiment, a classification tree model is used to quickly obtain the target authority level corresponding to the user information, and then the user's target authority level is numerically compared with the authority level range of the business operation corresponding to the regression test to obtain the corresponding comparison result, and then it can be accurately and quickly determined whether the user has passed the authority verification based on the comparison result.Only when the user has passed the identity verification and the permission verification, will the subsequent response to the interface regression test request input by the user be made. This can effectively avoid the situation where the system regression test function is provided to illegal users or unauthorized users, improve the standardization and rationality of processing interface regression test requests, and ensure the security of the interface regression test processing process.
[0143] The interface-based regression testing method in the embodiment of the present application can also be applied to the blockchain field, such as storing the above-mentioned specified test results and other data on the blockchain. By using the blockchain to store and manage the above-mentioned specified test results, the security and non-tamperability of the above-mentioned specified test results can be effectively guaranteed.
[0144] The above-mentioned blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0145] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and the maintenance of the correspondence between the user's real identity and the blockchain address (authority management), etc., and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first adapts the interface for parsing and authentication (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network monitoring, node equipment health monitoring, etc.
[0146] Reference Figure 2 In one embodiment of the present application, there is also provided an interface-based regression testing device, including:
[0147] A receiving module 1, used for receiving a triggered regression test request corresponding to an interface of a target system to be tested;
[0148] Pulling module 2, used to pull interface information of all interfaces included in the target system from a preset database;
[0149] A first acquisition module 3, configured to acquire, for each designated interface in the target system, designated interface information of the designated interface from all the interface information;
[0150] A construction module 4, configured to construct an interface request corresponding to the specified interface based on the specified interface information;
[0151] Testing module 5, used for performing regression testing on the specified interface based on the interface request to obtain a specified test result corresponding to the specified interface;
[0152] The generating module 6 is used to generate an interface regression test analysis report of the target system based on the specified test result of each of the specified interfaces.
[0153] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the interface-based regression testing method in the aforementioned implementation mode, and are not described in detail here.
[0154] Furthermore, in one embodiment of the present application, the above-mentioned interface-based regression testing device includes:
[0155] A second acquisition module is used to obtain an interface regression test evaluation result corresponding to the target system within a preset time period; wherein the number of the interface regression test evaluation results includes a plurality of results, and the interface regression test evaluation results include that all interfaces have passed the regression test or that all interfaces have not passed the regression test;
[0156] A screening module, used for screening out first results, which are those in which all interfaces have passed the regression test, from all the interface regression test evaluation results, and obtaining a first number of the first results;
[0157] A third acquisition module is used to obtain a second number of all the interface regression test evaluation results;
[0158] A calculation module, used for calculating a quotient of the first quantity and the second quantity to obtain a regression test pass rate;
[0159] A judgment module, used to judge whether the regression test pass rate is greater than a preset pass rate threshold;
[0160] A first execution module, configured to execute the step of pulling interface information of all interfaces included in the target system from a preset database if the pass rate is less than the pass rate threshold;
[0161] A processing module is used to obtain the code change record corresponding to the target system if it is greater than the pass rate threshold, perform regression testing on the target interface corresponding to the code change record in the target system, and generate a corresponding target interface regression test analysis report based on the target test result corresponding to the target interface.
[0162] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the interface-based regression testing method in the aforementioned implementation mode, and are not described in detail here.
[0163] Furthermore, in one embodiment of the present application, the processing module includes:
[0164] A first acquisition unit, configured to acquire a code change record of the target system based on a preset component;
[0165] A search unit, used to search for a target interface corresponding to the code change record from all interfaces included in the target system;
[0166] A second acquiring unit, configured to acquire target interface information of the target interface;
[0167] A construction unit, configured to construct a target interface request corresponding to the target interface based on the target interface information;
[0168] A testing unit, configured to perform a regression test on the target interface based on the target interface request, and obtain a target test result corresponding to the target interface;
[0169] The first generating unit is used to generate a target interface regression test analysis report corresponding to the target system based on the target test result.
[0170] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the interface-based regression testing method in the aforementioned implementation mode, and are not described in detail here.
[0171] Furthermore, in one embodiment of the present application, the test module 5 includes:
[0172] A sending unit, configured to initiate the interface request to the designated interface;
[0173] A first judgment unit, used to judge whether an output result returned by the designated interface is received;
[0174] A second generating unit is used to generate a first specified test result indicating that the interface corresponding to the specified interface has failed the regression test if the output result is not received;
[0175] A parsing unit, configured to parse the specified output parameter from the specified interface information corresponding to the specified interface if the output result is received;
[0176] A second judging unit, used to judge whether the output result is the same as the specified output parameter;
[0177] a third generating unit, configured to generate, if the specified output parameter is the same as the specified output parameter, a second specified test result that an interface corresponding to the specified interface passes the regression test;
[0178] The fourth generating unit is used to generate a third specified test result indicating that the interface corresponding to the specified interface fails the regression test if the interface is different from the specified output parameter.
[0179] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the interface-based regression testing method in the aforementioned implementation mode, and are not described in detail here.
[0180] Furthermore, in one embodiment of the present application, the above-mentioned interface-based regression testing device includes:
[0181] A fourth acquisition module, used to acquire a face image of a user and a fingerprint image corresponding to a designated finger of the user;
[0182] A first verification module is used to call a preset legal face image and a legal fingerprint image to perform identity authentication processing on the user based on the face image and the fingerprint image, and determine whether the identity authentication is passed;
[0183] An extraction module, used for extracting the user information from the regression test request if the identity authentication is passed;
[0184] A second verification module is used to call a preset classification tree model, a role authority level table, and a business operation authority level table to perform authority verification processing on the user based on the user information, and determine whether the authority verification is passed;
[0185] The second execution module is used to execute the step of pulling the interface information of all interfaces included in the target system from the preset database if the authority verification is passed.
[0186] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the interface-based regression testing method in the aforementioned implementation mode, and are not described in detail here.
[0187] Furthermore, in one embodiment of the present application, the first verification module includes:
[0188] A detection unit, used to perform liveness detection on the user and determine whether the liveness detection is passed;
[0189] A third judgment unit is used to obtain the pre-stored legal face image if the liveness detection passes, and judge whether there is a designated face image matching the face image among all the legal face images;
[0190] A third acquisition unit, configured to acquire designated user information corresponding to the designated face image if the designated face image exists;
[0191] A first screening unit, configured to screen out a designated fingerprint image corresponding to the designated finger from all the pre-stored legal fingerprint images corresponding to the designated user information;
[0192] a division unit, configured to divide the finger fingerprint area in the fingerprint image into a plurality of first sub-blocks according to a preset block division rule, and to divide the finger fingerprint area in the designated fingerprint image into a plurality of corresponding second sub-blocks based on the block division rule;
[0193] a fourth determination unit, configured to obtain a first number of the first sub-blocks and a second number of a preset similarity algorithm, and determine whether the first number is less than the second number;
[0194] A second screening unit is configured to screen a first number of target similarity algorithms from the similarity algorithms if the number is less than the second number, and generate a one-to-one mapping relationship between each of the target similarity algorithms and each of the first sub-blocks;
[0195] A comparison unit, configured to perform one-to-one comparison processing on all first sub-blocks included in the fingerprint image and all second sub-blocks included in the designated fingerprint image using each of the target similarity algorithms based on the mapping relationship, to obtain a plurality of similarities after the comparison processing;
[0196] A fifth judgment unit, configured to compare the similarities obtained by each of the target similarity algorithms with the similarity thresholds of each of the target similarity algorithms, and judge whether each of the similarities is greater than the corresponding similarity threshold;
[0197] The first determination unit is configured to determine that the identity authentication is passed if both are greater than a corresponding similarity threshold, and otherwise determine that the identity authentication is not passed.
[0198] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the interface-based regression testing method in the aforementioned implementation mode, and are not described in detail here.
[0199] Furthermore, in one embodiment of the present application, the second verification module includes:
[0200] A calling unit, used for calling the classification tree model, the role authority level table and the business operation authority level table;
[0201] A first determining unit, configured to input the user information into the classification tree model, and determine a role category corresponding to the user information through the classification tree model;
[0202] A second determining unit, configured to determine a target authority level corresponding to the role category based on the role authority level table;
[0203] A fourth acquisition unit, configured to acquire, based on the business operation authority level table, an authority level interval of a business operation corresponding to executing the regression test;
[0204] A sixth determination unit, configured to determine whether the target authority level is within the authority level range;
[0205] The second determination unit is configured to determine that the authority verification has passed if the permission level is within the permission level range, and otherwise determine that the authority verification has failed.
[0206] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the interface-based regression testing method in the aforementioned implementation mode, and are not described in detail here.
[0207] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface, a display screen, an input device and a database connected through a system bus. Among them, the processor designed for the computer device is used to provide computing and control capabilities. The memory of the computer device includes a storage medium and an internal memory. The storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the storage medium. The database of the computer device is used to store interface information, interface requests, specified test results and interface regression test analysis reports. The network interface of the computer device is used to communicate with an external terminal through a network connection. The display screen of the computer device is an indispensable graphic output device in the computer, which is used to convert digital signals into optical signals so that text and graphics are displayed on the screen of the display screen. The input device of the computer device is the main device for information exchange between the computer and the user or other devices, and is used to transmit data, instructions and certain flag information to the computer. When the computer program is executed by the processor, an interface-based regression testing method is implemented.
[0208] The processor executes the following steps of the interface-based regression testing method:
[0209] receiving a triggered regression test request corresponding to an interface of a target system to be tested;
[0210] Pulling interface information of all interfaces included in the target system from a preset database;
[0211] For each designated interface in the target system, acquiring designated interface information of the designated interface from all the interface information;
[0212] Constructing an interface request corresponding to the specified interface based on the specified interface information;
[0213] Performing a regression test on the designated interface based on the interface request to obtain a designated test result corresponding to the designated interface;
[0214] Based on the specified test results of each of the specified interfaces, an interface regression test analysis report of the target system is generated.
[0215] Those skilled in the art will understand that Figure 3 The structure shown in is merely a block diagram of a portion of the structure related to the present application scheme, and does not constitute a limitation on the devices and computer equipment to which the present application scheme is applied.
[0216] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, an interface-based regression testing method is implemented, specifically:
[0217] receiving a triggered regression test request corresponding to an interface of a target system to be tested;
[0218] Pulling interface information of all interfaces included in the target system from a preset database;
[0219] For each designated interface in the target system, acquiring designated interface information of the designated interface from all the interface information;
[0220] Constructing an interface request corresponding to the specified interface based on the specified interface information;
[0221] Performing a regression test on the designated interface based on the interface request to obtain a designated test result corresponding to the designated interface;
[0222] Based on the specified test results of each of the specified interfaces, an interface regression test analysis report of the target system is generated.
[0223] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in the present application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0224] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0225] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A regression testing method based on an interface, characterized in that: include: receiving a triggered regression test request corresponding to an interface of a target system to be tested; Pulling interface information of all interfaces included in the target system from a preset database; For each designated interface in the target system, acquiring designated interface information of the designated interface from all the interface information; Constructing an interface request corresponding to the specified interface based on the specified interface information; Performing a regression test on the designated interface based on the interface request to obtain a designated test result corresponding to the designated interface; Based on the specified test results of each of the specified interfaces, generate an interface regression test analysis report for the target system; Before the step of pulling interface information of all interfaces included in the target system from the preset database, the method includes: Obtaining an interface regression test evaluation result corresponding to the target system within a preset time period; wherein the number of the interface regression test evaluation results includes a plurality of results, and the interface regression test evaluation results include that all interfaces have passed the regression test or that all interfaces have not passed the regression test; Filter out a first result indicating that all interfaces have passed the regression test from all the interface regression test evaluation results, and obtain a first number of the first results; Obtaining a second number of all the interface regression test evaluation results; Calculate the quotient of the first quantity and the second quantity to obtain the regression test pass rate; Determine whether the regression test pass rate is greater than a preset pass rate threshold; If the number of interfaces is less than the pass rate threshold, executing the step of pulling interface information of all interfaces included in the target system from the preset database; If it is greater than the pass rate threshold, obtaining the code change record corresponding to the target system, performing regression testing on the target interface corresponding to the code change record in the target system, and generating a corresponding target interface regression testing analysis report based on the target test result corresponding to the target interface; The regression test request carries the user information of the user, and before the step of pulling the interface information of all interfaces included in the target system from the preset database, the method includes: Acquire a facial image of a user, and acquire a fingerprint image corresponding to a designated finger of the user; Based on the face image and the fingerprint image, calling a preset legal face image and a legal fingerprint image to perform identity authentication processing on the user, and judging whether the identity authentication is passed; If the identity authentication is passed, extracting the user information from the regression test request; Based on the user information, calling a preset classification tree model, a role authority level table, and a business operation authority level table to perform authority verification processing on the user, and determining whether the authority verification is passed; If the authority verification is passed, the step of pulling the interface information of all interfaces included in the target system from the preset database is executed.
2. The interface-based regression testing method according to claim 1, characterized in that: The step of obtaining a code change record corresponding to the target system, performing regression testing on a target interface corresponding to the code change record in the target system, and generating a corresponding target interface regression testing analysis report based on a target testing result corresponding to the target interface includes: Obtaining a code change record of the target system based on a preset component; Finding a target interface corresponding to the code change record from all interfaces included in the target system; Acquire target interface information of the target interface; constructing a target interface request corresponding to the target interface based on the target interface information; Performing a regression test on the target interface based on the target interface request to obtain a target test result corresponding to the target interface; A target interface regression test analysis report corresponding to the target system is generated based on the target test result.
3. The interface-based regression testing method according to claim 1, characterized in that: The step of performing a regression test on the designated interface based on the interface request to obtain a designated test result corresponding to the designated interface includes: Initiating the interface request to the designated interface; Determine whether the output result returned by the specified interface is received; If the output result is not received, generating a first designated test result indicating that the interface corresponding to the designated interface has failed the regression test; If the output result is received, the specified output parameter is parsed from the specified interface information corresponding to the specified interface; Determining whether the output result is the same as the specified output parameter; If the specified output parameter is the same as the specified output parameter, generating a second specified test result indicating that the interface corresponding to the specified interface passes the regression test; If it is different from the designated output parameter, a third designated test result is generated indicating that the interface corresponding to the designated interface fails the regression test.
4. The interface-based regression testing method according to claim 1, characterized in that: The step of calling a preset legal face image and a legal fingerprint image to perform identity authentication processing on the user based on the face image and the fingerprint image, and judging whether the identity authentication is passed, comprises: Performing liveness detection on the user and determining whether the liveness detection passes; If the liveness detection passes, obtain the pre-stored legal face image, and determine whether there is a specified face image matching the face image among all the legal face images; If the specified face image exists, obtaining the specified user information corresponding to the specified face image; Filtering out a designated fingerprint image corresponding to the designated finger from all the pre-stored legal fingerprint images corresponding to the designated user information; Dividing the finger fingerprint area in the fingerprint image into a plurality of first sub-blocks according to a preset block division rule, and dividing the finger fingerprint area in the designated fingerprint image into a plurality of corresponding second sub-blocks based on the block division rule; Obtaining a first number of the first sub-blocks and a second number of a preset similarity algorithm, and determining whether the first number is less than the second number; If it is less than the second number, selecting a first number of target similarity algorithms from the similarity algorithms, and generating a one-to-one mapping relationship between each of the target similarity algorithms and each of the first sub-blocks; Based on the mapping relationship, using each of the target similarity algorithms, a one-to-one comparison process is performed on all the first sub-blocks included in the fingerprint image and all the second sub-blocks included in the designated fingerprint image to obtain a plurality of similarities after the comparison process; Compare the similarities obtained by each of the target similarity algorithms with the similarity thresholds of each of the target similarity algorithms to determine whether each of the similarities is greater than the corresponding similarity threshold; If both are greater than the corresponding similarity threshold, the identity authentication is determined to be successful; otherwise, the identity authentication is determined to be unsuccessful.
5. The interface-based regression testing method according to claim 1, characterized in that: The step of calling a preset classification tree model, a role authority level table, and a business operation authority level table to perform authority verification processing on the user based on the user information, and determining whether the authority verification is passed, includes: Calling the classification tree model, the role authority level table and the business operation authority level table; Inputting the user information into the classification tree model, and determining the role category corresponding to the user information through the classification tree model; Determining a target authority level corresponding to the role category based on the role authority level table; Acquire the permission level interval of the business operation corresponding to the execution of regression test based on the business operation permission level table; Determining whether the target permission level is within the permission level range; If it is within the permission level range, it is determined that the permission verification has passed, otherwise it is determined that the permission verification has not passed.
6. An interface-based regression testing device, used to implement the method described in any one of claims 1 to 5, characterized in that: include: A receiving module, used for receiving a triggered regression test request corresponding to an interface of a target system to be tested; A pulling module, used to pull interface information of all interfaces included in the target system from a preset database; A first acquisition module, configured to acquire, for each designated interface in the target system, designated interface information of the designated interface from all the interface information; A construction module, used to construct an interface request corresponding to the specified interface based on the specified interface information; A testing module, used to perform a regression test on the specified interface based on the interface request to obtain a specified test result corresponding to the specified interface; A generation module is used to generate an interface regression test analysis report of the target system based on the specified test results of each of the specified interfaces.
7. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Test case generation method and device, computer equipment and storage medium
CN112527630A
Test data generation method and device, storage medium and electronic equipment
CN113391992A