A method and device for locating problem code

By using clustering technology and iterative update rules in traffic playback, the information flooding problem in positioning problem code is solved, and the effect of significantly reducing positioning difficulty is achieved.

CN113760695BActive Publication Date: 2025-02-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010611266.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2025-02-21
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

The existing traffic playback scheme has the problem of information flooding when locating problem codes, making it difficult to effectively locate.

Method used

By obtaining the use case information of each test case that failed to compare in traffic playback, clustering based on the initial clustering rules, and iteratively update the clustering rules until the clustering rules are appropriate, and then clustering test cases with the same problem code are clustered. for a cluster.

Benefits of technology

It significantly reduces the difficulty of positioning problem codes and can mine a large number of problem codes that exist together between test cases that fail to compare, so that only by modifying the problem code corresponding to the test case can all test cases in the cluster pass successfully.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760695B_ABST
    Figure CN113760695B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for locating problem codes, and relates to the field of computer technology. A specific implementation of the method includes: obtaining the use case information of each test case that failed comparison in traffic playback; clustering each test case according to the use case information of each test case based on the initial clustering rules; updating the clustering rules in an iterative manner according to the results of each clustering; based on the updated clustering rules, clustering each test case to be located according to the use case information of each test case to be located that failed comparison, and locating the problem code according to the clustering results. This implementation can solve the technical problem of the difficulty in locating the problem code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for locating problem codes. Background Art

[0002] Traffic replay technology in automated testing is to import online traffic into the test system to simulate the real operating environment in order to troubleshoot performance problems and risks of the test system.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] The existing traffic playback solution saves labor costs to a certain extent and shortens the regression cycle. However, due to the excessive number of test cases that fail to be compared, there is a problem of information flooding, which makes it difficult to locate the problem code by comparing the failed test cases. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for locating a problem code to solve the technical problem that it is difficult to locate the problem code.

[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for locating a problem code is provided, comprising:

[0007] Obtain the test case information of each test case that failed the comparison in the traffic playback;

[0008] Based on the initial clustering rules, clustering each of the test cases according to the test case information of each of the test cases; updating the clustering rules in an iterative manner according to the result of each clustering;

[0009] Based on the updated clustering rules, each of the test cases to be located that failed the comparison is clustered according to the test case information of each test case to be located, and the problem code is located according to the clustering result.

[0010] Optionally, the use case information of each test case includes a failed node, a successful node before the failed node, field names of original input parameters and their corresponding values, and replayed parameters and their corresponding values.

[0011] Optionally, the clustering rule includes at least one of the following rule conditions:

[0012] The text similarity of the field names of the original input parameters and their corresponding values, the text similarity of the replayed parameters and their corresponding values, the node similarity of the failed nodes, the node similarity of the successful nodes, the interference fields and their corresponding values, the interference nodes, and the orderly passing through several identical successful nodes and the called methods.

[0013] Optionally, the clustering rule also includes weights corresponding to various rule conditions.

[0014] Optionally, clustering each of the test cases based on the initial clustering rule and according to the test case information of each of the test cases includes:

[0015] Based on the initial clustering rule, the similarity between the test case information of each test case is calculated, so as to cluster each test case according to the similarity;

[0016] The rule conditions of the initial clustering rule include the text similarity of the field name of the original input parameter and its corresponding value, the text similarity of the re-entered parameter and its corresponding value, the node similarity of the failed node and the node similarity of the successful node.

[0017] Optionally, in the process of updating the clustering rule in an iterative manner, the updated clustering rule further includes at least one of the following rule conditions:

[0018] Interference fields and their corresponding values, interference nodes, sequentially passing through several identical success nodes and called methods.

[0019] Optionally, locate the problem code based on the clustering results, including:

[0020] Each test case to be located in the same cluster is marked with the same test case label, where the test case label is used to indicate the clustering rule corresponding to this clustering;

[0021] Locate the problematic code according to the test case labels of each test case to be located.

[0022] In addition, according to another aspect of an embodiment of the present invention, a device for locating a problem code is provided, comprising:

[0023] The acquisition module is used to obtain the test case information of each test case that fails the comparison in the traffic playback;

[0024] An iteration module, for clustering each of the test cases based on the initial clustering rules and according to the test case information of each of the test cases; and updating the clustering rules in an iterative manner according to the result of each clustering;

[0025] The positioning module is used to cluster each of the test cases to be located based on the updated clustering rules and the use case information of each test case to be located that failed the comparison, and locate the problem code according to the clustering result.

[0026] Optionally, the use case information of each test case includes a failed node, a successful node before the failed node, field names of original input parameters and their corresponding values, and replayed parameters and their corresponding values.

[0027] Optionally, the clustering rule includes at least one of the following rule conditions:

[0028] The text similarity of the field names of the original input parameters and their corresponding values, the text similarity of the replayed parameters and their corresponding values, the node similarity of the failed nodes, the node similarity of the successful nodes, the interference fields and their corresponding values, the interference nodes, and the orderly passing through several identical successful nodes and the called methods.

[0029] Optionally, the clustering rule also includes weights corresponding to various rule conditions.

[0030] Optionally, the iteration module is further used for:

[0031] Based on the initial clustering rule, the similarity between the test case information of each test case is calculated, so as to cluster each test case according to the similarity;

[0032] The rule conditions of the initial clustering rule include the text similarity of the field name of the original input parameter and its corresponding value, the text similarity of the re-entered parameter and its corresponding value, the node similarity of the failed node and the node similarity of the successful node.

[0033] Optionally, in the process of updating the clustering rule in an iterative manner, the updated clustering rule further includes at least one of the following rule conditions:

[0034] Interference fields and their corresponding values, interference nodes, sequentially passing through several identical success nodes and called methods.

[0035] Optionally, the positioning module is further used for:

[0036] Each test case to be located in the same cluster is marked with the same test case label, where the test case label is used to indicate the clustering rule corresponding to this clustering;

[0037] Locate the problematic code according to the test case labels of each test case to be located.

[0038] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, including:

[0039] one or more processors;

[0040] a storage device for storing one or more programs,

[0041] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of the above embodiments.

[0042] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in any one of the above embodiments is implemented.

[0043] An embodiment of the above invention has the following advantages or beneficial effects: because it adopts a technical means based on the initial clustering rules, clusters each test case according to the use case information of each test case, and then updates the clustering rules in an iterative manner according to the result of each clustering, so it overcomes the technical problem of the difficulty in locating the problem code in the prior art. The embodiment of the present invention updates the clustering rules in an iterative manner, and then clusters each test case according to the updated clustering rules, so that the test cases with the same problem code are clustered into a cluster, so that only the problem code corresponding to one test case needs to be modified, and all the test cases in the cluster can be successfully passed. Therefore, the embodiment of the present invention can dig out the common problem codes between a large number of test cases that failed to compare, thereby significantly reducing the difficulty of locating the problem code.

[0044] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0046] Figure 1 is a schematic diagram of the main process of the method for locating a problem code according to an embodiment of the present invention;

[0047] Figure 2 is a schematic diagram of a clustering result according to an embodiment of the present invention;

[0048] Figure 3 It is a schematic diagram of the main process of a method for locating a problem code according to a reference embodiment of the present invention;

[0049] Figure 4 is a schematic diagram of main modules of an apparatus for locating a problem code according to an embodiment of the present invention;

[0050] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0051] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0053] Figure 1 Schematic diagram of the main process of the method for locating problem codes according to an embodiment of the present invention. As an embodiment of the present invention, Figure 1 As shown, the method for locating the problem code may include:

[0054] Step 101, obtaining the test case information of each test case that fails comparison in the traffic playback.

[0055] First, randomly obtain the use case information of each test case that fails to be compared in the traffic playback. It should be pointed out that the use case information of each test case that fails to be compared is used to determine the clustering rules. Therefore, the more test cases there are, the more conducive it is to determine the appropriate clustering rules. Correspondingly, the number of iterations of the clustering rules will also increase, which will increase the difficulty of determining the clustering rules. The embodiment of the present invention does not limit the number of test cases that fail to be compared, and the operation and maintenance personnel can determine the number of test cases based on actual business needs or experience.

[0056] Optionally, the use case information of each test case includes a failed node, a successful node before the failed node, field names of original input parameters and their corresponding values, and replayed parameters and their corresponding values.

[0057] For example, the field names and their corresponding values ​​of the original input parameters can be:

[0058] {“skuId”:123,”price”:9.99,”userLevel”:“Gold User”}

[0059] The replay parameters and their corresponding values ​​can be:

[0060] {"skuId":123,"price":9.99,"userLevel":"Silver User"}.

[0061] For example, the field names and their corresponding values ​​of the original input parameters can be:

[0062] {“skuId”:123,”orderNeedMoney”:10.99,”freight”:1,”remark”:“Gold medals are packed separately”}

[0063] The replay parameters and their corresponding values ​​can be:

[0064] {“skuId”:123,”orderNeedMoney”:9.99,”freight”:0,”remark”:“Gold medals are packed separately”}

[0065] Step 102: clustering each of the test cases based on the initial clustering rules and according to the test case information of each of the test cases; and updating the clustering rules in an iterative manner according to the result of each clustering.

[0066] When faced with a large number of test cases that failed to be compared in traffic playback, many of them may have common problem codes. For example, among the 500,000 test cases that failed to be compared, the failure reason of one of the test cases may be analyzed, and after modifying the corresponding problem code, 50,000 of the test cases succeeded. Perhaps these 500,000 test cases that failed to be compared ultimately correspond to a total of 10 code modifications. If we can automatically find these 10 test cases from the 500,000 test cases that failed to be compared, it will reduce the difficulty of locating the problem code. To this end, it is necessary to gradually establish appropriate clustering rules in an iterative manner.

[0067] Optionally, the clustering rules include at least one of the following rule conditions: text similarity of the field names of the original input parameters and their corresponding values, text similarity of the replayed parameters and their corresponding values, node similarity of failed nodes, node similarity of successful nodes, interference fields and their corresponding values, interference nodes, orderly passing through several identical successful nodes and calling methods. The content of the clustering rules is related to the use case information of the test case. The operation and maintenance personnel can configure the initial clustering rules based on the use case information of the test case. For example, the initial clustering rules may include the text similarity of the field names of the original input parameters and their corresponding values ​​and the text similarity of the replayed parameters and their corresponding values, or the initial clustering rules may include the node similarity of failed nodes and the node similarity of successful nodes, or the initial clustering rules may include the text similarity of the field names of the original input parameters and their corresponding values, text similarity of the replayed parameters and their corresponding values, node similarity of failed nodes and the node similarity of successful nodes.

[0068] Then, according to the result of each clustering, the current clustering rules are updated. For example, the updated clustering rules can add interference fields and their corresponding values ​​when calculating text similarity, and / or add interference nodes when calculating node similarity, or add several identical successful nodes that pass in an orderly manner. Optionally, the clustering rules also include weights corresponding to various rule conditions. As the number of rule conditions in the clustering rules increases, it is necessary to calculate accurate similarity by setting weights to avoid important rule conditions being overwhelmed.

[0069] Optionally, based on the initial clustering rules, each of the test cases is clustered according to the use case information of each of the test cases, including: based on the initial clustering rules, calculating the similarity between the use case information of each of the test cases, thereby clustering each of the test cases according to the similarity; wherein the rule conditions of the initial clustering rules include the text similarity of the field names of the original input parameters and their corresponding values, the text similarity of the replayed parameters and their corresponding values, the node similarity of the failed nodes, and the node similarity of the successful nodes. Optionally, in the process of iteratively updating the clustering rules, the updated clustering rules also include at least one of the following rule conditions: interference fields and their corresponding values, interference nodes, orderly passing through a number of identical successful nodes, and calling methods. In this embodiment, the initial clustering rules include text similarity and node similarity, so the granularity of the rules is relatively coarse. After one clustering, the operation and maintenance personnel can update the clustering rules according to the clustering results, and find the interference fields, interference nodes, and orderly passing through several identical successful nodes and / or calling methods by observing the test cases in each cluster, and then update the clustering rules. Then, clustering is performed again and the clustering rules are updated according to the updated clustering rules until the clustering rules are in the right position to obtain the final clustering rules.

[0070] Step 103 , based on the updated clustering rules, cluster the test cases to be located according to the test case information of each test case to be located that failed the comparison, and locate the problem code according to the clustering result.

[0071] After the iteration of step 102, the final clustering rule can be obtained. Therefore, based on the final clustering rule, each test case to be located can be clustered according to the use case information of each test case to be located that failed the comparison. The clustering result is as follows: Figure 2 As shown. Figure 2 In the figure, dozens of test cases that failed the comparison were finally clustered into three clusters, indicating that only three problematic codes need to be modified.

[0072] Optionally, locating the problem code according to the clustering result includes: marking each test case to be located in the same cluster with the same use case label, wherein the use case label is used to indicate the clustering rule corresponding to this clustering; locating the problem code according to the use case label of each test case to be located. For each test case to be located in the same cluster, the same use case label is marked to facilitate viewing by operation and maintenance personnel, and the problem code can be quickly located according to the use case label of each test case to be located.

[0073] It should be noted that, as long as the clustering rules are appropriate enough, when a new test case that fails the comparison appears, step 103 can be directly executed. Otherwise, the clustering rules need to be updated again according to the clustering results. Moreover, the test cases to be located that fail the comparison in step 103 may include the test cases that failed the comparison obtained in step 101, or may not include the test cases that failed the comparison obtained in step 101.

[0074] According to the various embodiments described above, it can be seen that the embodiment of the present invention clusters each test case according to the use case information of each test case based on the initial clustering rules, and then updates the clustering rules in an iterative manner according to the results of each clustering, thereby solving the technical problem of the difficulty in locating the problem code in the prior art. The embodiment of the present invention updates the clustering rules in an iterative manner, and then clusters each test case according to the updated clustering rules, so that the test cases with the same problem code are clustered into a cluster, so that only the problem code corresponding to one test case needs to be modified, and all the test cases in the cluster can be successfully passed. Therefore, the embodiment of the present invention can dig out the common problem codes between a large number of test cases that failed the comparison, thereby significantly reducing the difficulty of locating the problem code.

[0075] Figure 3 is a schematic diagram of the main process of a method for locating a problem code according to a reference embodiment of the present invention. As another embodiment of the present invention, Figure 3 As shown, the method for locating the problem code may include:

[0076] Step 301, obtaining the test case information of each test case that fails comparison in the traffic playback.

[0077] In an embodiment of the present invention, the use case information of each test case includes a failed node, a successful node before the failed node, the field name of the original input parameter and its corresponding value, and the replayed parameter and its corresponding value. For example, the use case information is as follows:

[0078]

[0079]

[0080] Among them, U: general entry node; C: user information filling node; A: freight calculation node; N: order price calculation node; V: save order node.

[0081] Step 302: define an initial clustering rule, and cluster each of the test cases based on the initial clustering rule and according to the test case information of each of the test cases.

[0082] The initial clustering rules include: the text similarity of the field names of the original input parameters and their corresponding values, the text similarity of the re-entered parameters and their corresponding values, and the node similarity of the failed nodes and the successful nodes.

[0083] After the first round of clustering, the following five test cases are in one cluster:

[0084] Test case 1 (labels: comparison failed text contains gold medal, passes through node U, passes through node C, passes through node S)

[0085] Test case 2 (labels: comparison failed text contains gold medal, passes through node U, passes through node C, passes through node S)

[0086] Test case 3 (labels: comparison failed text contains gold medal, passes through node U, passes through node C, passes through node S)

[0087] Test case 4 (labels: comparison failed text contains gold medal, passes through node U, passes through node V, passes through node P)

[0088] Test case 5 (labels: comparison failed text contains gold medal, passes through node U, passes through node V, passes through node P)

[0089] The similarity of the above five test cases is obviously unreasonable, because: Test Case 1, Test Case 2, and Test Case 3 are all caused by the failure of the userLevel field comparison when calculating the promotion; and Test Case 4 and Test Case 5 are brought into the same cluster by the initial clustering rule because of the interference caused by the remark field (Test Case 4 and Test Case 5 also contain the "gold medal" text), and obviously do not want the interference caused by this text similarity. Therefore, it is necessary to update the clustering rules, shield some fields, exclude them from the calculation of text similarity, and then perform clustering again.

[0090] Step 303: update the clustering rules in an iterative manner according to the result of each clustering.

[0091] Update clustering rules (text similarity, node similarity, and text similarity with field restrictions)

[0092] After the second round of clustering

[0093] Test case 1 (label: userLevel comparison failed text contains gold medal, passed node U, passed node C, passed node S)

[0094] Test case 2 (labels: userLevel comparison failed text contains gold medal, passed node U, passed node C, passed node S)

[0095] Test case 3 (labels: userLevel comparison failed text contains gold medal, passed node U, passed node C, passed node S)

[0096] Test case 4 (label: remark comparison failed text contains gold medal, passes through node U, passes through node V, passes through node P)

[0097] Test case 5 (label: remark comparison failed text contains gold medal, passes through node U, passes through node V, passes through node P)

[0098] Similarly, for the similarity between the failed nodes and the successfully calculated nodes, it is found that all use cases pass through node U (universal entry node), which is also a kind of interference and needs to be corrected.

[0099] Update clustering rules (text similarity, node similarity, and text similarity with field restrictions, shielding node U)

[0100] After the third round of clustering

[0101] Test case 1 (label: userLevel comparison failed text contains gold medal, passes through node C, passes through node S)

[0102] Test case 2 (label: userLevel comparison failed text contains gold medal, passes through node C, passes through node S)

[0103] Test case 3 (label: userLevel comparison failed text contains gold medal, passes through node C, passes through node S)

[0104] Test case 4 (label: remark comparison failed text contains gold medal, passes through node V, passes through node P)

[0105] Test case 5 (label: remark comparison failed text contains gold medal, passes through node V, passes through node P)

[0106] We found that userLevel text comparison failures often appear together with node C. In this case, the two conditions can be combined to further update the clustering rules.

[0107] Update clustering rules (userLevel comparison failure text contains gold medals, both node C and node S appear)

[0108] After the fourth round of clustering

[0109] Failure case 1 (label: userLevel comparison failure text contains gold medal and passes through node C and node S)

[0110] Failure case 2 (label: userLevel comparison failure text contains gold medal and passes through node C and passes through node S)

[0111] Failure case 3 (label: userLevel comparison failure text contains gold medal and passes through node C and node S)

[0112] Failure case 4 (label: remark comparison failure text contains gold medal and passes through node V and passes through node P)

[0113] Failure case 5 (label: remark comparison failure text contains gold medal and passes through node V and node P)

[0114] After the above multiple clustering, we can finally get two clusters and their corresponding labels:

[0115] Tag 1: userLevel comparison failed text contains gold medal and passes through node C and node S

[0116] Label 2: remark comparison failed text contains gold medal and passes through node V and node P

[0117] Step 304: Obtain the use case information of each test case to be located that fails comparison in the traffic playback.

[0118] Step 305 , based on the updated clustering rules and according to the use case information of each of the test cases to be located, cluster the test cases to be located, and locate the problem code according to the clustering result.

[0119] Since the appropriate clustering rules have been determined, the test cases to be located can be clustered based on the updated clustering rules according to the case information of each test case to be located that failed comparison, so as to locate the problem code according to the clustering results.

[0120] In addition, the specific implementation content of the method for locating the problem code in a reference embodiment of the present invention has been described in detail in the method for locating the problem code described above, so the repeated content will not be described here.

[0121] Figure 4 is a schematic diagram of the main modules of the device for locating problem codes according to an embodiment of the present invention, such as Figure 4As shown, the device 400 for locating the problem code includes an acquisition module 401, an iteration module 402 and a positioning module 403; wherein the acquisition module 401 is used to obtain the use case information of each test case that failed comparison in the traffic playback; the iteration module 402 is used to cluster each test case based on the initial clustering rules and according to the use case information of each test case; according to the result of each clustering, the clustering rules are updated in an iterative manner; the positioning module 403 is used to cluster each test case to be located based on the updated clustering rules and according to the use case information of each test case to be located that failed comparison, and locate the problem code according to the clustering result.

[0122] Optionally, the use case information of each test case includes a failed node, a successful node before the failed node, field names of original input parameters and their corresponding values, and replayed parameters and their corresponding values.

[0123] Optionally, the clustering rule includes at least one of the following rule conditions:

[0124] The text similarity of the field names of the original input parameters and their corresponding values, the text similarity of the replayed parameters and their corresponding values, the node similarity of the failed nodes, the node similarity of the successful nodes, the interference fields and their corresponding values, the interference nodes, and the orderly passing through several identical successful nodes and the called methods.

[0125] Optionally, the clustering rule also includes weights corresponding to various rule conditions.

[0126] Optionally, the iteration module 402 is further configured to:

[0127] Based on the initial clustering rule, the similarity between the test case information of each test case is calculated, so as to cluster each test case according to the similarity;

[0128] The rule conditions of the initial clustering rule include the text similarity of the field name of the original input parameter and its corresponding value, the text similarity of the re-entered parameter and its corresponding value, the node similarity of the failed node and the node similarity of the successful node.

[0129] Optionally, in the process of updating the clustering rule in an iterative manner, the updated clustering rule further includes at least one of the following rule conditions:

[0130] Interference fields and their corresponding values, interference nodes, sequentially passing through several identical success nodes and called methods.

[0131] Optionally, the positioning module 403 is further used for:

[0132] Each test case to be located in the same cluster is marked with the same test case label, where the test case label is used to indicate the clustering rule corresponding to this clustering;

[0133] Locate the problematic code according to the test case labels of each test case to be located.

[0134] According to the various embodiments described above, it can be seen that the embodiment of the present invention clusters each test case according to the use case information of each test case based on the initial clustering rules, and then updates the clustering rules in an iterative manner according to the results of each clustering, thereby solving the technical problem of the difficulty in locating the problem code in the prior art. The embodiment of the present invention updates the clustering rules in an iterative manner, and then clusters each test case according to the updated clustering rules, so that the test cases with the same problem code are clustered into a cluster, so that only the problem code corresponding to one test case needs to be modified, and all the test cases in the cluster can be successfully passed. Therefore, the embodiment of the present invention can dig out the common problem codes between a large number of test cases that failed the comparison, thereby significantly reducing the difficulty of locating the problem code.

[0135] It should be noted that the specific implementation content of the device for locating the problem code described in the present invention has been described in detail in the method for locating the problem code described above, so the repeated content will not be described here.

[0136] Figure 5 An exemplary system architecture 500 is shown to which the method for locating a problem code or the apparatus for locating a problem code according to an embodiment of the present invention can be applied.

[0137] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0138] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0139] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0140] The server 505 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 501, 502, and 503. The backend management server may analyze and process the received data such as the item information query request, and feed back the processing results (such as target push information, item information - only an example) to the terminal device.

[0141] It should be noted that the method for locating the problem code provided in the embodiment of the present invention is generally executed by the server 505, and accordingly, the device for locating the problem code is generally set in the server 505. The method for locating the problem code provided in the embodiment of the present invention can also be executed by the terminal devices 501, 502, 503, and accordingly, the device for locating the problem code can be set in the terminal devices 501, 502, 503.

[0142] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0143] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0144] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0145] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0146] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.

[0147] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, 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, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0148] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order 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 flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0149] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes an acquisition module, an iteration module and a positioning module, wherein the names of these modules do not constitute a limitation on the modules themselves in some cases.

[0150] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device implements the following method: obtaining the use case information of each test case that failed comparison in the traffic playback; clustering each test case according to the use case information of each test case based on the initial clustering rules; updating the clustering rules in an iterative manner according to the results of each clustering; clustering each test case to be located according to the use case information of each test case to be located that failed comparison based on the updated clustering rules, and locating the problem code according to the clustering results.

[0151] According to the technical solution of the embodiment of the present invention, because it adopts a technical means based on the initial clustering rules, clusters each test case according to the use case information of each test case, and then updates the clustering rules in an iterative manner according to the result of each clustering, it overcomes the technical problem of the difficulty in locating the problem code in the prior art. The embodiment of the present invention updates the clustering rules in an iterative manner, and then clusters each test case according to the updated clustering rules, so that the test cases with the same problem code are clustered into a cluster, so that only the problem code corresponding to one test case needs to be modified, and all the test cases in the cluster can be successfully passed. Therefore, the embodiment of the present invention can dig out the common problem codes between a large number of test cases that failed to compare, thereby significantly reducing the difficulty of locating the problem code.

[0152] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for locating a problem code, characterized in that: include: Obtain the test case information of each test case that failed the comparison in the traffic playback; Based on the initial clustering rule, clustering each of the test cases according to the test case information of each of the test cases; According to the result of each clustering, the clustering rules are updated in an iterative manner; Based on the updated clustering rules, cluster the test cases to be located according to the use case information of each test case to be located that failed the comparison, and locate the problem code according to the clustering result; Based on the initial clustering rule, clustering each of the test cases according to the test case information of each of the test cases includes: Based on the initial clustering rule, the similarity between the test case information of each test case is calculated, so as to cluster each test case according to the similarity; The rule conditions of the initial clustering rule include the text similarity of the field name of the original input parameter and its corresponding value, the text similarity of the re-entered parameter and its corresponding value, the node similarity of the failed node and the node similarity of the successful node.

2. The method according to claim 1, characterized in that The use case information of each test case includes a failed node, a successful node before the failed node, the field name of the original input parameter and its corresponding value, and the replayed parameter and its corresponding value.

3. The method according to claim 2, characterized in that The clustering rule includes at least one of the following rule conditions: The text similarity of the field names of the original input parameters and their corresponding values, the text similarity of the replayed parameters and their corresponding values, the node similarity of the failed nodes, the node similarity of the successful nodes, the interference fields and their corresponding values, the interference nodes, and the orderly passing through several identical successful nodes and the called methods.

4. The method according to claim 3, characterized in that The clustering rules also include weights corresponding to various rule conditions.

5. The method according to claim 1, characterized in that In the process of updating the clustering rule in an iterative manner, the updated clustering rule further includes at least one of the following rule conditions: Interference fields and their corresponding values, interference nodes, sequentially passing through several identical success nodes and called methods.

6. The method according to claim 1, characterized in that Locate the problem code based on the clustering results, including: Each test case to be located in the same cluster is marked with the same test case label, where the test case label is used to indicate the clustering rule corresponding to this clustering; Locate the problematic code according to the test case labels of each test case to be located.

7. A device for locating a problem code, characterized in that: include: The acquisition module is used to obtain the test case information of each test case that fails the comparison in the traffic playback; An iteration module, used for clustering each of the test cases based on an initial clustering rule and according to the test case information of each of the test cases; According to the result of each clustering, the clustering rules are updated in an iterative manner; A positioning module is used to cluster each of the test cases to be located based on the updated clustering rules and the use case information of each test case to be located that failed the comparison, and locate the problem code according to the clustering result; The iteration module is also used to: Based on the initial clustering rule, the similarity between the test case information of each test case is calculated, so as to cluster each test case according to the similarity; The rule conditions of the initial clustering rule include the text similarity of the field name of the original input parameter and its corresponding value, the text similarity of the re-entered parameter and its corresponding value, the node similarity of the failed node and the node similarity of the successful node.

8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Software multi-fault positioning method and device, electronic equipment and storage medium

    CN110362484A