CN114817055A - Regression testing method and device based on interface, computer equipment and storage medium - Google Patents

Regression testing method and device based on interface, computer equipment and storage medium Download PDF

Info

Publication number
CN114817055A
CN114817055A CN202210508982.XA CN202210508982A CN114817055A CN 114817055 A CN114817055 A CN 114817055A CN 202210508982 A CN202210508982 A CN 202210508982A CN 114817055 A CN114817055 A CN 114817055A
Authority
CN
China
Prior art keywords
interface
target
regression
specified
target system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210508982.XA
Other languages
Chinese (zh)
Inventor
韦叠凤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202210508982.XA priority Critical patent/CN114817055A/en
Publication of CN114817055A publication Critical patent/CN114817055A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to the technical field of artificial intelligence, and provides a regression testing method, a regression testing device, computer equipment and a storage medium based on an interface, wherein the method comprises the following steps: receiving a triggered regression test request corresponding to an interface of a target system to be tested; pulling interface information of all interfaces contained in a target system; for each appointed interface in the target system, acquiring appointed interface information of the appointed interface from all interface information; constructing an interface request corresponding to the specified interface based on the specified interface information; performing regression testing on the specified interface based on the interface request to obtain a corresponding specified testing result; and generating an interface regression test analysis report of the target system based on the specified test result of each specified interface. The method and the device can improve the testing efficiency of the regression testing of the system interface, and ensure the processing accuracy of the regression testing. The method and the device can also be applied to the field of block chains, and the data such as the specified test results can be stored on the block chains.

Description

Regression testing method and device based on interface, computer equipment and storage medium
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a regression testing method and device based on an interface, computer equipment and a storage medium.
Background
Regression testing is particularly important for IT systems, especially systems with complex business logic. A small modification may affect many functional points, and if regression testing is not performed on the associated module, the potential risk of function unavailability exists. If the bug is not covered and repaired in the regression testing stage, once the bug is released to production, the normal use of the related functions of the user can be influenced. Production problems generally need to be repaired through a temporary emergency version, project operation cost is increased invisibly, and satisfaction degree of project system operators to the system is greatly reduced. The interface regression test is the last stage before the system is on-line, is a comprehensive regression test, can ensure that the new function can be on-line normally under the condition that the iteration of the system is frequent, and ensures the accuracy of the new function and the old function without influencing the original function. Therefore, a simple and efficient regression testing tool is very important.
Currently, existing regression testing tools such as TestingWhiz, SahiPro, TestComplete, etc. need testers to record operation flows/scripts in advance in the corresponding regression testing tool, insert assertions, execute operations, and finally generate reports, etc. when performing regression testing of system interfaces, a large amount of time and labor cost are consumed, testing efficiency is low, and an operation error easily occurs in a manual recording mode, so that the accuracy of regression testing cannot be guaranteed.
Disclosure of Invention
The application mainly aims to provide a regression testing method and device based on an interface, computer equipment and a storage medium, and aims to solve the technical problems that the existing regression testing mode for executing the system interface is low in testing efficiency and the testing accuracy cannot be guaranteed.
The application provides an interface-based regression testing method, which comprises the following steps:
receiving a triggered regression test request corresponding to an interface of a target system to be tested;
interface information of all interfaces contained in the target system is pulled from a preset database;
for each appointed interface in the target system, acquiring appointed interface information of the appointed interface from all the interface information;
constructing an interface request corresponding to the specified interface based on the specified interface information;
performing regression testing on the designated interface based on the interface request to obtain a designated testing result corresponding to the designated interface;
and generating an interface regression test analysis report of the target system based on the specified test result of each specified interface.
Optionally, before the step of pulling the interface information of all the 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; the number of the interface regression test evaluation results comprises a plurality of interface regression test evaluation results, wherein the interface regression test evaluation results comprise that the interfaces pass the regression test or that the interfaces do not pass the regression test;
screening out a first result with the content of the regression test passing through the interfaces from all the interface regression test evaluation results, and acquiring a first number of the first result;
obtaining a second number of the evaluation results of the regression tests of all the interfaces;
calculating a quotient value of the first quantity and the second quantity to obtain a regression test passing rate;
judging whether the regression test passing rate is greater than a preset passing rate threshold value or not;
if the pass rate is smaller than the pass rate threshold, the step of pulling the interface information of all the interfaces contained in the target system from a preset database is executed;
and if the pass rate is larger than the pass rate threshold value, acquiring a code change record corresponding to the target system, performing regression test processing on a target interface corresponding to the code change record in the target system, and generating a corresponding regression test analysis report of the target interface based on a target test result corresponding to the target interface.
Optionally, the step of obtaining a code change record corresponding to the target system, performing regression testing processing on a target interface corresponding to the code change record in the target system, and generating a corresponding regression testing analysis report of the target interface based on a target testing result corresponding to the target interface includes:
acquiring a code change record of the target system based on a preset component;
searching a target interface corresponding to the code change record from all interfaces contained in the target system;
acquiring target interface information of the target interface;
constructing a target interface request corresponding to the target interface based on the target interface information;
performing regression testing on the target interface based on the target interface request to obtain a target testing result corresponding to the target interface;
and generating a target interface regression test analysis report corresponding to the target system based on the target test result.
Optionally, the step of performing regression testing 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;
judging whether an output result returned by the specified interface is received or not;
if the output result is not received, generating a first appointed test result that the interface corresponding to the appointed interface does not pass the regression test;
if the output result is received, analyzing the appointed output parameter from the appointed interface information corresponding to the appointed interface;
judging whether the output result is the same as the specified output parameter or not;
if the output parameters are the same as the specified output parameters, generating a second specified test result that the interface corresponding to the specified interface passes the regression test;
and if the output parameters are different from the specified output parameters, generating a third specified test result that the interface corresponding to the specified interface does not pass the regression test.
Optionally, the step of retrieving, from a preset database, interface information of all interfaces included in the target system includes:
acquiring a face image of a user and acquiring a fingerprint image corresponding to an appointed finger of the user;
calling a preset legal face image and a preset legal fingerprint image to perform authentication processing on the user based on the face image and the fingerprint image, and judging whether the authentication passes or not;
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 carry out authority verification processing on the user, and judging whether authority verification passes;
and if the authority passes the verification, executing the step of pulling the interface information of all the interfaces contained in the target system from a preset database.
Optionally, the step of calling a preset legal face image and a preset legal fingerprint image to perform authentication processing on the user based on the face image and the fingerprint image, and determining whether the authentication passes or not includes:
performing living body detection on the user and judging whether the living body detection is passed;
if the living body detection is passed, acquiring the pre-stored legal face images, and judging whether designated face images matched with the face images exist in all the legal face images or not;
if the designated face image exists, acquiring designated user information corresponding to the designated face image;
screening out a designated fingerprint image corresponding to the designated finger from all the prestored legal fingerprint images corresponding to the designated user information;
dividing a 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;
acquiring a first number of the first sub-blocks and a second number of a preset similarity algorithm, and judging whether the first number is smaller than the second number;
if the number of the target similarity algorithms is smaller than the second number, screening a first number of target similarity algorithms from the similarity algorithms, and generating a one-to-one mapping relation between each target similarity algorithm and each first sub-block;
on the basis of the mapping relation, performing one-to-one corresponding comparison processing on all first sub-blocks contained in the fingerprint image and all second sub-blocks contained in the designated fingerprint image by using each target similarity algorithm to obtain a plurality of similarities after comparison processing;
comparing the similarity obtained by each target similarity algorithm with the similarity threshold of each target similarity algorithm respectively, and judging whether each similarity is greater than the corresponding similarity threshold;
and if the similarity values are larger than the corresponding similarity threshold values, judging that the identity authentication is passed, otherwise, judging that the identity authentication is not passed.
Optionally, the step of calling a preset classification tree model, a role permission level table and a service operation permission level table to perform permission verification processing on the user based on the user information, and determining whether permission verification passes includes:
calling the classification tree model, the role authority level table and the service 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 permission level corresponding to the role category based on the role permission level table;
acquiring an authority level interval of the service operation corresponding to the regression test based on the service operation authority level table;
judging whether the target permission level is in the permission level interval or not;
and if the authority level interval is within the authority level interval, judging that the authority verification is passed, otherwise, judging that the authority verification is not passed.
The present application further provides a regression testing apparatus based on an interface, including:
the receiving module is used for receiving a triggered regression testing request corresponding to an interface of a target system to be tested;
the pulling module is used for pulling the interface information of all the interfaces contained in the target system from a preset database;
the first acquisition module is used for acquiring the specified interface information of the specified interface from all the interface information for each specified interface in the target system;
the construction module is used for constructing an interface request corresponding to the specified interface based on the specified interface information;
the test module is used for carrying out regression test on the specified interface based on the interface request to obtain a specified test result corresponding to the specified interface;
and the generating module is used for generating an interface regression test analysis report of the target system based on the specified test result of each specified interface.
The present application further provides a computer device, comprising 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.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method.
The interface-based regression testing method, device, computer equipment and storage medium provided by the application have the following beneficial effects:
according to the regression testing method, device, computer equipment and storage medium based on the interfaces, when an interface regression testing request corresponding to a target system to be tested is received, interface information of all interfaces contained in the target system is pulled from a preset database, then, for each designated interface in the target system, designated interface information of the designated interface is obtained from all the interface information, then, an interface request corresponding to the designated interface is constructed based on the designated interface information, then, regression testing is carried out on the designated interface based on the interface request, designated testing results corresponding to the designated interface are obtained, and finally, an interface regression testing analysis report of the target system is generated based on the designated testing results of each designated interface. By the aid of the regression testing method and the regression testing device, regression testing of the interface of the target system can be automatically achieved, a large amount of processes of manually inputting information before testing can be omitted, workload of testers is reduced, misoperation in manual recording is avoided, testing time and labor cost of the testers are saved, testing efficiency of regression testing is effectively improved, processing accuracy of regression testing is guaranteed, and user experience is improved.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating an interface-based regression testing method according to an embodiment of the present application;
FIG. 2 is a schematic structural diagram of an interface-based regression testing apparatus according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
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 commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
Referring to fig. 1, an interface-based regression testing method according to an embodiment of the present application includes:
s10: receiving a triggered regression test request corresponding to an interface of a target system to be tested;
s20: interface information of all interfaces contained in the target system is pulled from a preset database;
s30: for each appointed interface in the target system, acquiring appointed interface information of the appointed interface from all the interface information;
s40: constructing an interface request corresponding to the specified interface based on the specified interface information;
s50: performing regression testing on the designated interface based on the interface request to obtain a designated testing result corresponding to the designated interface;
s60: and generating an interface regression test analysis report of the target system based on the specified test result of each specified interface.
As described in steps S10-S60, the subject of the present method embodiment is an interface-based regression testing apparatus. In practical applications, the regression testing apparatus based on the interface may be implemented by a virtual apparatus, such as a software code, or by an entity apparatus written or integrated with a relevant execution code, and may perform human-computer interaction with a user through a keyboard, a mouse, a remote controller, a touch panel, or a voice control device. The regression testing device based on the interface in the embodiment can automatically realize the regression testing of the interface of the target system, effectively improves the testing efficiency of the regression testing of the system interface, ensures the processing accuracy of the regression testing, and is beneficial to improving the user experience. Specifically, a triggered regression test request corresponding to an interface of a target system to be tested is first received. The regression test request refers to a request for performing regression test on an interface of a target system to be tested, which is triggered by a current user. The target system to be tested is an iterative version target system, namely, a target system obtained by performing code modification on an original stable version target system, and can also be called a test system after code iteration.
And then pulling the interface information of all the interfaces contained in the target system from a preset database. For the target system, in each iterative version system test stage, interface information of all interfaces included in the target system can be automatically intercepted and recorded based on AOP (Aspect organized Programming), the interface information can include information such as entry, exit, URL, request mode, and the like, 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 one-time iteration version of the target system, the previous interface information of other versions can be deleted. Additionally, all interfaces included with the target system may refer to the active interfaces of the target system. In addition, a preset automation script can be run to pull the interface information of all the interfaces included in the target system from a preset database, and the automation script can be a processing logic code script generated by relevant personnel according to actual service use requirements, such as requirements for pulling the interface information of all the interfaces included in the target system from the preset database.
And then, for each appointed interface in the target system, acquiring appointed interface information of the appointed interface from all the interface information. The interface information of each interface used in the target system can be acquired from the database. The interface information comprises input parameters, request modes and output parameters of each interface corresponding to the target system of the stable version before upgrading. And subsequently constructing an interface request corresponding to the specified interface based on the specified interface information. The information of the designated interface at least comprises input parameters, output parameters and a request mode of the designated interface. The interface request is a test request for regression testing of a target system to be tested. The input parameters are the same as the input parameters in the target system before upgrading. In addition, the format of the test request to be generated may be different for different test requirements, for example, the test for the query interface in the target system may be a request in the HTTP format. The step of constructing the interface request corresponding to the designated interface based on the designated interface information means that the interface request corresponding to the designated interface is constructed by using a preset template based on the input parameters and the request mode in the designated interface information. The preset template is data in a JSON (lightweight data exchange format) format. Specifically, all input parameters are placed in a value corresponding to a name of "params" in the preset template, and a request mode is stored in a value corresponding to a name of "method" to generate the interface request.
And after the interface request is obtained, performing regression testing on the specified interface based on the interface request to obtain a specified testing result corresponding to the specified interface. After receiving the interface request, the specified interface to be tested can obtain the value corresponding to the 'params' through an operation API (application programming interface special for processing JSON data) of JSON, perform service processing on the value corresponding to the 'params', and finally return an output result, wherein the output result is a test result corresponding to the interface request. And if the generated output result meets the requirement of the output parameter, the test is passed. The requirement of meeting the output parameter may mean that the output result is the same as the output parameter. And finally, generating an interface regression test analysis report of the target system based on the specified test result of each specified interface. The method comprises the steps of determining a first interface passing regression testing and a second interface failing regression testing based on specified testing results of all specified interfaces, and generating an interface regression testing analysis report of the target system based on the first interface and the second interface. Specifically, a regression testing template may be created in advance, the verified interface filling plate and the unverified interface filling plate are disposed in the template, and the interface regression testing analysis report of the target system may be generated by correspondingly filling the first interface and the second interface into corresponding positions in the template. In addition, the interfaces with abnormity can be screened out based on the interface regression test analysis report, so that the part of the interfaces with abnormity can be repaired in time, and the new version system can be ensured to be on line smoothly.
In this embodiment, when an interface regression test request triggered by a user and corresponding to a target system to be tested is received, interface information of all interfaces included in the target system is first pulled from a preset database, then, for each specified interface in the target system, specified interface information of the specified interface is obtained from all the interface information, then, an interface request corresponding to the specified interface is constructed based on the specified interface information, then, a regression test is performed on the specified interface based on the interface request to obtain a specified test result corresponding to the specified interface, and finally, an interface regression test analysis report of the target system is generated based on the specified test result of each specified interface. The regression testing of the interface of the target system can be automatically realized through the embodiment, a large amount of manual information input processes before the testing can be omitted, the workload of testers is reduced, misoperation in manual recording is avoided, the testing time and the labor cost of the testers are saved, the testing efficiency of the regression testing is effectively improved, the processing accuracy of the regression testing is ensured, and the improvement of user experience is facilitated.
Further, in an embodiment of the present application, before the step S20, the method includes:
s200: obtaining an interface regression test evaluation result corresponding to the target system within a preset time period; the number of the interface regression test evaluation results comprises a plurality of interface regression test evaluation results, wherein the interface regression test evaluation results comprise that the interfaces pass the regression test or the interfaces do not pass the regression test;
s201: screening out a first result with the content of the regression test passing through the interfaces from all the interface regression test evaluation results, and acquiring a first number of the first result;
s202: obtaining a second number of the evaluation results of the regression tests of all the interfaces;
s203: calculating a quotient value of the first quantity and the second quantity to obtain a regression test passing rate;
s204: judging whether the regression test passing rate is greater than a preset passing rate threshold value or not;
s205: if the pass rate is smaller than the pass rate threshold, the step of pulling the interface information of all the interfaces contained in the target system from a preset database is executed;
s206: and if the pass rate is larger than the pass rate threshold value, acquiring a code change record corresponding to the target system, performing regression test processing on a target interface corresponding to the code change record in the target system, and generating a corresponding regression test analysis report of the target interface based on a target test result corresponding to the target interface.
As described in the above steps S200 to S206, before the step of pulling the interface information of all the interfaces included in the target system from the preset database, the method may further include: firstly, obtaining an interface regression test evaluation result corresponding to the target system in a preset time period. The number of the interface regression test evaluation results comprises a plurality of interface regression test evaluation results, and the interface regression test evaluation results comprise that the interfaces pass the regression test or the interfaces do not pass the regression test. In addition, the value of the preset time period is not specifically limited, and may be set according to actual requirements, for example, the value may be one month before the current time. In addition, the interface regression test evaluation result may be generated according to the interface regression test analysis report about the target system within a preset time period, and if all the interfaces included in any one of the interface regression test analysis reports pass the regression test, an interface regression test evaluation result may be generated that the interface corresponding to the interface regression test analysis report passes the regression test. If at least one interface which fails the regression test exists in all the interfaces contained in any one interface regression test analysis report, an interface regression test evaluation result that the interfaces corresponding to the interface regression test analysis report fail the regression test is generated. And then screening out the first results of which the interfaces pass the regression test from all the interface regression test evaluation results, and acquiring the first number of the first results. And then acquiring a second quantity of the evaluation results of the regression tests of all the interfaces. And subsequently calculating the quotient value of the first quantity and the second quantity to obtain the regression testing passing rate. And judging whether the regression test passing rate is greater than a preset passing rate threshold value or not. The value of the pass rate threshold is not particularly limited, and may be set according to actual requirements. If the calculated regression test passing rate is smaller than the passing rate threshold, it indicates that there are more bug which is easy to cause problems in the interface regression test of the target system, at this time, regression tests need to be performed on all interfaces included in the target system, so as to achieve the lowest risk of missing regression errors, increase the coverage of the regression test, and ensure the effectiveness of the regression test. If the regression test passing rate is greater than the passing rate threshold value, which indicates that the target system has run many regression tests and is unlikely to reveal new errors, then an appropriate strategy is intelligently selected to perform reduced regression tests, that is, only the target interface corresponding to the code change record in the target system is subjected to regression test processing, so that the huge workload caused by repeated interface regression tests can be effectively reduced, and the processing efficiency of the regression tests is improved. And if the pass rate is smaller than the pass rate threshold value, the step of pulling the interface information of all the interfaces contained in the target system from a preset database is executed. And if the pass rate is larger than the pass rate threshold value, acquiring a code change record corresponding to the target system, performing regression test processing on a target interface corresponding to the code change record in the target system, and generating a corresponding regression test analysis report of the target interface based on a target test result corresponding to the target interface. The specific process of performing regression testing processing on the target interface corresponding to the code change record in the target system and generating the corresponding regression testing analysis report of the target interface based on the target testing result corresponding to the target interface may refer to the foregoing processing on the specified interface, and is not described in detail herein. In this embodiment, different regression test strategies may be correspondingly adopted for the target system based on the difference in the interface regression test evaluation results regarding the target system within the preset time period, so that it is possible to avoid performing the regression test by using only one fixed test mode, and the intelligence of the interface regression test is effectively improved.
Further, in an embodiment of the application, the step S206 includes:
s2060: acquiring a code change record of the target system based on a preset component;
s2061: searching a target interface corresponding to the code change record from all interfaces contained in the target system;
s2062: acquiring target interface information of the target interface;
s2063: constructing a target interface request corresponding to the target interface based on the target interface information;
s2064: performing regression testing on the target interface based on the target interface request to obtain a target testing result corresponding to the target interface;
s2065: and generating a target interface regression test analysis report corresponding to the target system based on the target test result.
As described in the foregoing steps S2060 to S2065, the step of acquiring the code change record corresponding to the target system, performing regression testing processing on the target interface corresponding to the code change record in the target system, and generating a corresponding regression test analysis report of the target interface based on the target test result corresponding to the target interface may specifically include: firstly, acquiring a code change record of the target system based on a preset component. The code change record can be obtained through a preset component, and the preset component can be a functional module generated by writing a generated code by related personnel according to actual service use requirements, such as requirements for acquiring the code change record of the target system. And then finding out a target interface corresponding to the code change record from all interfaces contained in the target system. The target interface corresponding to the code change record can be found out from all interfaces through a preset algorithm, and the preset algorithm can be a processing logic code generated by relevant personnel according to actual service use requirements, such as requirements for finding out the target interface corresponding to the code change record. And then acquiring the target interface information of the target interface. And after the target interface information is obtained, constructing a target interface request corresponding to the target interface based on the target interface information. For the construction process of the target interface request, reference may be made to the aforementioned processing of the specified interface, which is not described in detail herein. And subsequently, performing regression testing on the target interface based on the target interface request to obtain a target testing result corresponding to the target interface. For the process of performing the regression test on the target interface based on the target interface request, the foregoing processing on the designated interface may be referred to, and details are not repeated herein. And finally, generating a target interface regression test analysis report corresponding to the target system based on the target test result. For the process of generating the regression test analysis report of the corresponding target interface based on the target test result, the foregoing processing of the designated interface may be referred to, and details are not repeated herein. In this embodiment, when it is detected that the regression test passing rate is greater than the passing rate threshold, it is determined that the target system has run many regression tests and is unlikely to reveal a new error, and at this time, an appropriate policy is intelligently selected to perform a reduced regression test, that is, only the interface corresponding to the code change record in the target system is subjected to the regression test, so that the workload of the interface regression test can be greatly reduced, and the processing intelligence of the regression test is effectively improved.
Further, in an embodiment of the application, the step S50 includes:
s500: initiating the interface request to the designated interface;
s501: judging whether an output result returned by the specified interface is received or not;
s502: if the output result is not received, generating a first appointed test result that the interface corresponding to the appointed interface does not pass the regression test;
s503: if the output result is received, analyzing the appointed output parameter from the appointed interface information corresponding to the appointed interface;
s504: judging whether the output result is the same as the specified output parameter or not;
s505: if the output parameters are the same as the specified output parameters, generating a second specified test result that the interface corresponding to the specified interface passes the regression test;
s506: and if the output parameters are different from the specified output parameters, generating a third specified test result that the interface corresponding to the specified interface does not pass the regression test.
As described in the foregoing steps S500 to S506, the step of performing regression testing on the designated interface based on the interface request to obtain a designated test result corresponding to the designated interface may specifically include: the interface request is first initiated to the specified interface. And then judging whether an output result returned by the specified interface is received. And the output result is generated after the interface regression test is carried out on the specified interface under the target system of the current test version by using the interface request. In addition, if the calling of the interfaces fails, an output result will not be returned, and the error reason can be positioned according to the error code corresponding to each interface. And if the output result is not received, generating a first specified test result that the interface corresponding to the specified interface does not pass the regression test. If the output result returned by the specified interface is not received, the calling of the specified interface is failed, the bug of the specified interface of the test system after code iteration is shown, and the test result that the interface corresponding to the specified interface fails in the test can be generated. And if the output result is received, analyzing the appointed output parameters from the appointed interface information corresponding to the appointed interface. And the specified output parameter is a result generated after the interface regression test is carried out on the specified interface under the target system with the stable version by using the interface request. And subsequently judging whether the output result is the same as the specified output parameter. And if the output parameters are the same as the specified output parameters, generating a second specified test result that the interface corresponding to the specified interface passes the regression test. And if the output parameters are different from the specified output parameters, generating a third specified test result that the interface corresponding to the specified interface does not pass the regression test. If the output result is different from the specified output parameter, it is indicated that bug occurs on the specified interface of the test system after code iteration, and a test result that the interface corresponding to the specified interface fails to pass the test can be generated. If the output result is the same as the specified output parameter, the result indicates that the specified interface under the target system of the test version has no problem compared with the previous stable version, the test version can still be called normally, and a test result that the interface corresponding to the specified interface passes the test can be generated. In this embodiment, the interface request is sent to the designated interface, and it is determined that the designated interface passes the regression test only when the designated interface returns an output result that is the same as the preset designated output parameter. And 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 is judged not to pass the regression test, so that the accuracy of the generated specified test result corresponding to the specified interface is effectively ensured, and the interface regression test analysis report of the target system can be quickly and accurately generated according to the obtained specified test result of each specified interface.
Further, in an embodiment of the present application, before the step S20, the method includes:
s210: acquiring a face image of a user and acquiring a fingerprint image corresponding to an appointed finger of the user;
s211: calling a preset legal face image and a preset legal fingerprint image to perform authentication processing on the user based on the face image and the fingerprint image, and judging whether the authentication passes or not;
s212: if the identity authentication is passed, extracting the user information from the regression test request;
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 carry out authority verification processing on the user, and judging whether authority verification passes;
s214: and if the authority verification is passed, executing the step of pulling the interface information of all the interfaces contained in the target system from a preset database.
As described in the foregoing steps S210 to S214, before the step of pulling the interface information of all interfaces included in the target system from the preset database, the step of carrying the user information of the user in the regression test request may further include: firstly, a face image of a user is obtained, and a fingerprint image corresponding to a designated finger of the user is obtained. The designated finger is not limited, and can be determined according to actual requirements, for example, the designated finger can be a middle finger of a right hand. And then calling a preset legal face image and a preset legal fingerprint image to perform authentication processing on the user based on the face image and the fingerprint image, and judging whether the authentication passes or not. For the specific implementation process of performing the authentication processing on the user based on the face image and the fingerprint image by calling the preset legal face image and legal fingerprint image, the present application will further describe details in the following specific embodiments, which are not set forth herein. And if the identity authentication is passed, extracting the user information from the regression test request. Wherein the user information may include name information of the user or id information of the user. And subsequently, based on the user information, calling a preset classification tree model, a role authority level table and a service operation authority level table to carry out authority verification processing on the user, and judging whether the authority verification passes. For the specific implementation process of invoking the preset classification tree model, the role permission level table and the service operation permission level table to perform permission verification processing on the user, further details will be described in the subsequent specific embodiments, and will not be elaborated herein. And if the authority passes the verification, executing the step of pulling the interface information of all the interfaces contained in the target system from a preset database. And if the identity authentication is not passed or the authority authentication is not passed, limiting the response processing of the regression test request. In the embodiment, after the regression test request corresponding to the interface of the target system and input by the user is received, the identity verification processing and the authority verification processing can be carried out on the user, and only when the user passes all verification, the interface regression test request input by the user can be subsequently responded, so that the condition that a system regression test function is provided for an illegal user or a user without authority can be effectively avoided, the normalization and the rationality of the regression test request processing are improved, and the safety in the interface regression test processing process is ensured.
Further, in an embodiment of the application, the step S211 includes:
s2110: performing living body detection on the user and judging whether the living body detection is passed;
s2111: if the living body detection is passed, acquiring the pre-stored legal face images, and judging whether designated face images matched with the face images exist in all the legal face images or not;
s2112: if the designated face image exists, acquiring designated user information corresponding to the designated face image;
s2113: screening out a designated fingerprint image corresponding to the designated finger from all the prestored legal fingerprint images corresponding to the designated user information;
s2114: dividing a 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;
s2115: acquiring a first number of the first sub-blocks and a second number of a preset similarity algorithm, and judging whether the first number is smaller than the second number;
s2116: if the number of the target similarity algorithms is smaller than the second number, screening a first number of target similarity algorithms from the similarity algorithms, and generating a one-to-one mapping relation between each target similarity algorithm and each first sub-block;
s2117: on the basis of the mapping relation, performing one-to-one corresponding comparison processing on all first sub-blocks contained in the fingerprint image and all second sub-blocks contained in the designated fingerprint image by using each target similarity algorithm to obtain a plurality of similarities after comparison processing;
s2118: comparing the similarity obtained by each target similarity algorithm with the similarity threshold of each target similarity algorithm respectively, and judging whether each similarity is greater than the corresponding similarity threshold;
s2119: and if the similarity values are larger than the corresponding similarity threshold values, judging that the identity authentication is passed, otherwise, judging that the identity authentication is not passed.
As described in the above steps S2110 to S2119, the step of calling a preset legal face image and a preset legal fingerprint image to perform authentication processing on the user based on the face image and the fingerprint image, and determining whether the authentication passes may specifically include: firstly, the living body detection is carried out on the user, and whether the living body detection is passed or not is judged. The living body detection refers to a detection operation for determining whether a user is a real living body in an identity verification process of the user. The detailed procedure for the in-vivo detection of the user may be: the user aims at the preset head and photo frame according to the guidance of the identity verification indication information, the combined actions of blinking, mouth opening, shaking, head pointing and the like are completed, and whether the user is operated by the real living body can be verified by using the technologies of face key point positioning, face tracking and the like. The use of a mask, photograph or other means of masking the camera by the user to effect fraud may be avoided by performing a liveness check on the user. And if the living body detection is passed, acquiring the pre-stored legal face images, and judging whether the specified face images matched with the face images exist in all the legal face images. The legal face image is the face image of the user with legal identity after legal registration. And if the appointed face image exists, acquiring appointed user information corresponding to the appointed face image. And then, a specified fingerprint image corresponding to the specified finger is screened out from all the prestored legal fingerprint images corresponding to the specified user information. Wherein the process of determining the specified fingerprint image may comprise: comparing blocks containing fingerprint middle parts in all first sub-blocks obtained by dividing the fingerprint image with fingerprint middle parts in a plurality of pre-stored legal fingerprint images, determining a target fingerprint image with the highest similarity with the blocks containing the fingerprint middle parts from all the legal fingerprint images, and taking the target fingerprint image as a specified fingerprint image corresponding to the specified finger. After the appointed fingerprint image is obtained, dividing a 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 appointed fingerprint image into a plurality of corresponding second sub-blocks based on the block division rule. The block division rule is not specifically limited, and it is only required to ensure that the obtained block division rule of the second sub-block is the same as the obtained block division rule of the first sub-block, for example, the block division rule may adopt a cross division manner, a Chinese character 'mi' type division manner, and the like. And then acquiring a first number of the first sub-blocks and a second number of a preset similarity algorithm, and judging whether the first number is smaller than the second number. Wherein the similarity algorithm may be an existing image similarity algorithm. If the number of the target similarity algorithms is smaller than the second number, a first number of target similarity algorithms are screened from the similarity algorithms, and a one-to-one mapping relation is generated between each target similarity algorithm and each first sub-block. Wherein a plurality of target similarity algorithms equal to the first number may be randomly screened from the similarity algorithms. And subsequently, based on the mapping relation, respectively performing one-to-one corresponding comparison processing on all first sub-blocks contained in the fingerprint image and all second sub-blocks contained in the designated fingerprint image by using each target similarity algorithm to obtain a plurality of similarity degrees after comparison processing. Wherein, the comparison processing may be processing of calculating the similarity by using an image similarity algorithm. And finally, comparing the similarity obtained by each target similarity algorithm with the similarity threshold of each target similarity algorithm respectively, and judging whether each similarity is greater than the corresponding similarity threshold. The value of the similarity threshold of each target similarity algorithm is not limited and can be set according to actual requirements. And if the similarity values are larger than the corresponding similarity threshold values, judging that the identity authentication is passed, otherwise, judging that the identity authentication is not passed. In the embodiment, the accurate identity verification processing of the user is realized by adopting multiple identity verification modes such as living body detection, face image comparison, fingerprint image comparison and the like, so that the accuracy and reliability of identity verification are effectively improved, adverse consequences caused by responding to an interface regression test request triggered by an illegal user are avoided, and the normalization and the safety in the interface regression test process are effectively ensured.
Further, in an embodiment of the application, the step S213 includes:
s2130: calling the classification tree model, the role authority level table and the service operation authority level table;
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;
s2132: determining a target permission level corresponding to the role category based on the role permission level table;
s2133: acquiring an authority level interval of the business operation corresponding to the regression test based on the business operation authority level table;
s2134: judging whether the target authority level is in the authority level interval or not;
s2135: and if the authority level interval is within the authority level interval, judging that the authority verification is passed, otherwise, judging that the authority verification is not passed.
As described in the above steps S2130 to S2135, the step of calling, based on the user information, a preset classification tree model, a role permission level table, and a service operation permission level table to perform permission verification processing on the user, and determining whether permission verification passes may specifically include: firstly, calling the classification tree model, the role authority level table and the service operation authority level table. The classification tree model is a pre-established model, each node except leaf nodes in the classification tree model corresponds to one classification rule, and each classification rule classifies one type of data in the user information. In addition, a role authority level table in which authority levels corresponding to respective role categories are recorded is created in advance. And a service operation authority level table is created in advance, and authority level intervals corresponding to each service operation one to one are recorded in the service operation authority level table. Specifically, the user information can be classified layer by layer through the classification tree model, and finally the user information is distributed to a leaf node, wherein the leaf node corresponds to a role category. And then, according to the corresponding relation between the preset leaf node and the authority level, the target authority level corresponding to the user information can be determined. For example, suppose the user information includes: "station level: 8, a business department: b, service task: and 6 ', if the root node of the classification tree model is classified through the ' post level ', the second level node is classified through the ' service department ', and the third level node is classified through the ' service task ', the user information can be distributed to a leaf node through three-layer classification, and then the role type corresponding to the user information is obtained. And then, according to the corresponding relation between the role type and the authority level in the role authority level table, the target authority level corresponding to the role type of the user information can be inquired from the color authority level table. And then inputting the user information into the classification tree model, and determining the role category corresponding to the user information through the classification tree model. And then determining a target permission level corresponding to the role category based on the role permission level table. And subsequently acquiring the authority level interval of the business operation corresponding to the regression test based on the business operation authority level table. And finally, judging whether the target authority level is in the authority level interval. And if the authority level interval is within the authority level interval, judging that the authority verification is passed, otherwise, judging that the authority verification is not passed. In the embodiment, the classification tree model is used for rapidly acquiring the target permission level corresponding to the user information, and then the target permission level of the user and the permission level interval of the business operation corresponding to the regression test are compared in a numerical value mode to obtain a corresponding comparison result, so that whether the user passes permission verification or not can be accurately and rapidly judged according to the comparison result. Only when the user passes the authentication and passes the authority authentication, the interface regression test request input by the user is responded subsequently, so that the condition that a system regression test function is provided for an illegal user or a user without authority can be effectively avoided, the normalization and the rationality of processing the interface regression test request are improved, and the safety in the interface regression test processing process is ensured.
The regression testing method based on the interface in the embodiment of the present application may also be applied to the field of block chains, for example, data such as the above specified test result is stored in the block chain. By using the block chain to store and manage the specified test result, the security and the non-tamper property of the specified test result can be effectively ensured.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The block chain underlying platform can comprise processing modules such as user management, basic service, intelligent contract and operation monitoring. The user management module is responsible for identity information management of all blockchain participants, and comprises public and private key generation maintenance (account management), key management, user real identity and blockchain address corresponding relation maintenance (authority management) and the like, and under the authorization condition, the user management module supervises and audits the transaction condition of certain real identities and provides rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node equipment and used for verifying the validity of the service request, recording the service request to storage after consensus on the valid request is completed, for a new service request, the basic service firstly performs interface adaptation analysis and authentication processing (interface adaptation), then encrypts service information (consensus management) through a consensus algorithm, transmits the service information to a shared account (network communication) completely and consistently after encryption, and performs recording and storage; the intelligent contract module is responsible for registering and issuing contracts, triggering the contracts and executing the contracts, developers can define contract logics through a certain programming language, issue the contract logics to a block chain (contract registration), call keys or other event triggering and executing according to the logics of contract clauses, complete the contract logics and simultaneously provide the function of upgrading and canceling the contracts; the operation monitoring module is mainly responsible for deployment, configuration modification, contract setting, cloud adaptation in the product release process and visual output of real-time states in product operation, such as: alarm, monitoring network conditions, monitoring node equipment health status, and the like.
Referring to fig. 2, an embodiment of the present application further provides an interface-based regression testing apparatus, including:
the device comprises a receiving module 1, a judging module and a judging module, wherein the receiving module is used for receiving a triggered regression test request corresponding to an interface of a target system to be tested;
the pulling module 2 is used for pulling the interface information of all the interfaces contained in the target system from a preset database;
a first obtaining module 3, configured to obtain, for each specified interface in the target system, specified interface information of the specified interface from all the interface information;
a constructing module 4, configured to construct an interface request corresponding to the specified interface based on the specified interface information;
the test module 5 is used for performing regression test on the specified interface based on the interface request to obtain a specified test result corresponding to the specified interface;
and the generating module 6 is used for generating an interface regression test analysis report of the target system based on the specified test result of each specified interface.
In this embodiment, the operations respectively executed by the modules or units correspond to the steps of the interface-based regression testing method in the foregoing embodiment one to one, and are not described herein again.
Further, in an embodiment of the present application, the interface-based regression testing apparatus includes:
the second acquisition module is used for acquiring an interface regression test evaluation result corresponding to the target system within a preset time period; the number of the interface regression test evaluation results comprises a plurality of interface regression test evaluation results, wherein the interface regression test evaluation results comprise that the interfaces pass the regression test or the interfaces do not pass the regression test;
the screening module is used for screening out a first result with the content of the interfaces passing the regression test from all the interface regression test evaluation results, and acquiring a first number of the first result;
the third obtaining module is used for obtaining a second quantity of the regression test evaluation results of all the interfaces;
the calculating module is used for calculating a quotient value of the first quantity and the second quantity to obtain a regression test passing rate;
the judging module is used for judging whether the regression test passing rate is greater than a preset passing rate threshold value or not;
a first execution module, configured to, if the pass rate is smaller than the pass rate threshold, execute the step of pulling interface information of all interfaces included in the target system from a preset database;
and the processing module is used for acquiring a code change record corresponding to the target system if the pass rate is greater than the pass rate threshold, performing regression test processing on a target interface corresponding to the code change record in the target system, and generating a corresponding regression test analysis report of the target interface based on a target test result corresponding to the target interface.
In this embodiment, the operations respectively executed by the modules or units correspond to the steps of the interface-based regression testing method in the foregoing embodiment one to one, and are not described herein again.
Further, in an embodiment of the present application, the processing module includes:
the first acquisition unit is used for acquiring a code change record of the target system based on a preset component;
the searching unit is used for searching a target interface corresponding to the code change record from all interfaces contained in the target system;
a second obtaining unit, configured to obtain target interface information of the target interface;
a constructing unit, configured to construct a target interface request corresponding to the target interface based on the target interface information;
the test unit is used for carrying out regression test on the target interface based on the target interface request to obtain a target test result corresponding to the target interface;
and the first generation unit is used for generating a target interface regression test analysis report corresponding to the target system based on the target test result.
In this embodiment, the operations respectively executed by the modules or units correspond to the steps of the interface-based regression testing method in the foregoing embodiment one to one, and are not described herein again.
Further, in an embodiment of the present application, the test module 5 includes:
a sending unit, configured to initiate the interface request to the specified interface;
the first judgment unit is used for judging whether an output result returned by the specified interface is received or not;
the second generation unit is used for generating a first specified test result that the interface corresponding to the specified interface does not pass the regression test if the output result is not received;
the analysis unit is used for analyzing the appointed output parameters from the appointed interface information corresponding to the appointed interface if the output result is received;
a second judging unit, configured to judge whether the output result is the same as the specified output parameter;
a third generating unit, configured to generate a second specified test result that an interface corresponding to the specified interface passes a regression test if the specified output parameter is the same as the specified output parameter;
and the fourth generation unit is used for generating a third specified test result that the interface corresponding to the specified interface does not pass the regression test if the specified output parameters are different from the specified output parameters.
In this embodiment, the operations respectively executed by the modules or units correspond to the steps of the interface-based regression testing method in the foregoing embodiment one to one, and are not described herein again.
Further, in an embodiment of the present application, the interface-based regression testing apparatus includes:
the fourth acquisition module is used for acquiring a face image of a user and acquiring a fingerprint image corresponding to the appointed finger of the user;
the first verification module is used for calling a preset legal face image and a preset legal fingerprint image to perform identity verification processing on the user based on the face image and the fingerprint image and judging whether the identity verification passes;
the extraction module is used for extracting the user information from the regression test request if the identity authentication passes;
the second verification module is used for calling a preset classification tree model, a role authority level table and a business operation authority level table to carry out authority verification processing on the user based on the user information and judging whether the authority verification passes;
and the second execution module is used for executing the step of pulling the interface information of all the interfaces contained in the target system from a preset database if the authority verification is passed.
In this embodiment, the operations respectively executed by the modules or units correspond to the steps of the interface-based regression testing method in the foregoing embodiment one to one, and are not described herein again.
Further, in an embodiment of the application, the first verification module includes:
a detection unit for performing a live body detection on the user and judging whether the live body detection passes;
a third judging unit, configured to, if the living body detection is passed, obtain the pre-stored legal face image, and judge whether there is an appointed face image matching the face image in all the legal face images;
a third obtaining unit, configured to obtain, if the designated face image exists, designated user information corresponding to the designated face image;
the first screening unit is used for screening out a specified fingerprint image corresponding to the specified finger from all prestored legal fingerprint images corresponding to the specified user information;
the dividing unit is used for 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;
a fourth determining unit, configured to obtain a first number of the first sub-blocks and obtain a second number of a preset similarity algorithm, and determine whether the first number is smaller than the second number;
a second screening unit, configured to screen a first number of target similarity algorithms from the similarity algorithms if the number of target similarity algorithms is smaller than the second number, and generate a one-to-one mapping relationship between each target similarity algorithm and each first sub-block;
a comparison unit, configured to perform, based on the mapping relationship, one-to-one corresponding comparison processing on all first sub-blocks included in the fingerprint image and all second sub-blocks included in the designated fingerprint image by using each target similarity algorithm, so as to obtain a plurality of similarities after the comparison processing;
a fifth judging unit, configured to compare the similarity obtained by each target similarity algorithm with a similarity threshold of each target similarity algorithm, and judge whether each similarity is greater than a corresponding similarity threshold;
and the first judging unit is used for judging that the identity authentication passes if the similarity thresholds are all larger than the corresponding similarity threshold, and otherwise, judging that the identity authentication fails.
In this embodiment, the operations respectively executed by the modules or units correspond to the steps of the interface-based regression testing method in the foregoing embodiment one to one, and are not described herein again.
Further, in an embodiment of the application, the second verification module includes:
the calling unit is used for calling the classification tree model, the role authority level table and the service operation authority level table;
the first determining unit is used for inputting the user information into the classification tree model and determining the role category corresponding to the user information through the classification tree model;
a second determining unit, configured to determine, based on the role permission level table, a target permission level corresponding to the role category;
a fourth obtaining unit, configured to obtain, based on the service operation permission level table, a permission level interval of a service operation corresponding to execution of a regression test;
a sixth judging unit, configured to judge whether the target permission level is within the permission level interval;
and the second judging unit is used for judging that the authority verification passes if the authority level interval is within the authority level interval, and otherwise, judging that the authority verification fails.
In this embodiment, the operations respectively executed by the modules or units correspond to the steps of the interface-based regression testing method in the foregoing embodiment one to one, and are not described herein again.
Referring to fig. 3, an embodiment of the present application further provides a computer device, where the computer device may be a server, and an internal structure of the computer device may be as shown in fig. 3. The computer device comprises a processor, a memory, a network interface, a display screen, an input device and a database which are connected through a system bus. Wherein the processor of the computer device is designed to provide computing and control capabilities. The memory of the computer device comprises 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 operating system and computer programs in the storage medium to run. The database of the computer device is used for storing interface information, interface requests, specified test results and interface regression test analysis reports. The network interface of the computer device is used for communicating with an external terminal through a network connection. The display screen of the computer equipment is an indispensable image-text output equipment in the computer, and is used for converting digital signals into optical signals so that characters and figures are displayed on the screen of the display screen. The input device of the computer equipment is the main device for information exchange between the computer and the user or other equipment, and is used for transmitting data, instructions, some mark information and the like to the computer. The computer program is executed by a processor to implement an interface-based regression testing method.
The processor executes the steps of the interface-based regression testing method:
receiving a triggered regression test request corresponding to an interface of a target system to be tested;
interface information of all interfaces contained in the target system is pulled from a preset database;
for each appointed interface in the target system, acquiring appointed interface information of the appointed interface from all the interface information;
constructing an interface request corresponding to the specified interface based on the specified interface information;
performing regression testing on the designated interface based on the interface request to obtain a designated testing result corresponding to the designated interface;
and generating an interface regression test analysis report of the target system based on the specified test result of each specified interface.
Those skilled in the art will appreciate that the structure shown in fig. 3 is only a block diagram of a part of the structure related to the present application, and does not constitute a limitation to the apparatus and the computer device to which the present application is applied.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements an interface-based regression testing method, and specifically includes:
receiving a triggered regression test request corresponding to an interface of a target system to be tested;
interface information of all interfaces contained in the target system is pulled from a preset database;
for each appointed interface in the target system, acquiring appointed interface information of the appointed interface from all the interface information;
constructing an interface request corresponding to the specified interface based on the specified interface information;
performing regression testing on the designated interface based on the interface request to obtain a designated testing result corresponding to the designated interface;
and generating an interface regression test analysis report of the target system based on the specified test result of each specified interface.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. Any reference to memory, storage, database, or other medium provided herein and used in the examples may 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. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, apparatus, article or method that comprises the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. An interface-based regression testing method, comprising:
receiving a triggered regression test request corresponding to an interface of a target system to be tested;
interface information of all interfaces contained in the target system is pulled from a preset database;
for each appointed interface in the target system, acquiring appointed interface information of the appointed interface from all the interface information;
constructing an interface request corresponding to the specified interface based on the specified interface information;
performing regression testing on the designated interface based on the interface request to obtain a designated testing result corresponding to the designated interface;
and generating an interface regression test analysis report of the target system based on the specified test result of each specified interface.
2. The interface-based regression testing method according to claim 1, wherein said step of pulling interface information of all interfaces included in said target system from a predetermined database is preceded by the steps of:
obtaining an interface regression test evaluation result corresponding to the target system within a preset time period; the number of the interface regression test evaluation results comprises a plurality of interface regression test evaluation results, wherein the interface regression test evaluation results comprise that the interfaces pass the regression test or the interfaces do not pass the regression test;
screening out a first result with the content of the regression test passing through the interfaces from all the interface regression test evaluation results, and acquiring a first number of the first result;
obtaining a second number of the evaluation results of the regression tests of all the interfaces;
calculating a quotient value of the first quantity and the second quantity to obtain a regression test passing rate;
judging whether the regression test passing rate is greater than a preset passing rate threshold value or not;
if the pass rate is smaller than the pass rate threshold, the step of pulling the interface information of all the interfaces contained in the target system from a preset database is executed;
and if the pass rate is larger than the pass rate threshold value, acquiring a code change record corresponding to the target system, performing regression test processing on a target interface corresponding to the code change record in the target system, and generating a corresponding regression test analysis report of the target interface based on a target test result corresponding to the target interface.
3. The interface-based regression testing method according to claim 2, wherein the step of obtaining a code change record corresponding to the target system, performing regression testing processing 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 comprises:
acquiring a code change record of the target system based on a preset component;
searching a target interface corresponding to the code change record from all interfaces contained in the target system;
acquiring target interface information of the target interface;
constructing a target interface request corresponding to the target interface based on the target interface information;
performing regression testing on the target interface based on the target interface request to obtain a target testing result corresponding to the target interface;
and generating a target interface regression test analysis report corresponding to the target system based on the target test result.
4. The interface-based regression testing method according to claim 1, wherein the step of performing regression testing on the specified interface based on the interface request to obtain a specified testing result corresponding to the specified interface comprises:
initiating the interface request to the designated interface;
judging whether an output result returned by the specified interface is received or not;
if the output result is not received, generating a first appointed test result that the interface corresponding to the appointed interface does not pass the regression test;
if the output result is received, analyzing the appointed output parameter from the appointed interface information corresponding to the appointed interface;
judging whether the output result is the same as the specified output parameter or not;
if the output parameters are the same as the specified output parameters, generating a second specified test result that the interface corresponding to the specified interface passes the regression test;
and if the output parameters are different from the specified output parameters, generating a third specified test result that the interface corresponding to the specified interface does not pass the regression test.
5. The interface-based regression testing method according to claim 1, wherein the regression testing request carries user information of a user, and the step of pulling interface information of all interfaces included in the target system from a preset database includes:
acquiring a face image of a user and acquiring a fingerprint image corresponding to an appointed finger of the user;
calling a preset legal face image and a preset legal fingerprint image to perform authentication processing on the user based on the face image and the fingerprint image, and judging whether the authentication passes or not;
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 carry out authority verification processing on the user, and judging whether authority verification passes;
and if the authority verification is passed, executing the step of pulling the interface information of all the interfaces contained in the target system from a preset database.
6. The interface-based regression testing method of claim 5, wherein the step of calling a preset legal face image and a preset legal fingerprint image to perform authentication processing on the user based on the face image and the fingerprint image and judging whether the authentication passes comprises:
performing living body detection on the user and judging whether the living body detection is passed;
if the living body detection is passed, acquiring the pre-stored legal face images, and judging whether designated face images matched with the face images exist in all the legal face images or not;
if the designated face image exists, acquiring designated user information corresponding to the designated face image;
screening out a designated fingerprint image corresponding to the designated finger from all the prestored legal fingerprint images corresponding to the designated user information;
dividing a 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;
acquiring a first number of the first sub-blocks and a second number of a preset similarity algorithm, and judging whether the first number is smaller than the second number;
if the number of the target similarity algorithms is smaller than the second number, screening a first number of target similarity algorithms from the similarity algorithms, and generating a one-to-one mapping relation between each target similarity algorithm and each first sub-block;
on the basis of the mapping relation, performing one-to-one corresponding comparison processing on all first sub-blocks contained in the fingerprint image and all second sub-blocks contained in the designated fingerprint image by using each target similarity algorithm to obtain a plurality of similarities after comparison processing;
comparing the similarity obtained by each target similarity algorithm with the similarity threshold of each target similarity algorithm respectively, and judging whether each similarity is greater than the corresponding similarity threshold;
and if the similarity values are larger than the corresponding similarity threshold values, judging that the identity authentication is passed, otherwise, judging that the identity authentication is not passed.
7. The interface-based regression testing method of claim 5, wherein the step of invoking a preset classification tree model, a role permission level table and a business operation permission level table to perform permission verification processing on the user based on the user information and determining whether permission verification passes comprises:
calling the classification tree model, the role authority level table and the service 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 permission level corresponding to the role category based on the role permission level table;
acquiring an authority level interval of the business operation corresponding to the regression test based on the business operation authority level table;
judging whether the target authority level is in the authority level interval or not;
and if the authority level interval is within the authority level interval, judging that the authority verification is passed, otherwise, judging that the authority verification is not passed.
8. An interface-based regression testing apparatus, comprising:
the receiving module is used for receiving a triggered regression testing request corresponding to an interface of a target system to be tested;
the pulling module is used for pulling the interface information of all the interfaces contained in the target system from a preset database;
the first acquisition module is used for acquiring the appointed interface information of the appointed interface from all the interface information for each appointed interface in the target system;
the construction module is used for constructing an interface request corresponding to the specified interface based on the specified interface information;
the test module is used for carrying out regression test on the specified interface based on the interface request to obtain a specified test result corresponding to the specified interface;
and the generating module is used for generating an interface regression test analysis report of the target system based on the specified test result of each specified interface.
9. A computer device comprising a memory and a processor, the memory having stored therein a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202210508982.XA 2022-05-10 2022-05-10 Regression testing method and device based on interface, computer equipment and storage medium Pending CN114817055A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210508982.XA CN114817055A (en) 2022-05-10 2022-05-10 Regression testing method and device based on interface, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210508982.XA CN114817055A (en) 2022-05-10 2022-05-10 Regression testing method and device based on interface, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114817055A true CN114817055A (en) 2022-07-29

Family

ID=82514356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210508982.XA Pending CN114817055A (en) 2022-05-10 2022-05-10 Regression testing method and device based on interface, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114817055A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116069573A (en) * 2022-11-16 2023-05-05 北京东方通科技股份有限公司 Testing method and system based on API (application program interface) testing platform
CN116257456A (en) * 2023-05-12 2023-06-13 西安晟昕科技股份有限公司 Multi-interface test method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116069573A (en) * 2022-11-16 2023-05-05 北京东方通科技股份有限公司 Testing method and system based on API (application program interface) testing platform
CN116069573B (en) * 2022-11-16 2023-09-22 北京东方通科技股份有限公司 Testing method and system based on API (application program interface) testing platform
CN116257456A (en) * 2023-05-12 2023-06-13 西安晟昕科技股份有限公司 Multi-interface test method
CN116257456B (en) * 2023-05-12 2023-07-18 西安晟昕科技股份有限公司 Multi-interface test method

Similar Documents

Publication Publication Date Title
CN113516297A (en) Prediction method and device based on decision tree model and computer equipment
CN114817055A (en) Regression testing method and device based on interface, computer equipment and storage medium
CN112527630B (en) Test case generation method, device, computer equipment and storage medium
CN111737963B (en) Configuration file based form filling method and device and computer equipment
CN112668041A (en) Document file generation method and device, computer equipment and storage medium
CN113326081A (en) Static resource processing method and device, computer equipment and storage medium
CN113918526A (en) Log processing method and device, computer equipment and storage medium
CN114840387A (en) Micro-service monitoring method and device, computer equipment and storage medium
CN112463599A (en) Automatic testing method and device, computer equipment and storage medium
CN113742776A (en) Data verification method and device based on biological recognition technology and computer equipment
CN114090408A (en) Data monitoring and analyzing method and device, computer equipment and storage medium
CN113642039A (en) Configuration method and device of document template, computer equipment and storage medium
CN113282514A (en) Problem data processing method and device, computer equipment and storage medium
CN113986581A (en) Data aggregation processing method and device, computer equipment and storage medium
CN112434335A (en) Business problem processing method and device, computer equipment and storage medium
CN113435990B (en) Certificate generation method and device based on rule engine and computer equipment
CN114978968A (en) Micro-service anomaly detection method and device, computer equipment and storage medium
CN112650659B (en) Buried point setting method and device, computer equipment and storage medium
CN113327037A (en) Model-based risk identification method and device, computer equipment and storage medium
CN113672654A (en) Data query method and device, computer equipment and storage medium
US20200111188A1 (en) Digitized test management center
CN113656588A (en) Data code matching method, device, equipment and storage medium based on knowledge graph
CN112395125A (en) Method and device for notifying page error report, computer equipment and storage medium
CN114036117A (en) Log viewing method and device, computer equipment and storage medium
CN114547053A (en) System-based data processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination