Service link testing method, device, equipment, medium and program product

By setting up a tracking plug-in in the business link to collect input and output information and form a complete call link log, the problem of difficulty in quickly locating abnormal call links in the existing technology is solved, and efficient and accurate business link testing is achieved.

CN118193384BActive Publication Date: 2025-09-12INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410338357.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-22
Publication Date
2025-09-12
Estimated Expiration
2044-03-22

AI Technical Summary

Technical Problem

In business link testing in long-process scenarios, existing technologies make it difficult to quickly and accurately locate abnormal call links, and manual comparison relies on personal ability and is prone to errors.

Method used

By setting up tracking plug-ins on both sides of the connection point in the business chain, input and output information is collected, and a complete call chain log is formed according to the chain identifier and time sequence. The log differences before and after the change are compared to quickly locate the abnormal points.

Benefits of technology

It achieves fast and automated service link testing, improves test efficiency and accuracy, and reduces human errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118193384B_ABST
    Figure CN118193384B_ABST
Patent Text Reader

Abstract

The present disclosure provides a business link testing method, which relates to the fields of software testing and information security technology. The method includes: obtaining a first call link log generated by a first system under test executing a target test case, the first call link log including N groups of first input and output information corresponding one-to-one to N connection points; obtaining a second call link log generated by a second system under test executing a target test case, the second call link log including N groups of second input and output information corresponding one-to-one to N connection points; the second system under test is a system obtained after modifying the first system under test; comparing the first call link log and the second call link log, and when there is a difference in the information in the first call link log and the second call link log, outputting the information of the connection point with the difference and the corresponding first input and output information and second input and output information. The present disclosure also provides a business link testing device, equipment, storage medium and program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of software testing and information security technology, and can be used in the financial field or other fields. More specifically, it relates to a business link testing method, device, equipment, medium and program product. Background Art

[0002] Currently, in business link testing scenarios involving long processes, whether through automated script execution or traffic playback, after obtaining the operating results of the system under test, the final comparison relies on manually writing the final assertions one by one in the script. This makes it difficult to achieve a comprehensive and quick comparison, and the comparison results are highly dependent on individual ability. When the script assertions are flawed, it is difficult to determine which call link has the problem. Summary of the Invention

[0003] In view of the above problems, the present disclosure provides a service link testing method, apparatus, device, medium and program product that can quickly locate abnormal call links.

[0004] The first aspect of the embodiment of the present disclosure provides a business link testing method. The method includes: first, obtaining a first call link log, the first call link log is generated by the first tested system executing the target test case; the first call link log includes N groups of first input and output information corresponding to N connection points; wherein the connection point is a connection path between the caller and the callee with an input and output relationship in the business link of the first tested system, and N is an integer greater than 1; then obtaining a second call link log, the second call link log is generated by the second tested system executing the target test case; the second call link log includes N groups of second input and output information corresponding to the N connection points; the second tested system is a system obtained after modifying the first tested system, wherein the N connection points remain consistent in the first tested system and the second tested system; then comparing the first call link log and the second call link log, including: comparing the first input and output information and the second input and output information corresponding to the same connection point; finally, when there is a difference in information between the first call link log and the second call link log, outputting the information of the connection point with the difference and the corresponding first input and output information and the second input and output information.

[0005] According to an embodiment of the present disclosure, the N connection points include a first connection point, the called party connected to the first connection point is a database, and the input and output information corresponding to the first connection point includes: an SQL statement executed by the database.

[0006] According to an embodiment of the present disclosure, the N connection points include at least one type of connection path: http call, RPC remote procedure call, and inter-thread call.

[0007] According to an embodiment of the present disclosure, the information of the different connection points includes: information of the different connection points and the callers and callees connected thereto.

[0008] According to an embodiment of the present disclosure, obtaining the first call link log includes: querying the first link identifier corresponding to the target test case and the first system under test; searching for all first log information with the first link identifier as the link identifier, the first log information including time information; each of the first log information is collected by a tracing plug-in, wherein a tracing plug-in is provided at each connection end between the connection point and the caller and the callee; aggregating the first log information collected by the tracing plug-ins on both sides of each connection point to obtain a first set of log information to be processed corresponding to each connection point; and based on the time information in the first log information, sorting the first log information in the first set of log information to be processed in chronological order to obtain the first input and output information corresponding to the connection point.

[0009] According to an embodiment of the present disclosure, before searching for all first log information with the first link identifier as the link identifier, the method further includes: collecting, through a burying point plug-in, data transmitted through the connection end where the burying point plug-in is located; obtaining, through the burying point plug-in, the link identifier of the transmission link where the collected data is located; and recording log information through the burying point plug-in based on the collected data, the collection time and the obtained link identifier.

[0010] According to an embodiment of the present disclosure, the link identifier of the transmission link where the collected data is located is obtained through the tracking plug-in, including obtaining the link identifier in different ways for different communication call types, specifically including at least one of the following: for data transmitted in http communication mode, the link identifier is obtained from the request header of the http message; for data transmitted in RPC remote procedure call mode, the link identifier is obtained from the additional parameters in the RPC message; for data transmitted in inter-thread call mode, the link identifier is obtained from the thread local variable.

[0011] According to an embodiment of the present disclosure, the tracking plug-in includes a database tracking plug-in; collecting data transmitted through the connection end where the tracking plug-in is located includes: when a database thread receives a confirmation instruction to execute a database operation, the database tracking plug-in obtains the SQL statement in the confirmation instruction. Obtaining the link identifier of the transmission link where the collected data is located by the tracking plug-in includes: obtaining the link identifier from a thread-local variable of the database thread.

[0012] According to an embodiment of the present disclosure, obtaining the second call link log includes: querying the second link identifier corresponding to the target test case and the second system under test; searching for all second log information with the second link identifier as the link identifier, the second log information including time information; each second log information is collected by a tracing plug-in, wherein a tracing plug-in is provided at each connection end between the connection point and the caller and the callee; aggregating the second log information collected by the tracing plug-ins on both sides of each connection point to obtain a second set of log information to be processed corresponding to the connection point; and based on the time information in the second log information, sorting the second log information in the second set of log information to be processed in chronological order to obtain the second input and output information corresponding to the connection point.

[0013] The second aspect of the embodiment of the present disclosure provides a business link testing device. The device includes: a first acquisition module, a second acquisition module, a comparison module and an output module. The first acquisition module is used to obtain a first call link log, which is generated by the first system under test executing the target test case; the first call link log includes N groups of first input and output information corresponding to N connection points; wherein the connection point is a connection path between the caller and the callee with an input and output relationship in the business link of the first system under test, and N is an integer greater than 1. The second acquisition module is used to obtain a second call link log, which is generated by the second system under test executing the target test case; the second call link log includes N groups of second input and output information corresponding to N connection points; the second system under test is a system obtained after modifying the first system under test, wherein the N connection points remain consistent in the first system under test and the second system under test. The comparison module is used to compare the first call link log and the second call link log, including: comparing the first input and output information and the second input and output information corresponding to the same connection point. The output module is used to output the information of the connection point with the difference and the corresponding first input-output information and second input-output information when there is a difference between the information in the first call link log and the second call link log.

[0014] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above method.

[0015] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, on which executable instructions are stored. When the instructions are executed by a processor, the processor executes the above method.

[0016] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, including a computer program, which implements the above method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0018] Figure 1 The diagram schematically shows a call relationship diagram in a service link of a system under test;

[0019] Figure 2 The following schematically shows a flow chart of a service link testing method according to an embodiment of the present disclosure;

[0020] Figure 3 Schematically illustrates a flow chart for obtaining a first link log in an embodiment of the present disclosure;

[0021] Figure 4 Schematically shows a flow chart for obtaining a second link log in an embodiment of the present disclosure;

[0022] Figure 5 The following schematically illustrates a flow chart for recording log information in a service link through a tracking plug-in in one embodiment of the present disclosure;

[0023] Figure 6 The following schematically shows a flow chart of a service link testing method according to another embodiment of the present disclosure;

[0024] Figure 7 The following schematically illustrates a process for analyzing logs recorded by a tracking plug-in in another embodiment of the present disclosure.

[0025] Figure 8 A flowchart schematically illustrates a service link testing method according to another embodiment of the present disclosure;

[0026] Figure 9 A schematic diagram of a structure of a service link testing device according to an embodiment of the present disclosure is shown; and

[0027] Figure 10 A block diagram of an electronic device suitable for implementing the service link testing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0028] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0029] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0030] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0031] The embodiments of the present disclosure provide a business link testing method, apparatus, equipment, medium and program product. In the embodiments of the present disclosure, starting from the call relationship in the business link, multiple connection points can be distinguished from the system under test according to http calls, RPC calls, database operations and / or key inter-thread calls, and the input and output information of the caller and the callee can be collected on both sides of each connection point through the buried point technology. In this way, when a test case is executed, the input and output information on both sides of all connection points in the business link after the test case is executed are recorded, and can be strung together according to the link identifier and time, so as to obtain a complete call link log of the business scenario. Accordingly, before and after the system under test is modified, the call link log generated by executing the same test case can be compared, and the correctness of the input and output information corresponding to each connection point in the business link can be judged by the comparison. And if an error or anomaly occurs, it can be quickly determined which connection point (or call relationship) has the anomaly.

[0032] It should be noted that in this article, "connection point" is used to indicate the connection path between the caller and the callee with an input-output relationship in the business link, which is essentially a calling relationship.

[0033] Figure 1 The diagram schematically shows a call relationship diagram in a service link 100 .

[0034] like Figure 1 As shown, the business chain 100 includes multiple types of calling relationships, specifically: mutual calls between systems (such as system A calling system B), mutual calls between services (such as service a in system B calling service b), mutual calls between threads (such as thread c1 calling thread c2), and calling relationships between services and databases (such as service d calling database e).

[0035] The various types of call relationships described above in business chain 100 may also correspond to different types of connection points, such as 101-104. For example, connection point 101 may be an HTTP call or an RPC remote procedure call. Connection point 102 may be an RPC remote procedure call. Connection point 103 may be an inter-thread call. Connection point 104 is the communication path between the service and the database, and in some embodiments, may also be an inter-thread call.

[0036] In one embodiment of the present disclosure, a tracking plug-in can be set on both sides of each connection point (i.e., the exit of the caller and the entrance of the callee), and the input and output information of the connection point can be collected in real time through the tracking plug-in, which is used as the basic data source for business link testing.

[0037] I understand. Figure 1 The business link 100 shown is only an example. The call relationship and its type that need to be analyzed in one business link can be determined according to the analysis needs (especially inter-thread calls). Among them, for the call relationship that needs to be analyzed, a tracking plug-in can be set at the connection point corresponding to the call relationship.

[0038] It should be noted that the service links tested and analyzed in the embodiments of the present disclosure, like service link 100, are end-to-end links capable of providing complete service delivery, including multiple call relationships and correspondingly multiple connection points. The embodiments of the present disclosure can quickly identify abnormal call relationships or connection points through service link testing, thereby helping to quickly identify the abnormal link in the service link.

[0039] The following will be based on Figure 1 Described by Figures 2 to 6 The service link testing method of the embodiment of the present disclosure is described in detail.

[0040] Figure 2 The flowchart of the service link testing method according to the embodiment of the present disclosure is schematically shown.

[0041] like Figure 2 As shown, the service link testing method according to this embodiment may include operations S210 to S240.

[0042] First, in operation S210, a first call link log is obtained. The first call link log is generated when the first system under test executes a target test case.

[0043] The first call link log includes N sets of first input and output information corresponding to N connection points, where a connection point is a connection path between a caller and a callee having an input and output relationship in a service link of the first system under test, and N is an integer greater than 1.

[0044] The target test case can come from a custom script written by the tester, or from recorded traffic data for playback.

[0045] In operation S220, a second call link log is obtained. The second call link log is generated by the second system under test executing the target test case. The second call link log includes N sets of second input and output information corresponding one-to-one to N connection points. The second system under test is a modified version of the first system under test, wherein the N connection points remain consistent between the first system under test and the second system under test.

[0046] In one embodiment, the N connection points include a first connection point (such as connection point 104). The called party connected to the first connection point is a database, and the input and output information corresponding to the first connection point includes database operation information, specifically SQL statements executed by the database.

[0047] In operation S230 , comparing the first call link log and the second call link log includes comparing first input-output information and second input-output information corresponding to the same connection point.

[0048] In operation S240, when there is a difference between the information in the first call link log and the second call link log, the information of the connection point with the difference and the corresponding first input-output information and second input-output information are output. In one embodiment, the information of the connection point with the difference may be the name or identification information of the connection point. In another embodiment, the information of the connection point with the difference may be more detailed, for example, it may include information about the connection point with the difference and the caller and callee to which it is connected, to help testers locate the location of the difference in the link more quickly.

[0049] In the business link testing method of the embodiment of the present disclosure, the call link log is a complete link log from one end to the other end of the business link of the system under test, wherein there are multiple connection points in the entire business link of the system under test. Moreover, when comparing the first call link log and the second call link log, the comparison is made from the dimension of the connection point to compare the corresponding input and output information. In this way, when there is a difference, it can be traced back to which connection point (or in which call relationship) the abnormality occurred, or it can be quickly located from which connection point (call relationship) the original difference starts.

[0050] Figure 3 The flowchart of operation S210 of obtaining the first link log in one embodiment of the present disclosure is schematically shown.

[0051] like Figure 3 As shown, according to this embodiment, operation S210 may include operations S301 to S304.

[0052] In operation S301 , a first link identifier corresponding to a target test case and a first system under test is queried.

[0053] In operation S302, all first log information with the first link identifier as the link identifier is searched, and the first log information includes time information; each first log information is collected by a tracking plug-in, wherein a tracking plug-in is set at each connection point and the connection end of the caller and the callee.

[0054] In operation S303, the first log information collected by the tracking plug-ins on both sides of each connection point is aggregated to obtain a first set of log information to be processed corresponding to each connection point.

[0055] In operation S304 , based on the time information in the first log information, the first log information in the first set of log information to be processed is sorted in chronological order to obtain first input and output information corresponding to the connection point.

[0056] The disclosed embodiment records the original data collected by the tracking plug-in, wherein the link identifier and time information are recorded together. When performing business link testing, the link identifier is used to search and organize the input and output information corresponding to the connection point for subsequent comparison and analysis. This decouples the information collection process and the business testing process, improves the efficiency of the test, and also improves the comprehensiveness of the collected original data.

[0057] Figure 4 The flowchart of operation S220 of obtaining the second link log in one embodiment of the present disclosure is schematically shown.

[0058] like Figure 4As shown, according to this embodiment, operation S220 may include operations S401 to S404.

[0059] In operation S401 , a second link identifier corresponding to a target test case and a second system under test is queried.

[0060] In operation S402, all second log information with the second link identifier as the link identifier is searched, and the second log information includes time information; each second log information is collected by a tracking plug-in, wherein a tracking plug-in is set at each connection point and the connection end with the caller and the callee.

[0061] In operation S403, the second log information collected by the tracking plug-ins on both sides of each connection point is aggregated to obtain a second set of log information to be processed corresponding to the connection point.

[0062] In operation S404 , based on the time information in the second log information, the second log information in the second set of log information to be processed is sorted in chronological order to obtain second input and output information corresponding to the connection point.

[0063] The process for obtaining the second call link log is similar to that for the first call link. By decoupling the information collection process from the service testing process, the acquisition of the first call link log and the second call link log is independent of the service system modification process. This also decouples the testing process of the service link of the system under test from the modification process of the system under test.

[0064] Figure 5 The flowchart of recording log information in a business link through a tracking plug-in in one embodiment of the present disclosure is schematically shown.

[0065] like Figure 5 As shown, according to an embodiment of the present disclosure, before operations S210 to S240, log information in the business link can be recorded and stored through a tracking plug-in. The specific process includes operations S501 to S503.

[0066] In operation S501, the data transmitted through the connection end where the burying point plug-in is located is collected through the burying point plug-in.

[0067] In operation S502, the link identifier of the transmission link where the collected data is located is obtained through the tracking plug-in.

[0068] In operation S503, the tracking plug-in records log information based on the collected data, collection time, and acquired link identifier.

[0069] Specifically, the link identifier of the transmission link where the collected data is located can be obtained by using the tracking plug-in in different ways for different communication call types. For example, for data transmitted in http communication mode, the link identifier can be obtained from the request header of the http message. For another example, for data transmitted in RPC remote procedure call mode, the link identifier is obtained from the extra parameters RPC Extraparams in the RPC message. For another example, for data transmitted in inter-thread call mode, the link identifier is obtained from the thread local variable ThreadLocal.

[0070] In addition, for the tracking plug-in whose callee is a database (referred to as "database tracking"), when the database thread receives a commit confirmation instruction to execute a database operation, the database tracking plug-in obtains the SQL statement in the confirmation instruction, and at the same time, obtains the link identifier from the thread local variable ThreadLocal of the database thread.

[0071] Figure 6 The flowchart of the service link testing method according to another embodiment of the present disclosure is schematically shown.

[0072] like Figure 6 As shown, the service link testing method according to this embodiment may include operations S601 to S603.

[0073] In operation S601, a tracking plug-in is set according to the system call relationship.

[0074] Tracking points on both sides of an HTTP or RPC connection point can be divided into tracking plug-ins set on the caller and tracking plug-ins set on the callee.

[0075] The content completed by the tracking plug-in set on the caller may include but is not limited to: the caller obtains the trace ID from ThreadLocal. If it does not exist, a new trace ID is created and the trace ID information is placed in the Request and ThreadLocal. When making an http / RPC call, the trace ID information is placed in the protocol, such as httpheader / RPC Extraparams, etc.; at the same time, the relevant input and output information and its associated trace ID are registered in the database before and after the call, and marked as calling the http or RPC service log.

[0076] The tracking plug-in set up on the callee may complete the following tasks, including but not limited to: the callee checks whether the trace ID information exists in the httpheader / RPC Extraparams. If so, it extracts the information and stores it in the Request / ThreadLocal to concatenate the requests. If not, a new trace is created. Furthermore, after processing is complete, the relevant input and output information before and after the call and its associated trace ID are recorded in the database and marked as the http or RPC callee log.

[0077] When the callee connected to the connection point is a database, the database tracking point set at the database entrance completes the following tasks: obtaining the trace ID from ThreadLocal at commit time. If it does not exist, the process ends; if it does exist, the relevant SQL statement and its associated trace ID are registered in the database and marked as a database operation log.

[0078] In operation S602, the logs recorded by the tracking plug-in are analyzed. The main analysis content is to record the trace ID generated when the target test case is executed (for example, when an automated script is executed or traffic is replayed), put the trace ID into the call link, and register the correspondence between the target test case and the trace ID in the database. When the system under test is executed, the trace ID and related logs will also be registered in the database. By analyzing the log information in the database, the logs of the relevant call relationships on the entire link are obtained for analysis.

[0079] Figure 7 The following schematically illustrates the processing flow for analyzing the logs recorded by the tracking plug-in in another embodiment of the present disclosure.

[0080] like Figure 7 As shown, according to this embodiment, operation S602 may specifically include operations S701 to S704.

[0081] In operation S701, the trace ID in the automated script execution or traffic replay is obtained: when performing traffic replay or automated script execution, a trace ID is also generated and placed in the call link, and the correspondence between the test case and the trace ID is registered in the database; here, the trace ID of the automated script or traffic replay case is obtained one by one.

[0082] In operation S702, logs of related trace IDs are retrieved in chronological order: the entire call chain involves many call relationships and database registrations. All related log information is retrieved in chronological order using the trace ID as an index.

[0083] In operation S703, manually analyze the correctness of the log of the target test case: exclude the logs that failed due to abnormal factors such as the environment from the many complete link log information, select the correct log and associate it with the target test case, and at the same time eliminate the information that does not need to be compared, such as timestamps, serial numbers, etc.

[0084] In operation S704, the case and link log relationship is saved. Based on the above, the target test case and the call link log are saved in the case and link log reference relationship record table according to the call sequence, and the information that needs to be compared is also saved.

[0085] Then continue to refer to Figure 6 In operation S603, the target test case is executed and compared. Specifically, after the system under test is modified, the target case can be re-executed and compared.

[0086] Figure 8 The flowchart of the service link testing method according to another embodiment of the present disclosure is schematically shown.

[0087] like Figure 8 As shown, the service link testing method according to this embodiment may include operations S801 to S804.

[0088] In operation S801 , after the program of the system under test is changed, a target test case is executed, such as traffic playback or execution of an automated script.

[0089] In operation S802, the tracking information of the calling process is obtained. The tracking plug-ins set on both sides of each connection point in the system under test are used to collect information transmitted through each connection point. After the tracking plug-ins collect the information, they can also record the trace ID.

[0090] In operation S803, call link log comparison: obtain the tracking point information after the execution of the target test case, string it into the second test case in chronological order, and then obtain the first call link log that needs to be compared in the case and link log benchmark relationship record table according to the name of the target test case, and then compare the input and output information of each connection point (such as http call, RPC call) one by one. Database operations also need to be compared, and the inconsistencies are recorded.

[0091] In operation S804 , the comparison results are summarized: the inconsistencies between the link relationship log and the benchmark relationship record table after this execution are summarized based on the test case name dimension, and the summary is displayed for manual analysis to determine whether the program has defects.

[0092] According to the embodiment of the present disclosure, starting from the call relationship in the business link, multiple connection points can be distinguished from the system under test based on http calls, RPC calls, database operations and / or key thread calls, and the input and output information of the caller and the callee can be collected on both sides of each connection point through the buried point technology. Each input and output information can be accompanied by a business key element such as a link identifier trace ID, and the business key element must be able to uniquely represent the key information of a business. Then all input and output information are connected in series through the link identifier trace ID, so that a complete call link log of the business scenario can be formed. By saving the input and output information each time, when the business link test is performed later, the call link log generated for the same business is compared, and the correctness of the business link is judged by the comparison. And if an error or exception occurs, it can be quickly determined which connection point (or call relationship) has the exception.

[0093] Based on the service link testing methods of the above embodiments, the present disclosure also provides a service link testing device. Figure 9 The device is described in detail.

[0094] Figure 9 The structural block diagram of the service link testing device 900 according to an embodiment of the present disclosure is schematically shown.

[0095] like Figure 9 As shown, the service link testing device 900 according to this embodiment may include: a first acquisition module 910 , a second acquisition module 920 , a comparison module 930 and an output module 940 .

[0096] The first acquisition module 910 is used to acquire a first call link log. The first call link log is generated by the first system under test executing the target test case. The first call link log includes N sets of first input and output information corresponding to N connection points. A connection point is a connection path between a caller and a callee having an input and output relationship in the service link of the first system under test, where N is an integer greater than 1. In one embodiment, the first acquisition module 910 can perform operation S210 described above.

[0097] In some embodiments, the first acquisition module 910 is also used to: query the first link identifier corresponding to the target test case and the first system under test; search for all first log information with the first link identifier as the link identifier, the first log information including time information; each first log information is collected by a tracking plug-in, wherein a tracking plug-in is provided at each connection point and the connection end with the caller and the callee; aggregate the first log information collected by the tracking plug-ins on both sides of each connection point to obtain a first set of log information to be processed corresponding to each connection point; and based on the time information in the first log information, sort the first log information in the first set of log information to be processed in chronological order to obtain the first input and output information corresponding to the connection point.

[0098] The second acquisition module 920 is used to obtain a second call link log. The second call link log is generated by the second system under test executing the target test case. The second call link log includes N sets of second input and output information corresponding one-to-one to N connection points. The second system under test is a modified version of the first system under test, where the N connection points remain consistent between the first and second systems under test. In one embodiment, the second acquisition module 920 can perform operation S220 described above.

[0099] In some embodiments, the second acquisition module 920 is also used to: query the second link identifier corresponding to the target test case and the second system under test; search for all second log information with the second link identifier as the link identifier, the second log information including time information; each second log information is collected by a tracking plug-in, wherein a tracking plug-in is provided at each connection point with the caller and the callee; aggregate the second log information collected by the tracking plug-ins on both sides of each connection point to obtain a second set of log information to be processed corresponding to the connection point; and based on the time information in the second log information, sort the second log information in the second set of log information to be processed in chronological order to obtain the second input and output information corresponding to the connection point.

[0100] The comparison module 930 is used to compare the first call link log and the second call link log, including comparing the first input and output information and the second input and output information corresponding to the same connection point. In one embodiment, the comparison module 930 can perform the operation S230 described above.

[0101] The output module 940 is configured to output information of the different connection points and the corresponding first input-output information and second input-output information when there is a difference between the information in the first call link log and the second call link log. In one embodiment, the output module 940 may perform the operation S240 described above.

[0102] According to other embodiments of the present disclosure, the apparatus 900 may further include an information collection module. The information collection module is configured to: collect data transmitted through the connection end where the burying plug-in is located through the burying plug-in; obtain the link identifier of the transmission link where the collected data is located through the burying plug-in; and record log information based on the collected data, collection time, and obtained link identifier through the burying plug-in.

[0103] The apparatus 900 may perform a reference Figures 2 to 8 The service link test method described in this article can be found in the previous article for details and will not be repeated here.

[0104] According to an embodiment of the present disclosure, any multiple modules among the first acquisition module 910, the second acquisition module 920, the comparison module 930, the output module 940, and the information acquisition module can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first acquisition module 910, the second acquisition module 920, the comparison module 930, the output module 940, and the information acquisition module can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in an appropriate combination of any of them. Alternatively, at least one of the first acquisition module 910 , the second acquisition module 920 , the comparison module 930 , the output module 940 and the information collection module may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.

[0105] Figure 10 A block diagram of an electronic device suitable for implementing the service link testing method according to an embodiment of the present disclosure is schematically shown.

[0106] like Figure 10As shown, the electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. The processor 1001 may, for example, include a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include an onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0107] Various programs and data required for the operation of the electronic device 1000 are stored in the RAM 1003. The processor 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. The processor 1001 performs various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 1002 and / or the RAM 1003. It should be noted that the programs may also be stored in one or more memories other than the ROM 1002 and the RAM 1003. The processor 1001 may also perform various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.

[0108] According to an embodiment of the present disclosure, electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to bus 1004. Electronic device 1000 may further include one or more of the following components connected to I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 1008 including a hard disk; and a communication section 1009 including a network interface card such as a LAN card or a modem. Communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to I / O interface 1005 as needed. Removable media 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed in drive 1010 as needed, so that computer programs read therefrom can be installed into storage section 1008 as needed.

[0109] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.

[0110] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 1002 and / or RAM 1003 described above and / or one or more memories other than ROM 1002 and RAM 1003.

[0111] The embodiments of the present disclosure also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is executed in a computer system, the program code is used to enable the computer system to implement the service link testing method provided by the embodiments of the present disclosure.

[0112] The computer program executes the above functions defined in the system / device of the embodiment of the present disclosure when the processor 1001 executes the computer program. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0113] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 1009, and / or installed from the removable medium 1011. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0114] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above-described functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.

[0115] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).

[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0117] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of this disclosure may be combined and / or coupled in various ways, even if such combinations and / or couplings are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or coupled in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or couplings are intended to fall within the scope of this disclosure.

[0118] The embodiments of the present disclosure are described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be used in combination to advantage. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A service link testing method, wherein: The method comprises: Obtaining a first call link log, where the first call link log is generated by the first system under test executing a target test case; the first call link log includes N sets of first input and output information corresponding one-to-one to N connection points; wherein the connection points are connection paths between a caller and a callee having an input and output relationship in a service link of the first system under test, and N is an integer greater than 1; Obtaining a second call link log, where the second call link log is generated by the second system under test executing the target test case; the second call link log includes N sets of second input and output information corresponding one-to-one to the N connection points; the second system under test is a system obtained by modifying the first system under test, wherein the N connection points remain consistent in the first system under test and the second system under test; Comparing the first call link log and the second call link log includes: comparing the first input and output information and the second input and output information corresponding to the same connection point; When there is a difference between the information in the first call link log and the second call link log, the information of the connection point with the difference and the corresponding first input-output information and second input-output information are output.

2. The method according to claim 1, wherein The N connection points include a first connection point, the called party connected to the first connection point is a database, and the input and output information corresponding to the first connection point includes: an SQL statement executed by the database.

3. The method according to claim 1, wherein The N connection points include at least one of the following types of connection paths: http calls, RPC remote procedure calls, and inter-thread calls.

4. The method according to claim 1, wherein The information of the different connection points includes: information of the different connection points and the caller and callee connected thereto.

5. The method according to claim 1, wherein Obtaining the first call link log includes: Querying a first link identifier corresponding to the target test case and the first system under test; Searching for all first log information with the first link identifier as a link identifier, where the first log information includes time information; each first log information is collected by a tracking plug-in, wherein a tracking plug-in is provided at each connection point with the caller and the callee; Aggregating the first log information collected by the tracking plug-ins on both sides of each of the connection points to obtain a first set of log information to be processed corresponding to each of the connection points; and Based on the time information in the first log information, the first log information in the first set of log information to be processed is sorted in chronological order to obtain the first input and output information corresponding to the connection point.

6. The method according to claim 5, wherein: Before searching for all first log information with the first link identifier as a link identifier, the method further includes: Collecting data transmitted through the connection end where the embedding plug-in is located through the embedding plug-in; Obtaining the link identifier of the transmission link where the collected data is located through the tracking plug-in; and The tracking plug-in records log information based on the collected data, collection time and acquired link identifier.

7. The method according to claim 6, wherein: The acquiring of the link identifier of the transmission link where the collected data is located by the tracking plug-in includes acquiring the link identifier in different ways for different communication call types, specifically including at least one of the following: For data transmitted via HTTP, the link identifier is obtained from the request header of the HTTP message; For data transmitted via RPC remote procedure call, the link identifier is obtained from the additional parameters in the RPC message; For data transmitted through inter-thread calls, the link identifier is obtained from the thread local variable.

8. The method according to claim 6, wherein: The tracking plug-in includes database tracking; The collecting, by means of the tracking plug-in, data transmitted through the connection end where the tracking plug-in is located comprises: when a database thread receives a confirmation instruction for executing a database operation, the database tracking plug-in obtaining an SQL statement in the confirmation instruction; The obtaining of the link identifier of the transmission link where the collected data is located through the tracking plug-in includes: obtaining the link identifier from the thread local variable of the database thread.

9. The method according to claim 1, wherein Obtaining the second call link log includes: Querying a second link identifier corresponding to the target test case and the second system under test; Searching for all second log information with the second link identifier as a link identifier, where the second log information includes time information; each second log information is collected by a tracking plug-in, wherein a tracking plug-in is provided at each connection point with the caller and the callee; Aggregating the second log information collected by the tracking plug-ins on both sides of each of the connection points to obtain a second set of log information to be processed corresponding to the connection point; Based on the time information in the second log information, the second log information in the second set of log information to be processed is sorted in chronological order to obtain the second input and output information corresponding to the connection point.

10. A service link testing device, wherein: The device comprises: a first acquisition module configured to acquire a first call link log, the first call link log being generated by the first system under test executing a target test case; the first call link log comprising N sets of first input and output information corresponding one-to-one to N connection points; wherein the connection points are connection paths between a caller and a callee having an input-output relationship in a service link of the first system under test, and N is an integer greater than 1; a second acquisition module for acquiring a second call link log, the second call link log being generated by a second system under test executing the target test case; the second call link log comprising N sets of second input and output information corresponding one-to-one to the N connection points; the second system under test being a system obtained by modifying the first system under test, wherein the N connection points remain consistent in the first and second systems under test; a comparison module, configured to compare the first call link log and the second call link log, including: comparing the first input and output information and the second input and output information corresponding to the same connection point; The output module is used to output the information of the connection point with the difference and the corresponding first input-output information and second input-output information when there is a difference between the information in the first call link log and the second call link log.

11. An electronic device comprising: one or more processors; a storage device for storing one or more computer programs, The one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

13. A computer program product comprising a computer program, wherein When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Full-link test method and device, equipment and storage medium

    CN112286790A

  • Method for realizing troubleshooting of user-level business problems based on business logs

    CN117687982A