CN114253846B - Automatic test abnormality positioning method, device, equipment and readable storage medium - Google Patents

Automatic test abnormality positioning method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN114253846B
CN114253846B CN202111548859.2A CN202111548859A CN114253846B CN 114253846 B CN114253846 B CN 114253846B CN 202111548859 A CN202111548859 A CN 202111548859A CN 114253846 B CN114253846 B CN 114253846B
Authority
CN
China
Prior art keywords
target interface
interface
target
determining
belongs
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.)
Active
Application number
CN202111548859.2A
Other languages
Chinese (zh)
Other versions
CN114253846A (en
Inventor
胡鹏强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202111548859.2A priority Critical patent/CN114253846B/en
Publication of CN114253846A publication Critical patent/CN114253846A/en
Application granted granted Critical
Publication of CN114253846B publication Critical patent/CN114253846B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing

Landscapes

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

Abstract

The application provides an automatic test abnormality positioning method, an automatic test abnormality positioning device and a readable storage medium, which can be applied to the field of automatic software test and comprise the following steps: determining a target interface of the automatic test case for reporting errors in the operation process according to error reporting information generated in the operation process of the automatic test case, and determining a system name of a system to which the target interface belongs according to a domain name of the target interface; and determining the abnormal target system in the system call link corresponding to the target interface by using a preset link monitoring program according to the system name of the system to which the target interface belongs. According to the application, the abnormal target system in the system call link corresponding to the target interface can be determined based on the system name of the error-reported target interface and the preset link monitoring program, so that a tester can be helped to locate the abnormal target system at the highest speed, the time required for checking the reasons of the abnormality is saved, and the automatic test efficiency is effectively improved.

Description

Automatic test abnormality positioning method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of software testing technologies, and in particular, to an automatic test anomaly positioning method, an automatic test anomaly positioning device, an automatic test anomaly positioning apparatus, and a readable storage medium.
Background
In order to ensure that the system can provide normal service for an external system, testing a system server is an important link. In routine testing work, testers often use automated scripts to execute test cases or prepare test data.
Where an automation script often involves request calls (multiple interface requests) to multiple systems (services). For example, the automation script, during execution, requests for interface A1, and interface A1, during processing, requests for interface C2. And executing an automatic script, which requires joint processing of a plurality of systems, and after the joint processing is successful, the script calculates that the execution is successful, if any interface or system is abnormal or unexpected, the automatic script will fail to execute and return error information to a tester, and the tester needs to locate and check the problem according to the error information.
Unfortunately, however, the tester can only see the error information of the first layer, for example, if the interface C2 performs an exception, the error information is returned to the interface A1, and the interface A1 also processes the exception because the interface C2 returns the exception, and returns the exception information to the automation script, at this time, the tester can only see the exception information returned by the interface A1 (i.e., the first layer error information). In general, only the first layer error information is not able to distinguish the root cause of the error, the tester can only first locate which interface in the script reports the error through the first layer error information, then judge which system the error reporting interface belongs to, and then check the system log, and analyze the error cause from the context log of the system log, so that the workload of checking and locating the cause in the whole process is huge, especially when the system link is long, the time and effort are more consumed.
Disclosure of Invention
The application provides an automatic test abnormality positioning method, an automatic test abnormality positioning device, automatic test abnormality positioning equipment and a readable storage medium, which can effectively improve the efficiency of automatic test abnormality positioning.
In a first aspect, the present application provides a method for locating an automated test anomaly, the method comprising:
Determining a target interface of an automatic test case for reporting errors in the operation process according to error reporting information generated in the operation process of the automatic test case;
Determining the system name of the system to which the target interface belongs according to the domain name of the target interface;
and determining the abnormal target system in the system call link corresponding to the target interface by using a preset link monitoring program according to the system name of the system to which the target interface belongs.
In one possible implementation, each interface request in the automated test case is written in a try-catch code block;
the determining the error reporting target interface of the automatic test case in the operation process according to the error reporting information generated by the automatic test case in the operation process comprises the following steps:
Acquiring error reporting information generated by the try-catch code block in the running process of the automatic test case;
And determining a target interface with an abnormality in the operation process of the automatic test case according to the error reporting information.
In a possible implementation manner, the determining, according to the domain name of the target interface, the system name of the system to which the target interface belongs includes:
and determining the system name of the system to which the target interface belongs according to the domain name of the target interface and a pre-established corresponding relation table between the domain name of each interface and the system name of the system to which each interface belongs.
In a possible implementation manner, the determining, according to the system name of the system to which the target interface belongs, the target system having an abnormality in the system call link corresponding to the target interface by using a preset link monitor includes:
Based on a preset link monitoring program, sending a first test parameter to the target interface in a GET mode, wherein the first test parameter comprises a time interval in which a searched interface request is located, the number of the searched interface requests and the system name of a system to which the target interface belongs;
determining all interface requests occurring in a system to which the target interface belongs in the time interval according to result data corresponding to the first test parameters returned by the target interface;
Determining a second test parameter according to all interface requests in the system to which the target interface belongs in the time interval;
and sending the second test parameters to the target interface in a POST mode, and determining a target system with abnormality in a system call link corresponding to the target interface according to result data corresponding to the second test parameters returned by the target interface.
In a possible implementation manner, the result data corresponding to the first test parameter includes a first list and a second list, where the first list includes meta information of all interface requests that occur in the system to which the target interface belongs in the time interval, and the second list includes direction information of all interface requests that occur in the system to which the target interface belongs in the time interval;
the determining a second test parameter according to all interface requests occurring in the system to which the target interface belongs in the time interval includes:
Determining a target interface request with errors in all interface requests occurring in a system to which the target interface belongs in the time interval according to the first list, and acquiring meta information corresponding to the target interface request;
acquiring direction information corresponding to the target interface request in the second list;
And generating the second test parameters according to the meta information and the direction information corresponding to the target interface request.
In a possible implementation manner, the determining, according to the result data corresponding to the second test parameter returned by the target interface, that the target system has an abnormality in the system call link corresponding to the target interface includes:
generating a parameter entering character string according to the value of a preset field in the result data corresponding to the second test parameter; wherein, the preset field includes traceId, collectorAcceptTime and an elased field;
and determining a target system with abnormality in a system call link corresponding to the target interface according to the parameter entering character string.
In a possible implementation manner, the determining, according to the entry string, a target system in which an exception exists in a system call link corresponding to the target interface includes:
Sending a query request to the target interface, wherein the query request comprises the parameter entering character string;
And determining a target system with abnormality in a system call link corresponding to the target interface according to the response message returned by the target interface.
In a possible embodiment, the method further includes:
And writing the system name of the system to which the target interface belongs and the entry character string into a test report.
In a second aspect, the present application provides an automated test anomaly locating device, comprising:
the detection module is used for determining a target interface of the automatic test case for reporting errors in the operation process according to error reporting information generated in the operation process of the automatic test case;
the searching module is used for determining the system name of the system to which the target interface belongs according to the domain name of the target interface;
And the processing module is used for determining the abnormal target system in the system call link corresponding to the target interface by utilizing a preset link monitoring program according to the system name of the system to which the target interface belongs.
In a third aspect, the present application provides an electronic device comprising: at least one processor and memory;
The memory stores computer-executable instructions;
The at least one processor executes computer-executable instructions stored by the memory, causing the at least one processor to perform the automated test anomaly localization method as provided in the first aspect.
In a fourth aspect, the present application provides a computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement the automated test anomaly localization method as provided in the first aspect.
The automatic test abnormality positioning method, the device, the equipment and the readable storage medium provided by the application can realize the following steps: determining a target interface of the automatic test case for reporting errors in the operation process according to error reporting information generated in the operation process of the automatic test case, and determining a system name of a system to which the target interface belongs according to a domain name of the target interface; and determining the abnormal target system in the system call link corresponding to the target interface by using a preset link monitoring program according to the system name of the system to which the target interface belongs. According to the application, the abnormal target system in the system call link corresponding to the target interface can be determined based on the system name of the error-reported target interface and the preset link monitoring program, so that a tester can be helped to locate the abnormal target system at the highest speed, the time required for checking the reasons of the abnormality is saved, and the automatic test efficiency is effectively improved.
Drawings
FIG. 1 is a schematic diagram of a system call of an automation script in an execution process according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of an automatic test anomaly locating method according to an embodiment of the present application;
FIG. 3 is a schematic sub-flowchart of an automatic test anomaly localization method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a program module of an automatic test anomaly locating device according to an embodiment of the present application;
Fig. 5 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application. Furthermore, while the present disclosure has been described in terms of an exemplary embodiment or embodiments, it should be understood that each aspect of the disclosure can be practiced separately from the other aspects.
It should be noted that the brief description of the terminology in the present application is for the purpose of facilitating understanding of the embodiments described below only and is not intended to limit the embodiments of the present application. Unless otherwise indicated, these terms should be construed in their ordinary and customary meaning.
The terms first, second and the like in the description and in the claims and in the above-described figures are used for distinguishing between similar or similar objects or entities and not necessarily for describing a particular sequential or chronological order, unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are, for example, capable of operation in sequences other than those illustrated or otherwise described herein.
Furthermore, the terms "comprise" and "have," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to those elements expressly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
The term "module" as used in this disclosure refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and/or software code that is capable of performing the function associated with that element.
In routine testing work, testers often use automated scripts to execute test cases or prepare test data. An automation script often involves a request call (multiple interface requests) to multiple systems (services).
For a better understanding of the embodiments of the present application, referring to fig. 1, fig. 1 is a schematic diagram of a system call of an automation script in an execution process according to an embodiment of the present application.
As shown in fig. 1, the automation script, during execution, requests to interfaces A1, B1, C1 occur, while interface A1, during processing, requests to interface C2 occur, while interface C2, during processing, requests to other interfaces (e.g., interface E1) occur, and during this process, three different systems (services) are involved A, C, E. Similarly, when the interface B1 processes, a request for the interface D1 occurs again, and in this process, two different systems (services) are involved B, D; interface C1, in turn, makes a request for interface D2 during processing, while interface C2, in turn, makes a request for interface E2 (e.g., interface), which involves C, D, E different systems (services) during processing.
As can be seen from FIG. 1, executing an automated script requires joint processing of multiple systems, and after all processing is successful, the script calculates that the execution is successful, if any one of the interfaces or systems is abnormal or unexpected, the automated script will fail to execute and return an error message to the tester, and the tester needs to locate the troubleshooting problem according to the error message. Unfortunately, the tester can only see the error information of the first layer, which is very disadvantageous for locating the root cause of the error.
Still taking fig. 1 as an example, if the interface E1 performs an exception, an error message is returned to the interface C2, and the interface C2 also processes the exception because the interface E1 returns the exception, and returns the exception message to the interface A1, and finally the interface A1 also processes the exception and returns the exception message to the automation script, at this time, the tester only sees the exception message (i.e. the first layer error message) returned by the interface A1.
Typically, only the first layer error information is looked at, and the root cause that caused the error is not resolved. Under the condition, a tester can only locate which interface in the script reports errors through the first layer error information, then judge which system the error reporting interface belongs to, then check the system log, and analyze the error reasons from the context log of the system log. At this time, if it is determined that the error may be caused by other upstream systems, it is necessary to find the developer/tester communication of the corresponding upstream system, to help the developer/tester to check the context log of their system and analyze whether there is an error, and if it is determined that there is an error, further analysis is performed. During further analysis, errors are likely to be found to be caused by another upstream system, so that development/testing personnel who continue to find the other upstream system continue to communicate, and so on, the troubleshooting workload, the communication workload and the positioning cause workload of the whole process are huge, and particularly when a system link is long, the time and the labor are more consumed.
In view of the above technical problems, this embodiment provides an automatic test anomaly positioning method, so that when a tester fails to execute an automatic test script, the script can automatically return error information (including the whole interface call chain information, the system name, the class name, the method name and the error log) of a system which finally causes errors in a system call link of an error interface, thereby helping the tester locate a root cause at the fastest speed, so that the tester can directly find out a development/tester corresponding to the system to communicate with the tester to solve the problem, thereby saving time and communication time for a large number of troubleshooting problems in an intermediate link, effectively improving the efficiency of solving the problem, and improving the automatic test efficiency. The following will explain in detail the embodiments.
Referring to fig. 2, fig. 2 is a flow chart of an automatic test anomaly positioning method according to an embodiment of the present application, and in a possible implementation manner, the automatic test anomaly positioning method includes:
S201, determining a target interface for reporting errors of the automatic test cases in the operation process according to error reporting information generated by the automatic test cases in the operation process.
In some embodiments, an automated test scenario may be executed using an automated test script, and during operation of the automated test scenario, if error reporting information is generated, a target interface for reporting errors is determined according to the error reporting information.
S202, determining the system name of the system to which the target interface belongs according to the domain name of the target interface.
In a possible implementation manner, a correspondence table between domain names including all interfaces and system names of systems to which the interfaces belong may be pre-established and maintained, and the correspondence table may be stored in a database.
After the error-reported target interface is determined, the system name of the system to which the target interface belongs can be found out from the corresponding relation table according to the domain name of the target interface.
In some embodiments, after the system name of the system to which the target interface belongs is found, the interface information of the target interface and the system name of the system to which the target interface belongs may be written into the test report.
Optionally, the interface information includes, but is not limited to: interface request time, interface domain name, interface URL, etc.
S203, determining a target system with abnormality in a system call link corresponding to the target interface by using a preset link monitoring program according to the system name of the system to which the target interface belongs.
In some embodiments, after determining the system name of the system to which the target interface belongs, the system name of the system to which the target interface belongs and a preset link monitor program may be used to determine that an abnormal target system exists in the system call link corresponding to the target interface.
Alternatively, the link monitor may employ pinpoint link monitor tools.
It should be noted that the present application is not limited to use of pinpoint link monitoring tools, and in other embodiments, other link monitoring tools may be used to obtain the system call link information of the error reporting interface.
The automatic test abnormality positioning method provided by the application can determine the abnormal target system in the system call link corresponding to the target interface based on the system name of the error-reported target interface and the preset link monitoring program, thereby helping a tester to position the abnormal target system at the highest speed, saving the time required for checking the cause of the abnormality and effectively improving the automatic test efficiency.
Based on what has been described in the above embodiments, in one possible implementation, an automated test framework may be improved, all codes that make interface requests are written in a try-catch code block, and for each interface request, it is checked whether the content returned by the interface request meets expectations. If not, an exception is captured in the catch.
Wherein, the syntax of the try-catch code block is as follows:
try{
* Code that is likely to be erroneous
}
catch{
* Post-error processing
}
If the code in the try has no error, the program normally runs the content in the try and then does not execute the content in the catch; if the code in the try is wrong, the program jumps into the catch immediately to execute the code, and all codes after the error code in the try are not executed any more.
In the embodiment of the application, after the abnormality is captured in the catch, the system name of the interface is queried in the corresponding relation table according to the domain name of the interface with error reporting, and the interface information (including interface request time, interface domain name, interface URL and the like) and the system name are written into the test report.
Based on the description of the foregoing embodiments, referring to fig. 3, fig. 3 is a schematic sub-flowchart of an automatic test anomaly positioning method according to an embodiment of the present application.
In some embodiments, the target system with the exception in the system call link corresponding to the target interface may be determined by:
S301, based on a preset link monitoring program, sending a first test parameter to a target interface in a GET mode, wherein the first test parameter comprises a time interval in which a searched interface request is located, the number of the searched interface requests and the system name of a system to which the target interface belongs.
In one possible implementation, the request may be in the GET manner: http:// pinpoint. Xxx. Com/getScatterData. Pinpoint, parameter content is :to=1631345452000&from=1631345152000&limit=5000&filter=&application=kcard-wxbasic-service
Where "xxx" indicates a domain name of the target interface, to is an end time of a time interval in which the searched interface request is located, from indicates a start time of the time interval, limit indicates a number range of the searched interface request number, and application indicates a system name of a system to which the target interface belongs.
In the embodiment of the present application, for the accuracy of the search, the start time and the end time may be set to be respectively within 2 seconds before and after the request time of the interface that is reported by the error in the automated test.
S302, determining all interface requests generated in a system to which the target interface belongs in the time interval according to result data corresponding to the first test parameters returned by the target interface.
In the embodiment of the application, the relevant information of all interface requests which occur in the system to which the target interface belongs in the appointed time interval is obtained through the result data returned by the request, and the information is screened to obtain the content of the parameter values which form the next request.
S303, determining a second test parameter according to all interface requests in the system to which the target interface belongs in the time interval.
In some embodiments, the result data returned by the request includes a field scanner, where two list elements metadata (first list), dotList (second list) are included, where dotList includes meta information of all interface requests that occur in the system to which the target interface belongs in the time interval, and metadata includes direction information of all interface requests that occur in the system to which the target interface belongs in the time interval (interface request is from which system instance to which system instance).
Returning the content data patterns such as:
"127":["wxbasic-service-2hxsz","app-mpbalance-dqws5",1630654535754]
in some embodiments, the second test parameter may be determined as follows:
determining a target interface request which is wrong in all interface requests in a system to which the target interface belongs in the time interval according to the first list, and acquiring meta information corresponding to the target interface request; in the second list, obtaining direction information corresponding to the target interface request; and generating a second test parameter according to the meta information and the direction information corresponding to the target interface request.
Exemplary, include:
a. The data item with the value 0 in the next to last field in dotList is fetched (0 represents an interface request with a report error). Examples: [234032,273,127,913269,0,1]
B. and searching the data item in the metadata according to the value of the 3 rd field in the fetched data item.
For example: the data item "127" in metadata can be found by using 127 [ "wxbasic-service-2hxsz", "app-mpbalance-dqws", 1630654535754]
C. And (5) taking out the data obtained in the previous two steps to form a second test parameter.
S304, the second test parameters are sent to the target interface in a POST mode, and a target system with abnormality in a system call link corresponding to the target interface is determined according to result data corresponding to the second test parameters returned by the target interface.
In a possible implementation, http:// pinpoint. Xxx. Com/transactionmetadata. Pinpoint may be requested in POST, with the parameter content being the second test parameter.
Extracting the value of traceId, collectorAcceptTime, elapsed field of the returned message in the request to form the parameter entering character string of 'checking error stack information'.
And writing the parameter entering character string obtained in the last step into a test report as a part of the test case execution failure information. Therefore, after the automatic test is finished, a tester can see that the error information of the failed use case comprises the following contents when checking the test report: error interface information (request time, domain name, URL, error content, name of the system to which the error content belongs), and entry string.
In some embodiments, a method of "looking up error stack information" is provided. The tester calls the method, takes the input character string which is checked in the test report as an input parameter value, and the program can automatically open the web browser and finally cause error information of an error system in a system call link of the page display error interface.
The page is pinpoint implemented by entering a designated entry string, so that the user can view the desired interface call chain information.
It should be noted that, the link monitoring tool used in the above embodiment is pinpoint, but the scheme provided by the present application is not limited to pinpoint, and other link monitoring tools are also possible.
In addition, pinpoint access domain names within different enterprises are different, and the domain name used in the present application is pinpoint.
The automatic test abnormality positioning method provided by the application can determine the abnormal target system in the system call link corresponding to the target interface based on the system name of the error-reported target interface and the preset link monitoring program, thereby helping a tester to position the abnormal target system at the highest speed, saving the time required for checking the cause of the abnormality and effectively improving the automatic test efficiency.
Based on the description of the foregoing embodiments, an automatic test anomaly positioning device is further provided in the embodiments of the present application, and referring to fig. 4, fig. 4 is a schematic program module diagram of an automatic test anomaly positioning device provided in the embodiments of the present application, where the automatic test anomaly positioning device includes:
The detection module 401 is configured to determine a target interface of the automated test case for reporting errors during operation according to error reporting information generated during operation of the automated test case.
The searching module 402 is configured to determine, according to the domain name of the target interface, a system name of a system to which the target interface belongs.
The processing module 403 is configured to determine, according to a system name of a system to which the target interface belongs, a target system having an abnormality in a system call link corresponding to the target interface by using a preset link monitoring program.
In one possible implementation, each interface request in the automated test case described above is written in a try-catch code block. The detection module 401 is specifically configured to:
acquiring error reporting information generated by a try-catch code block in the running process of an automatic test case; and determining a target interface with abnormality in the operation process of the automatic test case according to the error reporting information.
In one possible implementation, the lookup module 402 is specifically configured to:
and determining the system name of the system to which the target interface belongs according to the domain name of the target interface and a pre-established corresponding relation table between the domain name of each interface and the system name of the system to which each interface belongs.
In one possible implementation, the processing module 403 is specifically configured to:
based on a preset link monitoring program, a first test parameter is sent to a target interface in a GET mode, wherein the first test parameter comprises a time interval in which a searched interface request is located, the number of the searched interface requests and the system name of a system to which the target interface belongs.
And determining all interface requests in the system to which the target interface belongs in the time interval according to the result data corresponding to the first test parameter returned by the target interface.
And determining a second test parameter according to all interface requests in the system to which the target interface belongs in the time interval.
And sending the second test parameters to the target interface in a POST mode, and determining a target system with abnormality in a system call link corresponding to the target interface according to result data corresponding to the second test parameters returned by the target interface.
In a possible implementation manner, the result data corresponding to the first test parameter includes a first list and a second list, where the first list includes meta information of all interface requests that occur in the system to which the target interface belongs in the time interval, and the second list includes direction information of all interface requests that occur in the system to which the target interface belongs in the time interval.
The processing module 403 is specifically configured to:
determining a target interface request with errors in all interface requests in a system to which the target interface belongs in the time interval according to the first list, and acquiring meta information corresponding to the target interface request; in the second list, obtaining direction information corresponding to the target interface request; and generating a second test parameter according to the meta information and the direction information corresponding to the target interface request.
In one possible implementation, the processing module 403 is specifically configured to:
generating a parameter entering character string according to the value of a preset field in the result data corresponding to the second test parameter; the preset field includes traceId, collectorAcceptTime and an elased field. And determining a target system with abnormality in a system call link corresponding to the target interface according to the parameter entering character string.
In one possible implementation, the processing module 403 is specifically configured to:
sending a query request to a target interface, wherein the query request comprises the parameter entering character string; and determining the abnormal target system in the system call link corresponding to the target interface according to the response message returned by the target interface.
In one possible implementation, the processing module 403 is further configured to:
And writing the system name of the system to which the target interface belongs and the entry character string into a test report.
The automatic test abnormality positioning device provided by the application can determine the abnormal target system in the system call link corresponding to the target interface based on the system name of the error-reported target interface and the preset link monitoring program, thereby helping a tester to position the abnormal target system at the highest speed, saving the time required for checking the cause of the abnormality and effectively improving the automatic test efficiency.
It should be noted that, in the embodiment of the present application, the specific execution content of the detection module 401, the search module 402, and the processing module 403 may refer to the relevant content in the embodiment shown in fig. 2 to 3, which is not described herein.
Further, based on the description in the above embodiment, the embodiment of the present application further provides an electronic device, where the electronic device includes at least one processor and a memory; wherein the memory stores computer-executable instructions; the at least one processor executes computer-executable instructions stored in the memory to implement the steps of the automated test anomaly localization method as described in the above embodiments, which are not described herein.
For better understanding of the embodiments of the present application, referring to fig. 5, fig. 5 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
As shown in fig. 5, the electronic device 50 of the present embodiment includes: a processor 501 and a memory 502; wherein:
a memory 502 for storing computer-executable instructions;
the processor 501 is configured to execute computer-executable instructions stored in a memory to implement the steps of the automatic test anomaly locating method described in the above embodiment, which is not described herein.
Alternatively, the memory 502 may be separate or integrated with the processor 501.
When the memory 502 is provided separately, the device further comprises a bus 503 for connecting the memory 502 and the processor 501.
Further, based on the description in the foregoing embodiment, a computer readable storage medium is further provided in the embodiment of the present application, where computer execution instructions are stored in the computer readable storage medium, and when the processor executes the computer execution instructions, the steps of the automatic test anomaly positioning method described in the foregoing embodiment are implemented, and this embodiment is not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple modules 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 an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present application may be integrated in one processing unit, or each module may exist alone physically, or two or more modules may be integrated in one unit. The integrated units of the modules can be realized in a form of hardware or a form of hardware and software functional units.
The integrated modules, which are implemented in the form of software functional modules, may be stored in a computer readable storage medium. The software functional module is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform some of the steps of the methods according to the embodiments of the application.
It should be understood that the above Processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, a digital signal Processor (english: DIGITAL SIGNAL Processor, abbreviated as DSP), an Application-specific integrated Circuit (english: application SPECIFIC INTEGRATED Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile memory NVM, such as at least one magnetic disk memory, and may also be a U-disk, a removable hard disk, a read-only memory, a magnetic disk or optical disk, etc.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (PERIPHERAL COMPONENT, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or to one type of bus.
The storage medium may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an Application SPECIFIC INTEGRATED Circuits (ASIC). It is also possible that the processor and the storage medium reside as discrete components in an electronic device or a master device.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.

Claims (8)

1. An automated test anomaly localization method, the method comprising:
Determining a target interface of an automatic test case for reporting errors in the operation process according to error reporting information generated in the operation process of the automatic test case;
Determining the system name of the system to which the target interface belongs according to the domain name of the target interface;
Based on a preset link monitoring program, sending a first test parameter to the target interface in a GET mode, wherein the first test parameter comprises a time interval in which a searched interface request is located, the number of the searched interface requests and the system name of a system to which the target interface belongs;
Determining all interface requests occurring in a system to which the target interface belongs in the time interval according to result data corresponding to the first test parameters returned by the target interface; the result data corresponding to the first test parameter comprises a first list and a second list, wherein the first list comprises meta information of all interface requests which occur in a system to which the target interface belongs in the time interval, and the second list comprises direction information of all interface requests which occur in the system to which the target interface belongs in the time interval;
Determining a target interface request with errors in all interface requests occurring in a system to which the target interface belongs in the time interval according to the first list, and acquiring meta information corresponding to the target interface request;
acquiring direction information corresponding to the target interface request in the second list;
Generating a second test parameter according to the meta information and the direction information corresponding to the target interface request;
sending the second test parameters to the target interface in a POST mode, and determining a target system with abnormality in a system call link corresponding to the target interface according to result data corresponding to the second test parameters returned by the target interface;
each interface request in the automatic test case is written by adopting a try-catch code block; the determining the error reporting target interface of the automatic test case in the operation process according to the error reporting information generated by the automatic test case in the operation process comprises the following steps:
Acquiring error reporting information generated by the try-catch code block in the running process of the automatic test case;
And determining a target interface with an abnormality in the operation process of the automatic test case according to the error reporting information.
2. The method according to claim 1, wherein determining the system name of the system to which the target interface belongs according to the domain name of the target interface comprises:
and determining the system name of the system to which the target interface belongs according to the domain name of the target interface and a pre-established corresponding relation table between the domain name of each interface and the system name of the system to which each interface belongs.
3. The method of claim 1, wherein the determining, according to the result data corresponding to the second test parameter returned by the target interface, a target system in which an exception exists in a system call link corresponding to the target interface includes:
generating a parameter entering character string according to the value of a preset field in the result data corresponding to the second test parameter; wherein, the preset field includes traceId, collectorAcceptTime and an elased field;
and determining a target system with abnormality in a system call link corresponding to the target interface according to the parameter entering character string.
4. The method of claim 3, wherein the determining, according to the parameter string, a target system in which an exception exists in a system call link corresponding to the target interface, includes:
Sending a query request to the target interface, wherein the query request comprises the parameter entering character string;
And determining a target system with abnormality in a system call link corresponding to the target interface according to the response message returned by the target interface.
5. A method according to claim 3, further comprising:
And writing the system name of the system to which the target interface belongs and the entry character string into a test report.
6. An automated test anomaly locating device, the device comprising:
the detection module is used for determining a target interface of the automatic test case for reporting errors in the operation process according to error reporting information generated in the operation process of the automatic test case;
the searching module is used for determining the system name of the system to which the target interface belongs according to the domain name of the target interface;
The processing module is used for sending a first test parameter to the target interface in a GET mode based on a preset link monitoring program, wherein the first test parameter comprises a time interval in which a searched interface request is located, the number of the searched interface requests and the system name of a system to which the target interface belongs;
Determining all interface requests occurring in a system to which the target interface belongs in the time interval according to result data corresponding to the first test parameters returned by the target interface; the result data corresponding to the first test parameter comprises a first list and a second list, wherein the first list comprises meta information of all interface requests which occur in a system to which the target interface belongs in the time interval, and the second list comprises direction information of all interface requests which occur in the system to which the target interface belongs in the time interval;
Determining a target interface request with errors in all interface requests occurring in a system to which the target interface belongs in the time interval according to the first list, and acquiring meta information corresponding to the target interface request;
acquiring direction information corresponding to the target interface request in the second list;
Generating a second test parameter according to the meta information and the direction information corresponding to the target interface request;
sending the second test parameters to the target interface in a POST mode, and determining a target system with abnormality in a system call link corresponding to the target interface according to result data corresponding to the second test parameters returned by the target interface;
Each interface request in the automatic test case is written by adopting a try-catch code block; the detection module is specifically configured to obtain error reporting information generated by the try-catch code block during the running process of the automated test case;
And determining a target interface with an abnormality in the operation process of the automatic test case according to the error reporting information.
7. An electronic device, comprising: at least one processor and memory;
The memory stores computer-executable instructions;
The at least one processor executing computer-executable instructions stored in the memory causes the at least one processor to perform the automated test anomaly localization method of any one of claims 1 to 5.
8. A computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement the automated test anomaly localization method of any one of claims 1 to 5.
CN202111548859.2A 2021-12-17 2021-12-17 Automatic test abnormality positioning method, device, equipment and readable storage medium Active CN114253846B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111548859.2A CN114253846B (en) 2021-12-17 2021-12-17 Automatic test abnormality positioning method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111548859.2A CN114253846B (en) 2021-12-17 2021-12-17 Automatic test abnormality positioning method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN114253846A CN114253846A (en) 2022-03-29
CN114253846B true CN114253846B (en) 2024-05-28

Family

ID=80795443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111548859.2A Active CN114253846B (en) 2021-12-17 2021-12-17 Automatic test abnormality positioning method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114253846B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111679968A (en) * 2020-04-28 2020-09-18 平安普惠企业管理有限公司 Interface calling abnormity detection method and device, computer equipment and storage medium
CN112463561A (en) * 2020-11-20 2021-03-09 中国建设银行股份有限公司 Fault positioning method, device, equipment and storage medium
CN112506799A (en) * 2020-12-22 2021-03-16 北京百度网讯科技有限公司 Business abnormity positioning method and device, electronic equipment, medium and product
CN112667501A (en) * 2020-12-23 2021-04-16 平安普惠企业管理有限公司 Link testing method and device based on automatic baffle and related equipment
CN113067747A (en) * 2021-03-15 2021-07-02 中国工商银行股份有限公司 Link abnormity tracing method, cluster, node and system
CN113688025A (en) * 2021-09-07 2021-11-23 中国联合网络通信集团有限公司 Interface test method, device, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10747658B2 (en) * 2018-11-19 2020-08-18 Paypal, Inc. Systems and methods for testing online use-case scenarios in a staging environment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111679968A (en) * 2020-04-28 2020-09-18 平安普惠企业管理有限公司 Interface calling abnormity detection method and device, computer equipment and storage medium
CN112463561A (en) * 2020-11-20 2021-03-09 中国建设银行股份有限公司 Fault positioning method, device, equipment and storage medium
CN112506799A (en) * 2020-12-22 2021-03-16 北京百度网讯科技有限公司 Business abnormity positioning method and device, electronic equipment, medium and product
CN112667501A (en) * 2020-12-23 2021-04-16 平安普惠企业管理有限公司 Link testing method and device based on automatic baffle and related equipment
CN113067747A (en) * 2021-03-15 2021-07-02 中国工商银行股份有限公司 Link abnormity tracing method, cluster, node and system
CN113688025A (en) * 2021-09-07 2021-11-23 中国联合网络通信集团有限公司 Interface test method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Automated software testing for high-end touch screen automotive displays;Sushant Patil等;《2015 IEEE International Transportation Electrification Conference (ITEC)》;20160121;第1-4页 *
基于眼图测试的USB接口链路故障定位方法;吕梅梅;《工业控制计算机》;20170525(第05期);第44-45+47页 *

Also Published As

Publication number Publication date
CN114253846A (en) 2022-03-29

Similar Documents

Publication Publication Date Title
US7475387B2 (en) Problem determination using system run-time behavior analysis
JPH0432417B2 (en)
CN111108481B (en) Fault analysis method and related equipment
US8327189B1 (en) Diagnosing an incident on a computer system using a diagnostics analyzer database
US11429574B2 (en) Computer system diagnostic log chain
CN110990289B (en) Method and device for automatically submitting bug, electronic equipment and storage medium
CN108304276B (en) Log processing method and device and electronic equipment
JP5495310B2 (en) Information processing apparatus, failure analysis method, and failure analysis program
CN113392000A (en) Test case execution result analysis method, device, equipment and storage medium
CN112235128B (en) Transaction path analysis method, device, server and storage medium
CN114528201A (en) Abnormal code positioning method, device, equipment and medium
CN114253846B (en) Automatic test abnormality positioning method, device, equipment and readable storage medium
CN114500249B (en) Root cause positioning method and device
US9354962B1 (en) Memory dump file collection and analysis using analysis server and cloud knowledge base
US20150331772A1 (en) Methods for updating diagnostic tools on a hardware device and devices thereof
CN105159810A (en) Method and device for testing BIOS of computer system
CN113282496B (en) Automatic interface testing method, device, equipment and storage medium
CN113392006A (en) Method and equipment for monitoring automatic test logs by using capsules
CN115640236B (en) Script quality detection method and computing device
CN112069749B (en) Power supply connection verification method and device, electronic equipment and storage medium
CN117609024A (en) Method and device for automatically positioning abnormal part, electronic equipment and storage medium
CN117076324A (en) Method, system, equipment and medium for repairing codes based on log
CN115686962A (en) Server link detection method and device and electronic equipment
CN116893928A (en) Supervision method, system, terminal and storage medium for fault memory
CN116361058A (en) Transaction fault positioning method and device based on reverse troubleshooting and computer equipment

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
GR01 Patent grant
GR01 Patent grant