Configuration Method, Device, Computer Equipment and Storage Medium for Interface Testing
By identifying interface information in the production log and execution data in the test results, and combining natural language algorithms for consistent matching, the problem of incomplete interface testing and low accuracy is solved, and more accurate and efficient interface coverage analysis is achieved.
Patent Information
- Application Number
- CN202111539801.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-12-15
AI Technical Summary
The existing interface testing methods have problems such as incompleteness and low accuracy, resulting in a lack of data analysis of the coverage of test cases.
By obtaining the production log information of the development project, identifying interface information based on the preconfigured syntax feature, obtaining test result information from the test tool, using natural language algorithms to identify the test interface and execution data, and performing consistency matching, determining the test data of the interface information, and finally determining the interface coverage information of the test task based on the test data.
It realizes a comprehensive, effective and realistic analysis of interface test tasks, improves the accuracy of interface coverage analysis, improves the efficiency of viewing interface test coverage, and facilitates the maintenance and update of test tasks.
Smart Images

Figure CN114048082B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing, and particularly to a configuration method, device, computer device, and storage medium for interface testing. Background Art
[0002] Before a development project is released and launched, it needs to be tested. After testing the development project, it is also necessary to ensure that the testing can comprehensively cover all functions of the development project. One current testing method is to test the functions of the development project by designing test cases, specifically by testing the interfaces in the development project. However, for the interface automation test cases themselves, there is a situation where updates and supplements are not timely, resulting in a lack of data analysis on the coverage of test cases, and thus the current interface testing has problems of being incomplete and having low accuracy. Summary of the Invention
[0003] The main purpose of the present application is to provide a configuration method, device, computer device, and storage medium for interface testing, aiming to solve the problems of incomplete and low-accuracy current interface testing.
[0004] To achieve the above invention purpose, the present application proposes a configuration method for interface testing, including:
[0005] Obtain the production log information of the development project;
[0006] Based on pre-configured syntax features, identify the production log information and obtain the interface information in the production log information;
[0007] Obtain the test result information obtained after the execution of the pre-configured test tasks of the development project from the test tool;
[0008] According to the natural language algorithm, identify the test result information and obtain the test interfaces included in the test task and the execution data corresponding to the test interfaces;
[0009] Perform consistency matching between the test interfaces and the interface information, and determine the execution data corresponding to the test interfaces that meet the consistency requirements as the test data of the interface information;
[0010] Determine the interface coverage information of the test task according to the test data of the interface information.
[0011] Further, the step of based on pre-configured syntax features, identify the production log information and obtain the interface information in the production log information includes:
[0012] Obtain the types of interface information from a pre-configured interface library; the types include business interface types and non-business interface types;
[0013] Match the corresponding grammar features from the grammar library according to the type as pre-configured grammar features;
[0014] Identify the production log information based on the pre-configured grammar features, and obtain the business interface information and non-business interface information in the production log information.
[0015] Further, the identifying the test result information according to the natural language algorithm and obtaining the test interfaces included in the test task and the execution data corresponding to the test interfaces includes:
[0016] Identify the test result information according to the natural language algorithm, and obtain the entity information matching the preset keywords in the test result information, where the entity information represents the test interfaces of the test task;
[0017] Determine the content range of the corresponding test interface according to the entity information;
[0018] Identify the content information within the content range according to the natural language algorithm, and obtain the execution data corresponding to the test interface.
[0019] Further, the identifying the content information within the content range according to the natural language algorithm and obtaining the execution data corresponding to the test interface includes:
[0020] Obtain the prior knowledge data of the entity information;
[0021] Configure the prior knowledge data with the natural language algorithm to obtain the natural language algorithm of the prior knowledge;
[0022] Identify the content information within the content range according to the natural language algorithm of the prior knowledge, and obtain the execution data corresponding to the test interface.
[0023] Further, the obtaining the test result information obtained after the execution of the test task pre-configured for the development project from the test tool includes:
[0024] Obtain the first version number of the development project according to the production log information;
[0025] Determine the second version number of the test task according to the first version number;
[0026] Obtain the test result information obtained after the execution of the test task with the second version number from the test tool.
[0027] Further, after determining the interface coverage information of the test task according to the test data of the interface information, it further includes:
[0028] Obtain the information of the to-be-tested interfaces that do not meet the coverage requirements according to the interface coverage information;
[0029] Obtain the execution logic of the interface to be tested corresponding to the interface information to be tested from the development project;
[0030] Generate a retest task for the interface to be tested according to the execution logic and the preset parameter information.
[0031] Further, the generating a retest task for the interface to be tested according to the execution logic and the preset parameter information includes:
[0032] Obtain the first parameter of the execution logic;
[0033] Obtain the matching second parameter and the second parameter value of the second parameter from the preset parameter information according to the first parameter;
[0034] Configure the parameter value of the first parameter in the execution logic as the second parameter value;
[0035] Generate a retest task for the interface to be tested according to the execution logic and the second parameter value.
[0036] The present application also provides a configuration device for interface testing, including:
[0037] A log acquisition module, configured to acquire production log information of a development project;
[0038] An interface recognition module, configured to recognize the production log information based on preconfigured syntax features, and acquire interface information in the production log information;
[0039] A test result module, configured to acquire test result information obtained after execution of a test task preconfigured for the development project from a test tool;
[0040] A result parsing module, configured to recognize the test result information according to a natural language algorithm, and acquire test interfaces included in the test task and execution data corresponding to the test interfaces;
[0041] An interface matching module, configured to perform consistency matching between the test interfaces and the interface information, and determine the execution data corresponding to the test interfaces that meet the consistency requirement as test data of the interface information;
[0042] A test statistics module, configured to determine interface coverage information of the test task according to the test data of the interface information.
[0043] The present application also provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the configuration method for interface testing described in any one of the above are implemented.
[0044] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the configuration method for interface testing described in any one of the above are implemented.
[0045] The present application provides an analysis method for interface coverage of an interface testing task. First, production log information of a development project is obtained. The writing characteristics of different parts in the production log information are different. Based on pre-configured syntax features, the log information is recognized to obtain interface information in the log information. The interface information includes the definition, name, and associated running data of the interface, so as to obtain the interfaces used by the development project in the production environment and the access data of each interface. The development project configures a testing task for interface testing. To verify whether the testing task comprehensively and accurately covers each interface of the development project, test result information obtained after the pre-configured testing task of the development project is executed is obtained from a testing tool. The test result information is recognized according to natural language to obtain the test interfaces included in the testing task and the execution data corresponding to the test interfaces. The test interfaces are subjected to consistency matching with the interface information, and then the execution data corresponding to the test interfaces that meet the consistency requirement is determined as the test data of the interface information. The interface coverage information of the testing task is determined according to the test data of the interface information, so as to comprehensively, effectively, and truly analyze the testing task based on the production log information generated in the production environment, improve the accuracy of interface coverage analysis in the testing task, and further improve the efficiency of viewing the interface test coverage rate, as well as facilitate the maintenance and update of the testing task. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a schematic flowchart of an embodiment of the configuration method for interface testing of the present application;
[0047] Figure 2 It is a schematic structural diagram of an embodiment of the configuration device for interface testing of the present application;
[0048] Figure 3 It is a schematic block diagram of an embodiment of the computer device of the present application.
[0049] The implementation, functional features, and advantages of the purpose of the present application will be further described in conjunction with the embodiments with reference to the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] In order to make the purpose, technical solution, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] Refer to Figure 1, an embodiment of the present application provides a configuration method for interface testing, including steps S10 - S60. The detailed description of each step of the configuration method for interface testing is as follows. The configuration method for interface testing can be completed by a system service with corresponding functions built in. The system service can be defined as an interface coverage service. The system service can run on a terminal device or in a cloud server. Therefore, the configuration method for interface testing can also be understood as being completed by the terminal device or cloud server running the system service.
[0052] S10. Obtain the production log information of the development project.
[0053] This embodiment is applied to the detection scenario of interface testing for a development project. When the development project is before and after going online, it is necessary to test the operation data of various functions of the development project. Before the development project goes online, a test task is configured for the development project. The test task is an interface automation test task and includes corresponding interface test cases. In order to verify whether the test task comprehensively and accurately covers various functions of the development project, the present invention obtains the production log information of the development project, that is, obtains the operation data generated by the operation of various functions of the development project, and the operation data is integrated into a log and defined as production log information, so as to obtain the production log information of the development project. Among them, the production log information is generated after the development project goes online, that is, the log generated by the development project running in the production environment, and the production environment of the development project is a gray production environment.
[0054] S20. Identify the production log information based on pre - configured syntax features, and obtain the interface information in the production log information.
[0055] In this embodiment, after obtaining the production log information of the development project, since the writing features of different parts of the log information generated by the operation of different functions of the development project are different, the present invention obtains pre - configured syntax features. The pre - configured syntax features are the syntax features of interface information. Then, based on the pre - configured syntax features, the production log information is identified to obtain the interface information in the production log information; that is, the content that meets the syntax features is extracted from the production log information, and the content that meets the syntax features is defined as interface information; the interface information includes the definition, name of the interface and its associated operation data, so as to obtain the interfaces used by the development project in the production environment and the access data of each interface.
[0056] S30. Obtain the test result information obtained after the pre - configured test task of the development project is executed from the test tool.
[0057] In this embodiment, before the development project goes online, it is necessary to configure test tasks for interface testing. The test tasks include test cases for different interfaces. In order to verify whether the test tasks comprehensively and accurately cover all interfaces of the development project, the execution results of the test tasks in the test tool are obtained, that is, the test result information obtained after the pre-configured test tasks of the development project are executed in the test tool. In one implementation, the test tool is the jmeter test tool. By modifying the result output path in the configuration file of the jmeter test tool, the test result information obtained by the jmeter test tool executing the test tasks can be obtained. The test result information includes the running results of each interface used during the execution of this test task, including the interface usage uri, whether the interface execution is successful, and the time consumed for interface execution, etc. Data such as the success rate of interface execution, the time consumed for each interface, and the number of interfaces of this test task can also be calculated based on the test result information.
[0058] S40. Identify the test result information according to the natural language algorithm, and obtain the test interfaces included in the test task and the execution data corresponding to the test interfaces.
[0059] In this embodiment, after obtaining the test result information obtained after the pre-configured test tasks of the development project are executed in the test tool, the test result information is identified according to natural language. The test result information includes the test cases for each test interface and the running results of each test interface. Since the test tasks are configured before development, in this embodiment, the test result information generated by the test tasks is configured in a preset format, that is, each content information of the test results is in a preset template. Therefore, according to the natural language algorithm, the test result information is identified, and based on the preset template, the content of each part in the test result information is identified, and the test interfaces included in the test result information and the execution data corresponding to the test interfaces are obtained, so as to obtain which test interfaces are included in the test task and the execution data of the test interfaces.
[0060] S50. Perform consistency matching between the test interfaces and the interface information, and determine the execution data corresponding to the test interfaces that meet the consistency requirements as the test data of the interface information.
[0061] In this embodiment, after obtaining the test interfaces included in the test task and the execution data corresponding to the test interfaces, the test interfaces are matched with the interface information for consistency, that is, the test interfaces with the same identification information as that in the interface information are screened from the test result information. Specifically, in one implementation manner, the identification information includes the interface name, execution function, call parameters in the execution function, and the called database. By performing consistency matching on the identification information one by one, first, consistency matching is performed based on the interface name. The test interfaces and the interface information are matched for consistency through the name parameter of the interface. If the name parameter of the test interface is consistent with the name parameter in the interface information, then consistency matching of the execution function is performed. If the execution function of the test interface is consistent with the execution function in the interface information, then consistency matching of the call parameters and the called database in the execution function is performed. When the identification information of the test interface is the same as the identification information in the interface information, it is determined that the consistency between the test interface and the interface information meets the requirements. Then, the execution data corresponding to the test interface with the consistency meeting the requirements is determined as the test data of the interface information, that is, the execution data corresponding to the test interface is obtained, and this execution data is calibrated as the test data corresponding to the interface information.
[0062] S60. Determine the interface coverage information of the test task according to the test data of the interface information.
[0063] In this embodiment, after determining the execution data corresponding to the test interface with the consistency meeting the requirements as the test data of the interface information, the interface coverage information of the test task is determined according to the test data of the interface information. Specifically, through the test data of the interface information, specifically, based on the test data, it is counted which interfaces in the interface information have test data and which interfaces do not have test data, that is, the proportion of the interfaces with test data is statistically obtained, and the data volume of the test data of each different interface in the interface information is also statistically obtained. Then, according to the proportion of the interfaces with test data and the data volume of the test data of the interfaces, the coverage degree of the interface test in the test task is determined, that is, the interface coverage information of the test task is obtained, so as to comprehensively, effectively, and truly analyze the test task based on the production log information generated in the production environment, and improve the accuracy of the interface coverage analysis in the test task.
[0064] This embodiment provides an analysis method for interface coverage of interface test tasks. First, the production log information of the development project is obtained. The writing characteristics of different parts in the production log information are different. Based on pre-configured syntax features, the log information is identified to obtain the interface information in the log information. The interface information includes the definition, name, and associated running data of the interface, so as to obtain the interfaces used by the development project in the production environment and the access data of each interface. The development project configures test tasks for interface testing. In order to verify whether the test tasks comprehensively and accurately cover each interface of the development project, the test result information obtained after the execution of the pre-configured test tasks of the development project is obtained from the test tool. According to natural language, the test result information is identified to obtain the test interfaces included in the test tasks and the execution data corresponding to the test interfaces. The test interfaces are matched with the interface information for consistency. Then, the execution data corresponding to the test interfaces that meet the consistency requirements is determined as the test data of the interface information. According to the test data of the interface information, the interface coverage information of the test tasks is determined, so as to comprehensively, effectively, and truly analyze the test tasks based on the production log information generated in the production environment, improve the accuracy of interface coverage analysis in the test tasks, and further improve the efficiency of viewing the interface test coverage rate, as well as facilitate the maintenance and update of the test tasks.
[0065] In one embodiment, the identifying the production log information based on pre-configured syntax features to obtain the interface information in the production log information includes:
[0066] Obtaining the types of interface information from a pre-configured interface library; the types include business interface types and non-business interface types;
[0067] Matching the corresponding syntax features from the syntax library as the pre-configured syntax features according to the types;
[0068] Identifying the production log information based on the pre-configured syntax features to obtain the business interface information and non-business interface information in the production log information.
[0069] In this embodiment, in the process of identifying the log information based on preconfigured syntax features and obtaining the interface information in the log information, the type of interface information is obtained from a preconfigured interface library; the type includes a service interface type and a non-service interface type. This embodiment can detect interfaces of a specified type in a development project, for example, detect service interfaces. At this time, corresponding syntax features are matched from a syntax library as the preconfigured syntax features. Different types of interface information have different syntax writing features. According to different syntax features, the content of the corresponding type of interface information can be accurately identified, that is, the production log information is identified based on the preconfigured syntax features, and the service interface information and non-service interface information in the production log information are obtained. It is not necessary to detect all production log information, but only detect specific types of interfaces, thereby improving the recognition accuracy of different interface information and the extraction efficiency of interface information data.
[0070] In one embodiment, the process of identifying the test result information according to a natural language algorithm and obtaining the test interfaces included in the test task and the execution data corresponding to the test interfaces includes:
[0071] Identify the entity information that matches a preset keyword in the test result information according to a natural language algorithm, where the entity information represents the test interface of the test task;
[0072] Determine the content range of the corresponding test interface according to the entity information;
[0073] Identify the content information within the content range according to a natural language algorithm to obtain the execution data corresponding to the test interface.
[0074] In this embodiment, in the process of identifying the test result information according to a natural language algorithm and obtaining the test interfaces included in the test task and the execution data corresponding to the test interfaces, first identify the entity information included in the test result information. Specifically, by means of keyword matching, identify the words in the test result information that match the preset keyword, and determine the matched words as the corresponding entity information. The entity information represents the test interface of the test task. Then determine the content range of the test interface corresponding to the entity information. Generally, the content information of each test interface is within the same content range. Through the two identified entity information, the content range of the previous test interface can be determined. Based on this method, the content range of each test interface is determined, and then the content information within the content range is identified according to a natural language algorithm to obtain the execution data corresponding to the test interface, so as to obtain the test interfaces included in the test task and the execution data corresponding to the test interfaces, quickly identify the execution data corresponding to different test interfaces, and improve the efficiency of test task analysis.
[0075] In one embodiment, identifying content information within the content range according to the natural language algorithm and obtaining execution data corresponding to the test interface includes:
[0076] Obtaining prior knowledge data of the entity information;
[0077] Configuring the prior knowledge data with the natural language algorithm to obtain a natural language algorithm of prior knowledge;
[0078] Identifying content information within the content range according to the natural language algorithm of prior knowledge and obtaining execution data corresponding to the test interface.
[0079] In this embodiment, in the process of identifying content information within the content range according to the natural language algorithm and obtaining execution data corresponding to the test interface, in order to accurately identify the execution data in different parts of the test interface, prior knowledge data of the entity information is obtained. The entity information represents the test interface. Specifically, the prior knowledge data is obtained by statistically collecting a word library corresponding to the entity information. In one implementation manner, by collecting text data corresponding to the entity information, splitting the text data to obtain sentences and vocabulary included in the text data, performing semantic recognition on the sentences and vocabulary, and then statistically calculating the occurrence probabilities of the sentences and vocabulary, and taking the target sentences and target vocabulary whose occurrence probabilities meet the preset values as the prior knowledge data under this entity information. Then, configuring the prior knowledge data with the natural language algorithm to obtain a natural language algorithm of prior knowledge, and then identifying content information within the content range according to the natural language algorithm of prior knowledge and obtaining execution data corresponding to the test interface. Through the natural language algorithm of prior knowledge configured with corresponding proper nouns, the content information within the content range can be quickly and accurately identified, and the execution data corresponding to the test interface can be obtained, so as to quickly identify the execution data corresponding to different test interfaces and improve the efficiency of test task analysis.
[0080] In one embodiment, obtaining test result information obtained after the test task pre-configured in the development project is executed from the test tool includes:
[0081] Obtaining the first version number of the development project according to the production log information;
[0082] Determining the second version number of the test task according to the first version number;
[0083] Obtaining test result information obtained after the test task of the second version number is executed from the test tool.
[0084] In this embodiment, the test tool includes performing test tasks for development projects in different time periods. To accurately analyze the interface coverage of the test tasks, it is necessary to ensure that the versions of the test tasks and the development projects are consistent. Specifically, before obtaining the test result information obtained after executing the test tasks pre-configured for the development project from the test tool, the first version number of the development project is obtained according to the production log information. The production log information generated by the development project contains a version number marker. By identifying the marker, the version number of the development project is determined and defined as the first version number. At the same time, according to the first version number, the second version number of the test task is determined. There is a mutually mapped relationship between the version number of the development project and the version number of the test task. In one implementation, the version numbers of the mutually mapped development project and test task are the same in number but different in version number symbols. For example, the version number of the development project is K.1.1.1, and the version number of the mutually mapped test task is C.1.1.1. The version number of the development project is K.1.1.2, and the version number of the mutually mapped test task is C.1.1.2. Therefore, according to the first version number, the version number of the test task is determined and defined as the second version number. Then, the test result information obtained after executing the test task with the second version number is obtained from the test tool to ensure that the versions of the test task and the development project are consistent and improve the detection accuracy of the interface coverage of the test task.
[0085] In one embodiment, after determining the interface coverage information of the test task according to the test data of the interface information, it further includes:
[0086] Obtain the interface information to be tested that does not meet the coverage requirements according to the interface coverage information;
[0087] Obtain the execution logic of the interface to be tested corresponding to the interface information to be tested from the development project;
[0088] Generate a retest task for the interface to be tested according to the execution logic and the preset parameter information.
[0089] In this embodiment, after determining the interface coverage information of the test task according to the test data of the interface information, based on the test data, it is statistically determined which interfaces in the interface information have test data and which interfaces do not have test data, that is, which interfaces have been tested and which interfaces have not been tested, and the data volume of the test data of each different interface in the interface information is also statistically determined. Therefore, according to the interface coverage information, the interface information to be tested that does not meet the coverage requirements is obtained. In one implementation manner, an interface with a test data volume less than a preset value is defined as the interface information to be tested that does not meet the coverage requirements, including the interface information that has not been tested and the interface information with a test data volume less than the preset value for the interface. Then, the execution logic of the interface to be tested corresponding to the interface information to be tested is obtained from the development project, that is, by parsing the development project, the logic code associated with the interface information to be tested is matched in the development project and defined as the execution logic of the interface to be tested corresponding to the interface information to be tested. Then, according to the execution logic and the preset parameter information, a retest task for the interface to be tested is generated, thereby completing the full coverage of the interface to be tested by the test task and improving the comprehensiveness of the test.
[0090] In one embodiment, the generating the retest task for the interface to be tested according to the execution logic and the preset parameter information includes:
[0091] Obtain the first parameter of the execution logic;
[0092] Obtain the matching second parameter and the second parameter value of the second parameter from the preset parameter information according to the first parameter;
[0093] Configure the parameter value of the first parameter in the execution logic as the second parameter value;
[0094] Generate the retest task for the interface to be tested according to the execution logic and the second parameter value.
[0095] In this embodiment, in the process of generating a retest task for the interface under test according to the execution logic and preset parameter information, first, a first parameter of the execution logic is obtained. The first parameter is a parameter included in the execution logic. For example, if the execution logic includes parameters A, B, and C, then a second parameter that matches the first parameter is obtained from the preset parameter information, and the second parameter value of the second parameter is obtained. Specifically, information with the same semantics as the first parameter in the preset parameter information is screened out through semantic recognition as the second parameter. For example, the second parameter that matches the first parameter A is X1, and the second parameter that matches the first parameter B is X2. Then, the data value included in the second parameter is obtained and defined as the second parameter value. Next, the second parameter value is configured as the parameter value of the first parameter, that is, the parameter value of the first parameter in the execution logic is configured as the second parameter value. Then, a retest task for the interface under test is generated according to the execution logic and the second parameter value, that is, a corresponding parameter value is configured for each first parameter in the execution logic of the interface under test, so as to generate a test task for this interface under test, which is defined as a retest task, thereby completing the full coverage of the interface under test by the test task and improving the comprehensiveness of the test.
[0096] Referring to Figure 2 , the present application also provides a configuration device for interface testing, including:
[0097] A log acquisition module 10, configured to acquire production log information of a development project;
[0098] An interface recognition module 20, configured to recognize the production log information based on preconfigured syntax features and acquire interface information in the production log information;
[0099] A test result module 30, configured to acquire test result information obtained after the execution of a test task preconfigured for the development project from a test tool;
[0100] A result analysis module 40, configured to recognize the test result information according to a natural language algorithm and acquire test interfaces included in the test task and execution data corresponding to the test interfaces;
[0101] An interface matching module 50, configured to perform consistency matching between the test interfaces and the interface information, and determine the execution data corresponding to the test interfaces that meet the consistency requirement as the test data of the interface information;
[0102] A test statistics module 60, configured to determine interface coverage information of the test task according to the test data of the interface information.
[0103] As described above, it can be understood that each component of the configuration device for interface testing proposed in this application can implement the functions of any of the above-described interface testing configuration methods.
[0104] In one embodiment, the method for identifying the production log information based on pre-configured syntax features and obtaining the interface information in the production log information includes:
[0105] Obtaining the types of interface information from a pre-configured interface library; the types include business interface types and non-business interface types;
[0106] Matching corresponding syntax features from a syntax library as the pre-configured syntax features according to the types;
[0107] Identifying the production log information based on the pre-configured syntax features to obtain the business interface information and non-business interface information in the production log information.
[0108] In one embodiment, the method for identifying the test result information according to a natural language algorithm and obtaining the test interfaces included in the test task and the execution data corresponding to the test interfaces includes:
[0109] Identifying the test result information according to a natural language algorithm to obtain entity information that matches a preset keyword in the test result information, where the entity information represents the test interfaces of the test task;
[0110] Determining the content scope of the corresponding test interfaces according to the entity information;
[0111] Identifying the content information within the content scope according to a natural language algorithm to obtain the execution data corresponding to the test interfaces.
[0112] In one embodiment, the method for identifying the content information within the content scope according to a natural language algorithm and obtaining the execution data corresponding to the test interfaces includes:
[0113] Obtaining the prior knowledge data of the entity information;
[0114] Configuring the prior knowledge data with the natural language algorithm to obtain a natural language algorithm with prior knowledge;
[0115] Identifying the content information within the content scope according to the natural language algorithm with prior knowledge to obtain the execution data corresponding to the test interfaces.
[0116] In one embodiment, the method for obtaining the test result information obtained after the execution of the test tasks pre-configured for the development project from a test tool includes:
[0117] Obtaining the first version number of the development project according to the production log information;
[0118] Determine the second version number of the test task according to the first version number;
[0119] Obtain the test result information obtained after executing the test task of the second version number from the test tool.
[0120] In one embodiment, after determining the interface coverage information of the test task according to the test data of the interface information, it further includes:
[0121] Obtain the information of the interface to be tested that does not meet the coverage requirements according to the interface coverage information;
[0122] Obtain the execution logic of the interface to be tested corresponding to the information of the interface to be tested from the development project;
[0123] Generate a retest task for the interface to be tested according to the execution logic and the preset parameter information.
[0124] In one embodiment, generating the retest task for the interface to be tested according to the execution logic and the preset parameter information includes:
[0125] Obtain the first parameter of the execution logic;
[0126] Obtain the matching second parameter and the second parameter value of the second parameter from the preset parameter information according to the first parameter;
[0127] Configure the parameter value of the first parameter in the execution logic as the second parameter value;
[0128] Generate a retest task for the interface to be tested according to the execution logic and the second parameter value.
[0129] Refer to Figure 3 , in an embodiment of the present application, a computer device is further provided. The computer device may be a mobile terminal, and its internal structure may be as Figure 3 shown. The computer device includes a processor, a memory, a network interface, a display device, and an input device connected through a system bus. Among them, the network interface of the computer device is used to communicate with an external terminal through a network connection. The input device of the computer device is used to receive user input. The processor of the computer design is used to provide computing and control capabilities. The memory of the computer device includes a storage medium. The storage medium stores an operating system, a computer program, and a database. The database of the computer device is used to store data. When the computer program is executed by the processor, it is used to implement a configuration method for interface testing.
[0130] The above-mentioned processor executes the configuration method for the above-mentioned interface test, including: obtaining the production log information of the development project; identifying the production log information based on pre-configured syntax features to obtain the interface information in the production log information; obtaining the test result information obtained after the execution of the pre-configured test task of the development project from the test tool; identifying the test result information according to the natural language algorithm to obtain the test interfaces included in the test task and the execution data corresponding to the test interfaces; performing consistency matching between the test interfaces and the interface information, and determining the execution data corresponding to the test interfaces that meet the consistency requirements as the test data of the interface information; determining the interface coverage information of the test task according to the test data of the interface information.
[0131] The computer device provides an analysis method for interface coverage of an interface test task. First, it obtains the production log information of the development project. The writing features of different parts in the production log information are different. It identifies the log information based on pre-configured syntax features to obtain the interface information in the log information. The interface information includes the definition, name of the interface and its associated running data, so as to obtain the interfaces used by the development project in the production environment and the access data of each interface. The development project configures a test task for interface testing. In order to verify whether the test task comprehensively and accurately covers each interface of the development project, it obtains the test result information obtained after the execution of the pre-configured test task of the development project from the test tool, identifies the test result information according to natural language to obtain the test interfaces included in the test task and the execution data corresponding to the test interfaces, performs consistency matching between the test interfaces and the interface information, and then determines the execution data corresponding to the test interfaces that meet the consistency requirements as the test data of the interface information. It determines the interface coverage information of the test task according to the test data of the interface information, so as to comprehensively, effectively and truly analyze the test task based on the production log information generated in the production environment, improve the accuracy of interface coverage analysis in the test task, and further improve the efficiency of viewing the interface test coverage rate, as well as facilitate the maintenance and update of the test task.
[0132] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements a configuration method for interface testing, including the steps of: obtaining production log information of a development project; identifying the production log information based on pre-configured syntax features to obtain interface information in the production log information; obtaining test result information obtained after execution of a pre-configured test task of the development project from a test tool; identifying the test result information according to a natural language algorithm to obtain test interfaces included in the test task and execution data corresponding to the test interfaces; performing consistency matching between the test interfaces and the interface information, and determining the execution data corresponding to the test interfaces with satisfied consistency requirements as test data of the interface information; and determining interface coverage information of the test task according to the test data of the interface information.
[0133] The computer-readable storage medium provides an analysis method for interface coverage of an interface testing task. First, production log information of a development project is obtained. The writing features of different parts in the production log information are different. The log information is identified based on pre-configured syntax features to obtain interface information in the log information. The interface information includes the definition, name of the interface, and its associated running data, so as to obtain the interfaces used by the development project in the production environment and the access data of each interface. The development project configures a test task for interface testing. To verify whether the test task comprehensively and accurately covers each interface of the development project, test result information obtained after execution of a pre-configured test task of the development project is obtained from a test tool. The test result information is identified according to natural language to obtain test interfaces included in the test task and execution data corresponding to the test interfaces. The test interfaces are subjected to consistency matching with the interface information, and then the execution data corresponding to the test interfaces with satisfied consistency requirements is determined as test data of the interface information. The interface coverage information of the test task is determined according to the test data of the interface information, so as to comprehensively, effectively, and truly analyze the test task based on the production log information generated in the production environment, improve the accuracy of interface coverage analysis in the test task, and further improve the efficiency of viewing the interface test coverage rate, as well as facilitate the maintenance and update of the test task.
[0134] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.
[0135] Any reference to a memory, storage, database, or other medium provided in the present application and used in the embodiments may include non-volatile and / or volatile memories.
[0136] Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct rambus dynamic RAM (DRDRAM), and rambus dynamic RAM (RDRAM), and the like.
[0137] It should be noted that, in this specification, the terms "include", "comprise" or any other variation thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article or method that includes a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article or method. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, apparatus, article or method that includes the element.
[0138] The above description is only a preferred embodiment of the present application and does not limit the patent scope of the present application.
[0139] Any equivalent structural or equivalent process transformation made by using the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall equally be included in the patent protection scope of the present application.
Claims
1. A configuration method for interface testing, characterized in that, include: Get production log information of development projects; Identify the production log information based on preconfigured grammatical features, and obtain interface information in the production log information; Acquire test result information obtained after executing the test tasks preconfigured in the development project from the test tool; Identify the test result information according to a natural language algorithm, and obtain the test interface included in the test task and the execution data corresponding to the test interface; Match the test interface with the interface information for consistency, and determine the execution data corresponding to the test interface that meets the consistency requirement as the test data of the interface information; Determine the interface coverage information of the test task according to the test data of the interface information; The identifying the production log information based on the preconfigured grammatical features and acquiring the interface information in the production log information includes: Acquire the type of interface information from the preconfigured interface library; the type includes a business interface type and a non-business interface type; Matching corresponding grammatical features from a grammar library as preconfigured grammatical features according to the type; Identify the production log information based on preconfigured grammatical features, and obtain business interface information and non-business interface information in the production log information; The step of identifying the test result information according to a natural language algorithm and acquiring the test interface included in the test task and the execution data corresponding to the test interface includes: Identify the test result information according to a natural language algorithm, and obtain entity information matching preset keywords in the test result information, wherein the entity information represents a test interface of the test task; Determine the content scope of the corresponding test interface according to the entity information; Identify content information within the content range according to a natural language algorithm, and obtain execution data corresponding to the test interface; The obtaining, from the test tool, the test result information obtained after the test task preconfigured in the development project is executed includes: Obtaining a first version number of the development project according to the production log information; Determine a second version number of the test task according to the first version number; Obtaining test result information obtained after executing the test task of the second version number from the test tool; After determining the interface coverage information of the test task according to the test data of the interface information, the method further includes: Acquire information of interfaces to be tested that do not meet coverage requirements according to the interface coverage information; Acquire the execution logic of the interface to be tested corresponding to the interface to be tested information from the development project; Generate a retest task for the interface to be tested according to the execution logic and preset parameter information; The step of generating a retest task of the interface to be tested according to the execution logic and preset parameter information includes: Obtaining a first parameter of the execution logic; Acquire a matching second parameter and a second parameter value of the second parameter from the preset parameter information according to the first parameter; configuring the parameter value of the first parameter in the execution logic to be the second parameter value; A retest task of the interface to be tested is generated according to the execution logic and the second parameter value.
2. The configuration method for interface testing according to claim 1, characterized in that, Identifying the test result information according to the natural language algorithm, and obtaining the test interfaces included in the test task and the execution data corresponding to the test interfaces, including: Identifying the test result information according to the natural language algorithm, and obtaining the entity information matching the preset keyword in the test result information, where the entity information represents the test interface of the test task; Determining the content range of the corresponding test interface according to the entity information; Identifying the content information within the content range according to the natural language algorithm, and obtaining the execution data corresponding to the test interface.
3. The configuration method for interface testing according to claim 2, characterized in that, The step of identifying the content information within the content range according to the natural language algorithm, and obtaining the execution data corresponding to the test interface, includes: Obtaining the prior knowledge data of the entity information; Configuring the prior knowledge data with the natural language algorithm to obtain the natural language algorithm of the prior knowledge; Identifying the content information within the content range according to the natural language algorithm of the prior knowledge, and obtaining the execution data corresponding to the test interface.
4. A configuration device for interface testing, characterized in that Used to implement the method according to any one of claims 1 to 3, including: A log acquisition module, used to acquire the production log information of the development project; An interface identification module, used to identify the production log information based on pre-configured syntax features, and obtain the interface information in the production log information; A test result module, used to obtain the test result information obtained after the execution of the pre-configured test task of the development project from the test tool; A result parsing module, used to identify the test result information according to the natural language algorithm, and obtain the test interfaces included in the test task and the execution data corresponding to the test interfaces; An interface matching module, used to perform consistency matching between the test interface and the interface information, and determine the execution data corresponding to the test interface with consistent requirements as the test data of the interface information; A test statistics module, used to determine the interface coverage information of the test task according to the test data of the interface information.
5. A computer device, including a memory and a processor, the memory stores a computer program, characterized in that When the processor executes the computer program, the steps of the configuration method of the interface test according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium, on which a computer program is stored, characterized in that When the computer program is executed by the processor, the steps of the configuration method of the interface test according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Interface testing method, apparatus, computer device and storage medium
CN109471796A
Interface test case generation method, electronic device and storage medium
CN110647471A