CN116991724A - Interface testing method and device based on monitoring log, electronic equipment and storage medium - Google Patents
Interface testing method and device based on monitoring log, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116991724A CN116991724A CN202310962097.3A CN202310962097A CN116991724A CN 116991724 A CN116991724 A CN 116991724A CN 202310962097 A CN202310962097 A CN 202310962097A CN 116991724 A CN116991724 A CN 116991724A
- Authority
- CN
- China
- Prior art keywords
- interface
- error
- log
- test case
- information
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application provides an interface testing method and device based on a monitoring log, electronic equipment and a storage medium, wherein the interface testing method based on the monitoring log comprises the following steps: determining an interface associated with the abnormal error report log based on the thread identification, and determining the interface associated with the abnormal error report log as an error interface; acquiring interface information of an error interface; acquiring an error information message of an error interface, and analyzing the error information message to obtain the original parameter information of the error interface; based on the original parameter information of the error interface and the interface information of the error interface, constructing a test case aiming at the error interface; and executing the test case of the error interface after the error interface repair is detected, so as to test the error interface based on the test case of the error interface. The application can automatically and accurately position the error interface, automatically construct the test case for testing the error interface, automatically test the error interface based on the test case, and finally improve the test efficiency.
Description
Technical Field
The present application relates to the field of computers, and in particular, to an interface testing method and apparatus based on a monitoring log, an electronic device, and a storage medium.
Background
At present, the traditional software testing method is a black box testing, namely a tester operates a certain function on a front-end interface to verify whether the function meets expectations, however, aiming at the testing method, the tester cannot determine which interface, in particular to a rear-end interface, is wrong on the interface, so the testing method has the defect that the interface cannot be automatically and accurately positioned. On the other hand, the method cannot automatically carry out regression testing on the error interface. In summary, the prior art has the disadvantage of low testing efficiency.
Disclosure of Invention
The embodiment of the application aims to provide an interface test method, device, electronic equipment and storage medium based on a monitoring log, which are used for automatically and accurately positioning an error interface, automatically constructing a test case for testing the error interface, automatically testing the error interface based on the test case and finally improving the test efficiency.
In a first aspect, the present application provides a method for testing an interface based on a monitoring log, the method comprising:
acquiring a monitoring log of a log server;
analyzing the monitoring log of the log server and obtaining an analysis result;
determining an abnormal error report log based on the analysis result, wherein the abnormal error report log comprises a thread identifier;
determining an interface associated with the abnormal error report log based on the thread identification, and determining the interface associated with the abnormal error report log as an error interface;
acquiring interface information of the error interface;
acquiring an error message of the error interface, and analyzing the error message to obtain the original parameter information of the error interface;
based on the original parameter information of the error interface and the interface information of the error interface, constructing a test case aiming at the error interface;
and after the error interface is detected to be repaired, executing the test case of the error interface so as to test the error interface based on the test case of the error interface.
According to the method, the device and the system, the analysis result can be obtained by obtaining the monitoring log of the log server and analyzing the monitoring log of the log server, and then the abnormal error reporting log can be determined based on the analysis result, wherein the abnormal error reporting log comprises the thread identification, and then the interface associated with the abnormal error reporting log can be determined based on the thread identification, and the interface associated with the abnormal error reporting log is determined to be an error interface, so that the error interface can be automatically and accurately positioned based on log data, the time consumption for positioning the error interface is reduced, and the test efficiency is improved. On the other hand, by acquiring the interface information of the error interface, acquiring the error information message of the error interface and analyzing the error information message to obtain the original parameter information of the error interface, the test case aiming at the error interface can be constructed based on the original parameter information of the error interface and the interface information of the error interface, and further after the error interface is detected to be repaired, the test case of the error interface can be executed, so that the error interface is tested based on the test case of the error interface, and finally, the automatic construction of the test case and the automatic execution of the test case are realized, thereby further improving the test efficiency.
In an alternative embodiment, the interface information of the error interface includes an interface url and an interface request method of the error interface.
The interface url and the interface request method of the error interface in the alternative embodiment can be used for constructing test cases, so that the test cases aiming at the error interface are constructed.
In an optional embodiment, the determining the exception report error log based on the parsing result includes:
acquiring a preset log error reporting level and preset error reporting information;
and screening the abnormal error report log from the analysis result based on the error report level of the preset log and the error report information.
According to the alternative embodiment, the error report level and the error report information of the preset log are obtained, so that the abnormal error report log can be screened from the analysis result based on the error report level and the error report information of the preset log.
In an alternative embodiment, after the executing the test case of the error interface, the method further includes:
acquiring a log message of the test case;
and judging whether the error interface is wrong or not based on the log message of the test case.
According to the alternative embodiment, by acquiring the log message of the test case, whether the error interface is wrong or not can be automatically judged based on the log message of the test case, namely whether the error interface is repaired successfully or not is automatically judged, so that the test efficiency is further improved.
In a second aspect, the present application provides an interface testing apparatus based on a monitoring log, the apparatus comprising:
the first acquisition module is used for acquiring a monitoring log of the log server;
the analysis module is used for analyzing the monitoring log of the log server and obtaining an analysis result;
the first determining module is used for determining an abnormal error report log based on the analysis result, wherein the abnormal error report log comprises a thread identifier;
the second determining module is used for determining the interface associated with the abnormal error report log based on the thread identification and determining the interface associated with the abnormal error report log as an error interface;
the second acquisition module is used for acquiring interface information of the error interface;
the third acquisition module is used for acquiring the error message of the error interface and analyzing the error message to obtain the original parameter information of the error interface;
the construction module is used for constructing a test case aiming at the error interface based on the original parameter information of the error interface and the interface information of the error interface;
and the test execution module is used for executing the test case of the error interface after detecting that the error interface is repaired so as to test the error interface based on the test case of the error interface.
According to the second aspect of the application, by acquiring the monitoring log of the log server and analyzing the monitoring log of the log server, an analysis result can be obtained, and then the abnormal error reporting log can be determined based on the analysis result, wherein the abnormal error reporting log comprises a thread identifier, and then the interface associated with the abnormal error reporting log can be determined based on the thread identifier, and the interface associated with the abnormal error reporting log is determined to be an error interface, so that the error interface can be automatically and accurately positioned based on log data, the time consumption for positioning the error interface is reduced, and the test efficiency is improved. On the other hand, by acquiring the interface information of the error interface, acquiring the error information message of the error interface and analyzing the error information message to obtain the original parameter information of the error interface, the test case aiming at the error interface can be constructed based on the original parameter information of the error interface and the interface information of the error interface, and further after the error interface is detected to be repaired, the test case of the error interface can be executed, so that the error interface is tested based on the test case of the error interface, and finally, the automatic construction of the test case and the automatic execution of the test case are realized, thereby further improving the test efficiency.
In an alternative embodiment, the interface information of the error interface includes an interface url and an interface request method of the error interface.
The interface url and the interface request method of the error interface in the alternative embodiment can be used for constructing test cases, so that the test cases aiming at the error interface are constructed.
In an optional implementation manner, the specific manner of the test execution module executing the determination of the exception error log based on the analysis result is:
acquiring a preset log error reporting level and preset error reporting information;
and screening the abnormal error report log from the analysis result based on the error report level of the preset log and the error report information.
According to the alternative embodiment, the error report level and the error report information of the preset log are obtained, so that the abnormal error report log can be screened from the analysis result based on the error report level and the error report information of the preset log.
In an alternative embodiment, the apparatus further comprises:
a fourth obtaining module, configured to obtain a log packet of the test case after the test case of the error interface is executed;
and the judging module is used for judging whether the error interface is wrong or not based on the log message of the test case.
According to the alternative embodiment, by acquiring the log message of the test case, whether the error interface is wrong or not can be automatically judged based on the log message of the test case, namely whether the error interface is repaired successfully or not is automatically judged, so that the test efficiency is further improved.
In a third aspect, the present application provides an electronic device comprising:
a processor; and
a memory configured to store machine readable instructions that, when executed by the processor, perform the monitoring log based interface testing method of any of the preceding embodiments.
According to the electronic equipment of the third aspect of the application, by executing the interface test method based on the monitoring log, the monitoring log of the log server can be obtained, the analysis result can be obtained, and the abnormal error reporting log can be determined based on the analysis result, wherein the abnormal error reporting log comprises a thread identifier, and further the interface associated with the abnormal error reporting log can be determined based on the thread identifier, and the interface associated with the abnormal error reporting log is determined as an error interface, so that the error interface can be automatically and accurately positioned based on log data, the time consumption for positioning the error interface is reduced, and the test efficiency is improved. On the other hand, by acquiring the interface information of the error interface, acquiring the error information message of the error interface and analyzing the error information message to obtain the original parameter information of the error interface, the test case aiming at the error interface can be constructed based on the original parameter information of the error interface and the interface information of the error interface, and further after the error interface is detected to be repaired, the test case of the error interface can be executed, so that the error interface is tested based on the test case of the error interface, and finally, the automatic construction of the test case and the automatic execution of the test case are realized, thereby further improving the test efficiency.
In a fourth aspect, the present application provides a storage medium storing a computer program that is executed by a processor to perform the monitoring log based interface testing method according to any one of the previous embodiments.
According to the storage medium of the fourth aspect of the application, by executing the interface test method based on the monitoring log, the monitoring log of the log server can be obtained, the analysis result can be obtained, and the abnormal error reporting log can be determined based on the analysis result, wherein the abnormal error reporting log comprises a thread identifier, and further the interface associated with the abnormal error reporting log can be determined based on the thread identifier, and the interface associated with the abnormal error reporting log is determined as an error interface, so that the error interface can be automatically and accurately positioned based on log data, the time for positioning the error interface is reduced, and the test efficiency is improved. On the other hand, by acquiring the interface information of the error interface, acquiring the error information message of the error interface and analyzing the error information message to obtain the original parameter information of the error interface, the test case aiming at the error interface can be constructed based on the original parameter information of the error interface and the interface information of the error interface, and further after the error interface is detected to be repaired, the test case of the error interface can be executed, so that the error interface is tested based on the test case of the error interface, and finally, the automatic construction of the test case and the automatic execution of the test case are realized, thereby further improving the test efficiency.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an interface testing method based on a monitoring log according to an embodiment of the present application;
FIG. 2 is a schematic structural diagram of an interface testing device based on a monitoring log according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
Example 1
Referring to fig. 1, fig. 1 is a flow chart of an interface testing method based on a monitoring log according to an embodiment of the present application, and as shown in fig. 1, the method according to the embodiment of the present application includes the following steps:
101. acquiring a monitoring log of a log server;
102. analyzing a monitoring log of the log server and obtaining an analysis result;
103. determining an abnormal error report log based on the analysis result, wherein the abnormal error report log comprises a thread identifier;
104. determining an interface associated with the abnormal error report log based on the thread identification, and determining the interface associated with the abnormal error report log as an error interface;
105. acquiring interface information of an error interface;
106. acquiring an error information message of an error interface, and analyzing the error information message to obtain the original parameter information of the error interface;
107. based on the original parameter information of the error interface and the interface information of the error interface, constructing a test case aiming at the error interface;
108. and after the error interface repair is detected, executing the test case of the error interface so as to test the error interface based on the test case of the error interface.
According to the embodiment of the application, the analysis result can be obtained by obtaining the monitoring log of the log server and the monitoring log of the analysis log server, and then the abnormal error report log can be determined based on the analysis result, wherein the abnormal error report log comprises the thread identification, and then the interface associated with the abnormal error report log can be determined based on the thread identification, and the interface associated with the abnormal error report log is determined as the error interface, so that the error interface can be automatically and accurately positioned based on log data, the time consumption for positioning the error interface is reduced, and the test efficiency is improved. On the other hand, by acquiring the interface information of the error interface, acquiring the error information message of the error interface and analyzing the error information message based on the error information message to obtain the original parameter information of the error interface, the test case aiming at the error interface can be constructed based on the original parameter information of the error interface and the interface information of the error interface, and further, after the error interface is detected to be repaired, the test case of the error interface can be executed, so that the error interface is tested based on the test case of the error interface, and finally, the automatic construction of the test case and the automatic execution of the test case are realized, and further, the test efficiency is further improved.
In the embodiment of the application, the interface test method based on the monitoring log can run on an automatic test platform, wherein the automatic test platform is in communication connection with a plurality of log server servers, so that the monitoring log of the log server can be obtained. Further, the log server can collect the running log of the target software in the user terminal and upload the running log to the automatic test platform at preset time intervals.
In an embodiment of the present application, for step 102, the monitoring log of the log server is transmitted to the automated test platform based on a specific communication protocol, for example, the monitoring log of the log server is transmitted to the automated test platform in an http protocol. Correspondingly, analyzing the monitoring log of the log server and obtaining an analysis result may refer to converting the monitoring log of the log server transmitted in a ciphertext form into a plaintext form.
In the embodiment of the present application, for step 103, since the analysis result includes a normal log and an abnormal error report log, and the processing unique object is the abnormal error report log, the abnormal error report log needs to be determined based on the analysis result, where the abnormal error report log includes information such as a thread identifier, an abnormal error report time, and the like. Further, thread identification refers to thread ID.
In the embodiment of the present application, for step 104, a specific manner of determining the interface associated with the exception reporting log based on the thread identifier is as follows:
inquiring the information of a thread call stack based on the thread ID, and further inquiring the interface ID of the thread call or inquiring the interface name of the thread call based on the information of the thread call stack, wherein the interface of the thread call is the interface associated with the abnormal error report log.
In the embodiment of the present application, for step 105, a specific way to obtain the interface information of the error interface may be: the interface information of the error interface is queried from the database based on the name or ID of the error interface.
In the embodiment of the present application, for step 106, after determining the error interface, the error information message of the error interface may be obtained from the massive message data, for example, the error information message of the error interface is searched by using the ID of the error interface as a search condition. On the other hand, the original parameter information of the error interface refers to the input parameter of the error interface, wherein the original parameter information of the error interface is acquired, and the error needs to be judged on the input parameter, so that when the repaired interface is tested by using the test case later, the original parameter information is used as the input parameter of the test case, the test condition of the test case is the same as the error condition of the interface, and the reliability of the test result is improved.
In an alternative embodiment, the interface information of the error interface includes an interface url of the error interface and an interface request method.
The interface url and the interface request method of the error interface in the alternative embodiment can be used for constructing test cases, so that the test cases aiming at the error interface are constructed.
In an embodiment of the present application, as an optional implementation manner, the steps include: determining an exception reporting log based on the parsing result, comprising the sub-steps of:
acquiring a preset log error reporting level and preset error reporting information;
and screening out abnormal error report logs from the analysis result based on the error report level of the preset log and the error report information.
According to the alternative embodiment, the error report level and the error report information of the preset log are obtained, so that the abnormal error report log can be screened from the analysis result based on the error report level and the error report information of the preset log.
For the above optional embodiment, since the analysis result includes the normal log and the abnormal error report log, the preset error report information is required to screen the abnormal error report log from the analysis result, and further, the abnormal error report log includes the log caused by the interface error and the log caused by the non-interface error, and therefore, the abnormal error report log is further required to be screened according to the preset log error report level, where the log caused by the interface error may be generally set to L1 level, and the log caused by the non-interface error may be set to L2 level.
In an alternative embodiment, at step: after executing the test case of the error interface, the method of the embodiment of the application further comprises the following steps:
acquiring a log message of a test case;
and judging whether the error interface is wrong or not based on the log message of the test case.
According to the alternative embodiment, by acquiring the log message of the test case, whether the error interface is wrong or not can be automatically judged based on the log message of the test case, namely whether the error interface is repaired successfully or not is automatically judged, so that the test efficiency is further improved.
For the above optional implementation manner, a specific manner for judging whether the error interface is wrong based on the log message of the test case is as follows:
judging whether the log message of the test case is an abnormal error message or not, and if the log message of the test case belongs to the abnormal error message, determining that an error interface is wrong.
For the above optional implementation manner, when the error interface is wrong, it is indicated that the repair of the error interface is unsuccessful, and at this time, corresponding prompt information may be generated to prompt a developer to repair the error interface again through the prompt information.
Example two
Referring to fig. 2, fig. 2 is a schematic structural diagram of an interface testing device based on a monitoring log according to an embodiment of the present application, and as shown in fig. 2, the device according to the embodiment of the present application includes the following functional modules:
a first obtaining module 201, configured to obtain a monitoring log of a log server;
the analysis module 202 is configured to analyze the monitoring log of the log server and obtain an analysis result;
a first determining module 203, configured to determine an exception error report log based on the analysis result, where the exception error report log includes a thread identifier;
a second determining module 204, configured to determine an interface associated with the abnormal error reporting log based on the thread identifier, and determine the interface associated with the abnormal error reporting log as an error interface;
a second obtaining module 205, configured to obtain interface information of the error interface;
the third obtaining module 206 is configured to obtain an error information packet of the error interface, and obtain original parameter information of the error interface based on analysis of the error information packet;
a construction module 207, configured to construct a test case for the error interface based on the original parameter information of the error interface and the interface information of the error interface;
the test execution module 208 is configured to execute the test case of the error interface after detecting that the error interface is repaired, so as to test the error interface based on the test case of the error interface.
According to the embodiment of the application, the analysis result can be obtained by obtaining the monitoring log of the log server and the monitoring log of the analysis log server, and then the abnormal error report log can be determined based on the analysis result, wherein the abnormal error report log comprises the thread identification, and then the interface associated with the abnormal error report log can be determined based on the thread identification, and the interface associated with the abnormal error report log is determined as the error interface, so that the error interface can be automatically and accurately positioned based on log data, the time consumption for positioning the error interface is reduced, and the test efficiency is improved. On the other hand, by acquiring the interface information of the error interface, acquiring the error information message of the error interface and analyzing the error information message based on the error information message to obtain the original parameter information of the error interface, the test case aiming at the error interface can be constructed based on the original parameter information of the error interface and the interface information of the error interface, and further, after the error interface is detected to be repaired, the test case of the error interface can be executed, so that the error interface is tested based on the test case of the error interface, and finally, the automatic construction of the test case and the automatic execution of the test case are realized, and further, the test efficiency is further improved.
In an alternative embodiment, the interface information of the error interface includes an interface url of the error interface and an interface request method.
The interface url and the interface request method of the error interface in the alternative embodiment can be used for constructing test cases, so that the test cases aiming at the error interface are constructed.
In an alternative embodiment, the specific manner in which the test execution module executes the determination of the exception reporting log based on the analysis result is:
acquiring a preset log error reporting level and preset error reporting information;
and screening out abnormal error report logs from the analysis result based on the error report level of the preset log and the error report information.
According to the alternative embodiment, the error report level and the error report information of the preset log are obtained, so that the abnormal error report log can be screened from the analysis result based on the error report level and the error report information of the preset log.
In an alternative embodiment, the apparatus further comprises:
the fourth acquisition module is used for acquiring a log message of the test case after executing the test case of the error interface;
and the judging module is used for judging whether the error interface is wrong or not based on the log message of the test case.
According to the alternative embodiment, by acquiring the log message of the test case, whether the error interface is wrong or not can be automatically judged based on the log message of the test case, namely whether the error interface is repaired successfully or not is automatically judged, so that the test efficiency is further improved.
It should be noted that, for other detailed descriptions of the apparatus according to the embodiment of the present application, please refer to the related description of the first embodiment of the present application, which is not repeated herein.
Example III
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 3, the electronic device according to the embodiment of the present application includes:
a processor 301; and
a memory 302 configured to store machine readable instructions that, when executed by the processor 301, perform the monitoring log based interface testing method of any of the previous embodiments.
According to the electronic equipment, by executing the interface test method based on the monitoring log, the monitoring log of the log server and the monitoring log of the analysis log server can be obtained, the analysis result can be obtained, and the abnormal error report log can be determined based on the analysis result, wherein the abnormal error report log comprises the thread identification, and further the interface associated with the abnormal error report log can be determined based on the thread identification, and the interface associated with the abnormal error report log is determined to be an error interface, so that the error interface can be automatically and accurately positioned based on log data, the time consumption for positioning the error interface is reduced, and the test efficiency is improved. On the other hand, by acquiring the interface information of the error interface, acquiring the error information message of the error interface and analyzing the error information message based on the error information message to obtain the original parameter information of the error interface, the test case aiming at the error interface can be constructed based on the original parameter information of the error interface and the interface information of the error interface, and further, after the error interface is detected to be repaired, the test case of the error interface can be executed, so that the error interface is tested based on the test case of the error interface, and finally, the automatic construction of the test case and the automatic execution of the test case are realized, and further, the test efficiency is further improved.
Example IV
An embodiment of the present application provides a storage medium storing a computer program that is executed by a processor to perform the monitoring log-based interface test method according to any one of the foregoing embodiments.
According to the storage medium of the fourth aspect of the application, by executing the interface test method based on the monitoring log, the monitoring log of the log server and the monitoring log of the analysis log server can be obtained, further the analysis result can be obtained, further the abnormal error report log can be determined based on the analysis result, wherein the abnormal error report log comprises the thread identification, further the interface associated with the abnormal error report log can be determined based on the thread identification, and the interface associated with the abnormal error report log is determined as an error interface, so that the error interface can be automatically and accurately positioned based on log data, the time consumption for positioning the error interface is reduced, and the test efficiency is improved. On the other hand, by acquiring the interface information of the error interface, acquiring the error information message of the error interface and analyzing the error information message based on the error information message to obtain the original parameter information of the error interface, the test case aiming at the error interface can be constructed based on the original parameter information of the error interface and the interface information of the error interface, and further, after the error interface is detected to be repaired, the test case of the error interface can be executed, so that the error interface is tested based on the test case of the error interface, and finally, the automatic construction of the test case and the automatic execution of the test case are realized, and further, the test efficiency is further improved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or two or more modules may be integrated to form a single portion.
It should be noted that the functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM) random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above embodiments of the present application are only examples, and are not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (10)
1. An interface testing method based on a monitoring log, which is characterized by comprising the following steps:
acquiring a monitoring log of a log server;
analyzing the monitoring log of the log server and obtaining an analysis result;
determining an abnormal error report log based on the analysis result, wherein the abnormal error report log comprises a thread identifier;
determining an interface associated with the abnormal error report log based on the thread identification, and determining the interface associated with the abnormal error report log as an error interface;
acquiring interface information of the error interface;
acquiring an error message of the error interface, and analyzing the error message to obtain the original parameter information of the error interface;
based on the original parameter information of the error interface and the interface information of the error interface, constructing a test case aiming at the error interface;
and after the error interface is detected to be repaired, executing the test case of the error interface so as to test the error interface based on the test case of the error interface.
2. The method of claim 1, wherein the interface information of the error interface includes an interface url and an interface request method of the error interface.
3. The method of claim 1, wherein the determining an exception error log based on the parsing result comprises:
acquiring a preset log error reporting level and preset error reporting information;
and screening the abnormal error report log from the analysis result based on the error report level of the preset log and the error report information.
4. The method of claim 1, wherein after the executing the test case of the faulty interface, the method further comprises:
acquiring a log message of the test case;
and judging whether the error interface is wrong or not based on the log message of the test case.
5. An interface testing apparatus based on a monitoring log, the apparatus comprising:
the first acquisition module is used for acquiring a monitoring log of the log server;
the analysis module is used for analyzing the monitoring log of the log server and obtaining an analysis result;
the first determining module is used for determining an abnormal error report log based on the analysis result, wherein the abnormal error report log comprises a thread identifier;
the second determining module is used for determining the interface associated with the abnormal error report log based on the thread identification and determining the interface associated with the abnormal error report log as an error interface;
the second acquisition module is used for acquiring interface information of the error interface;
the third acquisition module is used for acquiring the error message of the error interface and analyzing the error message to obtain the original parameter information of the error interface;
the construction module is used for constructing a test case aiming at the error interface based on the original parameter information of the error interface and the interface information of the error interface;
and the test execution module is used for executing the test case of the error interface after detecting that the error interface is repaired so as to test the error interface based on the test case of the error interface.
6. The apparatus of claim 5, wherein the interface information of the error interface includes an interface url and an interface request method of the error interface.
7. The apparatus of claim 6, wherein the test execution module performs the determining the exception error log based on the parsing result in the following manner:
acquiring a preset log error reporting level and preset error reporting information;
and screening the abnormal error report log from the analysis result based on the error report level of the preset log and the error report information.
8. The apparatus of claim 5, wherein the apparatus further comprises:
a fourth obtaining module, configured to obtain a log packet of the test case after the test case of the error interface is executed;
and the judging module is used for judging whether the error interface is wrong or not based on the log message of the test case.
9. An electronic device, comprising:
a processor; and
a memory configured to store machine readable instructions that, when executed by the processor, perform the monitoring log based interface testing method of any of claims 1-4.
10. A storage medium storing a computer program to be executed by a processor to perform the monitoring log based interface test method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310962097.3A CN116991724A (en) | 2023-07-31 | 2023-07-31 | Interface testing method and device based on monitoring log, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310962097.3A CN116991724A (en) | 2023-07-31 | 2023-07-31 | Interface testing method and device based on monitoring log, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116991724A true CN116991724A (en) | 2023-11-03 |
Family
ID=88524354
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310962097.3A Pending CN116991724A (en) | 2023-07-31 | 2023-07-31 | Interface testing method and device based on monitoring log, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116991724A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119645874A (en) * | 2024-12-13 | 2025-03-18 | 北京市新技术应用研究所有限公司 | Configurable defect and test case automatic generation method |
-
2023
- 2023-07-31 CN CN202310962097.3A patent/CN116991724A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119645874A (en) * | 2024-12-13 | 2025-03-18 | 北京市新技术应用研究所有限公司 | Configurable defect and test case automatic generation method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109885496B (en) | Test log management method and system | |
CN112100048B (en) | Self-adaptive inspection method and device for server | |
CN113672456B (en) | Modularized self-monitoring method, system, terminal and storage medium of application platform | |
CN108009085B (en) | Channel package testing method | |
CN110088744A (en) | A database maintenance method and system thereof | |
CN112235128B (en) | Transaction path analysis method, device, server and storage medium | |
CN112540887A (en) | Fault drilling method and device, electronic equipment and storage medium | |
CN107203464B (en) | Method and device for positioning service problem | |
US8327189B1 (en) | Diagnosing an incident on a computer system using a diagnostics analyzer database | |
CN116991724A (en) | Interface testing method and device based on monitoring log, electronic equipment and storage medium | |
CN111835566A (en) | System fault management method, device and system | |
CN114327967A (en) | Equipment repairing method and device, storage medium and electronic device | |
CN108710573A (en) | It is a kind of that test method, device, storage medium and terminal a little are buried based on daily record | |
CN113448786A (en) | PCIe equipment testing method, device, equipment and readable storage medium | |
CN112131091B (en) | Test method and device and electronic equipment | |
CN118132419A (en) | Method for generating test code, automatic regression test method and device thereof | |
CN109086185B (en) | Fault detection method, device and equipment of storage cluster and storage medium | |
CN115941438A (en) | Method and device for processing fault information, storage medium and electronic device | |
CN116506340A (en) | Flow link testing method and device, electronic equipment and storage medium | |
CN115757138A (en) | Method and device for determining script abnormal reason, storage medium and electronic equipment | |
CN114095217A (en) | Evidence obtaining and tracing method and system for failing host snapshot | |
CN110362464B (en) | Software analysis method and equipment | |
CN108845932B (en) | Unit testing method and device of network library, storage medium and terminal | |
CN115529250B (en) | Flow playback method and device, electronic equipment and storage medium | |
CN114816876B (en) | Automatic test system for server Redfish interface specifications |
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 |