Failure root cause isolation method and device based on memory spectrum

Through a memory spectrum-based method, combined with memory information and twin convolutional neural network, high-precision isolation and visualization of program failure root causes is achieved, solving the problems of poor isolation effect and insufficient understanding in the existing technology.

CN119201760BActive Publication Date: 2025-03-18WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411737217.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-18
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

The prior art is difficult to deeply explore the internal state of the program when failure occurs, which makes it difficult for the failure root to achieve satisfactory results due to isolation technology and is difficult to be intuitively understood by humans, affecting the adoption of the results by human programmers.

Method used

Using a memory spectrum-based method, the breakpoints of the program to be tested are obtained through the test case set, and the running memory information of the program to be tested at all breakpoints is obtained using the failed test case set, the memory spectrum (PMS) is generated, and the training twin convolutional neural network is input to calculate the similarity and distance information between PMS pairs to achieve isolation of the root cause of failure.

Benefits of technology

It effectively improves the accuracy of the failure root cause isolation task, and makes the results easier for humans to understand through the visual form of memory spectrum, solving the problem of insufficient comprehensibility in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201760B_ABST
    Figure CN119201760B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and in particular to a method and device for isolating the root cause of failure based on a memory spectrum, wherein the method includes: obtaining the risk value of the executable statement based on the executable statement and the test case set of the program to be tested, and obtaining at least one breakpoint of the program to be tested based on the statement that meets certain risk conditions; obtaining the running memory information of the program to be tested at all breakpoints in combination with the program to be tested and the set of failed test cases; obtaining the PMS and at least one pair of PMS pairs corresponding to each failed test case based on the running memory information; inputting the PMS pairs into the trained twin convolutional neural network to obtain the similarity between all PMS pairs and calculate the distance information; and then determining the failure behavior similarities and differences information of the program to be tested, and isolating the failure root cause of the program to be tested based on the failure behavior similarities and differences information. Thus, the problems in the related technology that it is difficult to deeply explore the internal state of the program when the failure occurs and it is difficult for humans to intuitively understand are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for isolating root causes of failures based on memory spectrum. Background Art

[0002] With the increase in software volume and complexity, multi-defect environments have become the norm for software debugging tasks. A common strategy to alleviate the negative impact of multiple defects is to isolate the root causes of failures. The effectiveness of isolation of root causes of failures will directly affect the effectiveness of downstream debugging tasks. Failure root cause isolation is to divide the abnormal behaviors of software exposed in the test (usually failed test cases in a dynamic environment) according to their defect triggering root causes, so that those failed test cases triggered by the same defect are divided into the same cluster, and vice versa, those failed test cases triggered by different defects are divided into different clusters.

[0003] The failure root cause isolation technology mainly includes three parts: failure characterization, distance measurement and clustering algorithm. Among these three parts, the most important ones are failure characterization and distance measurement (these two are collectively called failure proximity), which play a decisive role in the effectiveness of failure root cause isolation technology. In the related art, a failure proximity method based on program coverage information can be used, which represents the failed test case f as a binary numerical vector of the same length as the number of executable statement lines of the program to be tested (wherein the i-th element is 1, indicating that the i-th program statement is covered by f, and 0, indicating that it is not covered), and the Euclidean distance is usually used for distance measurement; a failure proximity method based on risk value sorting can also be used, which combines the failed test case with the successful test case set to form a new test case set, and inputs this test case set into SBFL (Spectrum-based Fault Localization), calculates the statement-granularity risk value for the program to be tested, and sorts the statements according to the risk value, and uses this sorted list as a representation of the failed test case (wherein the i-th element represents the risk value ranking of the i-th statement), and the Kendall Tau distance or Euclidean distance is usually used for distance measurement.

[0004] Although the above two types of failure approximation have been widely used, the information sources they are based on are simple coverage information, which makes it difficult to deeply explore the internal state of the program when the failure occurs, hindering its accurate characterization, making it difficult for failure root cause isolation technology to achieve satisfactory results. In addition, these two technologies are difficult for humans to understand intuitively, resulting in low comprehensibility of the output of failure root cause isolation technology, which directly affects the possibility of human programmers adopting the results and urgently needs to be improved. Summary of the invention

[0005] The present application provides a method and device for isolating root causes of failures based on memory spectrum, so as to solve the problems in related technologies, such as it is difficult to deeply explore the internal state of a program when a failure occurs, which hinders accurate characterization thereof, making it difficult for the failure root cause isolation technology to achieve satisfactory results. In addition, it is difficult for humans to intuitively understand, resulting in low comprehensibility of the output of the failure root cause isolation technology, affecting the possibility of human programmers adopting the results, and the like.

[0006] The first aspect of the present application provides a method for isolating root causes of failures based on a memory spectrum, comprising the following steps: obtaining a risk value of the executable statement based on an executable statement of a program to be tested and a test case set, selecting an executable statement whose risk value satisfies a preset risk condition to obtain a risky execution statement of the program to be tested, and obtaining at least one breakpoint of the program to be tested based on the risky execution statement, wherein the test case set includes a failed test case set and a successful test case set; obtaining running memory information of the program to be tested at all breakpoints in combination with the program to be tested and the failed test case set; obtaining a PMS (Program Memory Management System) corresponding to each failed test case based on the running memory information. Spectrum, memory spectrum), and based on the PMS, obtain at least one PMS pair of the failed test case set; input the PMS pairs into the trained twin convolutional neural network respectively to obtain the similarity between all PMS pairs, and calculate the distance information between all PMS pairs based on the similarity and the target formula; determine the failure behavior similarities and differences information of the program under test according to the distance information and the failed test case set, and isolate the failure root cause of the program under test based on the failure behavior similarities and differences information.

[0007] Optionally, in one embodiment of the present application, obtaining the PMS corresponding to each failed test case based on the running memory information includes: constructing a failure test case matrix for each failed test case based on the variable name memory information, variable value memory information and stack frame number memory information of the running memory information; normalizing the failure test case matrix to obtain a normalized failure test case matrix, and obtaining the PMS corresponding to each failed test case based on the normalized failure test case matrix.

[0008] Optionally, in one embodiment of the present application, the running memory information may be, but is not limited to, represented as:

[0009] ,

[0010] in, yes During the execution The memory information queried at yes The actual number of breakpoints.

[0011] Optionally, in one embodiment of the present application, the PMS pairs are respectively input into the trained twin convolutional neural network to obtain the similarity between all PMS pairs, including: constructing the twin convolutional neural network, wherein the twin convolutional neural network includes at least two AlexNet or VGG-16 with the same structure and weights, and at least two fully connected layers, and the two fully connected layers contain a ReLU activation function; based on the set of failed test cases, a training set of the twin convolutional neural network is obtained; based on the training set, the twin convolutional neural network is trained to obtain a trained twin convolutional neural network, and the PMS pairs are input into the trained twin convolutional neural network to obtain the similarity between the PMS pairs, wherein when the similarity is 1, it is determined that the two failed test cases corresponding to the PMS pair have the same root cause of failure, and when the similarity is 0, it is determined that the two failed test cases corresponding to the PMS pair have different root causes of failure.

[0012] Optionally, in one embodiment of the present application, the calculation formula of the target formula may be, but is not limited to,:

[0013] ,

[0014] in, is the similarity of the two PMS images output by the twin neural network, It is the ratio of the larger side length to the smaller side length of the two PMS images.

[0015] The second aspect of the present application provides a failure root cause isolation device based on a memory spectrum, including: a first generation module, used to obtain a risk value of the executable statement based on an executable statement and a test case set of a program to be tested, select an executable statement whose risk value meets a preset risk condition to obtain a risk execution statement of the program to be tested, and obtain at least one breakpoint of the program to be tested based on the risk execution statement, wherein the test case set includes a failed test case set and a successful test case set; an acquisition module, used to obtain the running memory information of the program to be tested at all breakpoints in combination with the program to be tested and the failed test case set; A second generation module is used to obtain the PMS corresponding to each failed test case based on the running memory information, and to obtain at least one pair of PMS pairs of the failed test case set based on the PMS; a calculation module is used to input the PMS pairs into the trained twin convolutional neural network respectively to obtain the similarity between all PMS pairs, and calculate the distance information between all PMS pairs based on the similarity and the target formula; an isolation module is used to determine the failure behavior similarities and differences information of the program under test according to the distance information and the failed test case set, and isolate the failure root cause of the program under test based on the failure behavior similarities and differences information.

[0016] Optionally, in one embodiment of the present application, the second generation module includes: a first construction unit, used to construct a failure test case matrix for each failed test case based on the variable name memory information, variable value memory information and stack frame number memory information of the running memory information; a first generation unit, used to normalize the failure test case matrix to obtain a normalized failure test case matrix, and obtain the PMS corresponding to each failed test case based on the normalized failure test case matrix.

[0017] Optionally, in one embodiment of the present application, the running memory information may be, but is not limited to, represented as:

[0018] ,

[0019] in, yes During the execution The memory information queried at yes The actual number of breakpoints.

[0020] Optionally, in one embodiment of the present application, the computing module includes: a second construction unit, used to construct the twin convolutional neural network, wherein the twin convolutional neural network includes at least two AlexNet or VGG-16 with the same structure and weights, and at least two fully connected layers, and the two fully connected layers contain a ReLU activation function; a second generation unit, used to obtain a training set of the twin convolutional neural network based on the set of failed test cases; a third generation unit, used to train the twin convolutional neural network based on the training set to obtain a trained twin convolutional neural network, and input the PMS pair into the trained twin convolutional neural network to obtain the similarity between the PMS pairs, wherein when the similarity is 1, it is determined that the two failed test cases corresponding to the PMS pair have the same root cause of failure, and when the similarity is 0, it is determined that the two failed test cases corresponding to the PMS pair have different root causes of failure.

[0021] Optionally, in one embodiment of the present application, the calculation formula of the target formula may be, but is not limited to,:

[0022] ,

[0023] in, is the similarity of the two PMS images output by the twin neural network, It is the ratio of the larger side length to the smaller side length of the two PMS images.

[0024] A third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for isolating root causes of failures based on memory spectrum as described in the above embodiment.

[0025] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for isolating root causes of failures based on memory spectrum.

[0026] A fifth aspect of the present application provides a computer program product, including a computer program, which, when executed, implements the above-mentioned method for isolating root causes of failures based on memory spectrum.

[0027] The embodiment of the present application obtains the breakpoints of the executable statements of the program to be tested through the test case set, and obtains the running memory information of the program to be tested at all breakpoints by using the failed test case set, and then generates the corresponding PMS, respectively inputs the PMS pairs into the trained twin convolutional neural network to obtain the similarity between all PMS pairs, and calculates the distance information between all PMS pairs based on the similarity, and finally determines the similarities and differences of the failure behavior of the program to be tested, and realizes the isolation of the root cause of failure of the program to be tested, using the running memory information as the source data of the failure characterization, and realizing the distance prediction by means of the twin convolutional neural network model, realizing a highly flexible failure root cause isolation method including multiple manually intervened interfaces in an automated form, and effectively improving the accuracy of the failure root cause isolation task. At the same time, by representing the failed test case in the form of PMS that can be directly understood by the human eye, the problem of insufficient comprehensibility commonly faced by the current failure root cause isolation technology can be effectively solved. This solves the problem in related technologies that it is difficult to deeply explore the internal state of the program when the failure occurs, hindering its accurate characterization, making it difficult for the failure root cause isolation technology to achieve satisfactory results. In addition, it is difficult for humans to intuitively understand, resulting in low comprehensibility of the output of the failure root cause isolation technology, affecting the possibility of human programmers adopting the results.

[0028] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0030] Figure 1 A flowchart of a failure root cause isolation method based on memory spectrum provided according to an embodiment of the present application;

[0031] Figure 2 A flowchart of converting memory information into a memory spectrum picture according to an embodiment of the present application;

[0032] Figure 3 A schematic block diagram of a distance measurement model based on a twin convolutional neural network provided according to an embodiment of the present application;

[0033] Figure 4 A schematic diagram of a block diagram of distance information between PMS images of a failed test case provided according to an embodiment of the present application;

[0034] Figure 5 A block diagram of the working principle of a failure root cause isolation method based on memory spectrum provided according to an embodiment of the present application;

[0035] Figure 6 A block diagram of a failure root cause isolation device based on memory spectrum according to an embodiment of the present application;

[0036] Figure 7 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0037] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0038] The following describes a method and device for isolating root causes of failures based on memory spectrum according to an embodiment of the present application with reference to the accompanying drawings. In view of the difficulty mentioned in the above background technology in deeply mining the internal state of the program when the failure occurs, which hinders its accurate characterization and makes it difficult for the failure root cause isolation technology to achieve satisfactory results. In addition, it is difficult for humans to intuitively understand, resulting in low comprehensibility of the output of the failure root cause isolation technology, which affects the possibility of human programmers adopting the results. The present application provides a failure root cause isolation method based on memory spectrum. In this method, the breakpoints of the executable statements of the program to be tested are obtained through a test case set, and the running memory information of the program to be tested at all breakpoints is obtained by using the failed test case set, and then the corresponding PMS is generated. The PMS pairs are respectively input into the trained twin convolutional neural network to obtain the similarity between all PMS pairs, and the distance information between all PMS pairs is calculated based on the similarity, and finally the failure behavior similarities and differences of the program to be tested are determined to achieve the failure root cause isolation of the program to be tested. The running memory information is used as the source data for failure characterization, and the distance prediction is realized by means of the twin convolutional neural network model. A highly flexible failure root cause isolation method including multiple manually intervened interfaces is realized in an automated form, which effectively improves the accuracy of the failure root cause isolation task. At the same time, by representing the failed test cases in the form of PMS that can be directly understood by the human eye, the lack of comprehensibility problem currently faced by the root cause isolation technology can be effectively solved. This solves the problem that it is difficult to deeply explore the internal state of the program when the failure occurs in the related technology, which hinders its accurate characterization and makes it difficult for the root cause isolation technology to achieve satisfactory results. In addition, it is difficult for humans to intuitively understand, resulting in low comprehensibility of the output of the root cause isolation technology, which affects the possibility of human programmers adopting the results.

[0039] Specifically, Figure 1 The present invention is a flowchart of a method for isolating root causes of failures based on memory spectrum according to an embodiment of the present application.

[0040] like Figure 1 As shown, the failure root cause isolation method based on memory spectrum includes the following steps:

[0041] In step S101, a risk value of an executable statement is obtained based on the executable statement and the test case set of the program to be tested, an executable statement whose risk value meets a preset risk condition is selected to obtain a risky execution statement of the program to be tested, and at least one breakpoint of the program to be tested is obtained based on the risky execution statement, wherein the test case set includes a failed test case set and a successful test case set.

[0042] As a possible implementation method, the embodiment of the present application can calculate the risk value of the statement granularity for the executable statements of the program to be tested based on SBFL, and select the executable statements whose risk values ​​meet certain risk conditions to obtain the risky execution statements of the program to be tested. For example, the embodiment of the present application can sort all statements from high to low according to the risk value, and take the high-risk statements at the head as risky execution statements according to a certain proportion (such as 10%, which is not specifically limited in this application) and set them as breakpoints. Among them, the certain risk conditions can be set by technicians in this field according to actual conditions, and this application does not make specific restrictions.

[0043] In the embodiment of the present application, the SBFL technology can be understood as DStar, and its expression can be but not limited to:

[0044]

[0045] in, is the calculated risk value of a program statement, is the number of times a program statement is covered by failed test cases. is the number of times a program statement is covered by successful test cases. The number of times a program statement is not covered by a failing test case.

[0046] Furthermore, the embodiments of the present application can calculate the risk values ​​of the executable statements of the program to be tested according to DStar, and then sort them from high to low according to the risk values. For statements with the same risk value, they will be sorted from small to large according to the line number. Regarding the selection of executable statements whose risk values ​​meet certain risk conditions as breakpoints, it is actually the granularity of modeling the set of failed test cases. When the ratio is small, the collection of running state memory information will be limited to a few high-risk program points. At this time, the monitoring of the entire running process of the failure behavior will be carried out at a coarser granularity; and as the ratio increases, the scope of collection will gradually expand to areas with relatively low risk values, the density of sentinel points for monitoring failure behaviors will increase, and the granularity of modeling will become finer.

[0047] For example, in the embodiment of the present application, for a program to be tested (Contains l statements) and test case set (including failed test case set And the successful test case set , , ),exist Execute on , the obtained program spectrum information ( , and The risk value of program statements is calculated and the top x% of statements are set as breakpoints (where x can be 10, because in the experiment of this method, taking the top 10% high-risk statements as breakpoints is enough to effectively extract the characteristics of failure behavior. Increasing this ratio will not bring substantial benefits to the failure root cause isolation task, but will increase the computational cost), thus obtaining Breakpoints ,in, The risk value is ranked breakpoint.

[0048] In step S102, the running memory information of the program under test at all breakpoints is obtained by combining the program under test and the failed test case set. The running memory information can be, but is not limited to, represented as:

[0049] ,

[0050] in, yes During the execution The memory information queried at yes The actual number of breakpoints.

[0051] During the actual execution process, the embodiment of the present application can execute a set of failed test cases and query the running memory information at the breakpoint, which may include but is not limited to variable names, variable values, and stack frame numbers, etc. The present application does not make specific restrictions and uses the collected running memory information as the source data to characterize the corresponding set of failed test cases.

[0052] Among them, the embodiment of the present application is for each failure behavior in the failed test case set , execute it on the program under test and collect running memory information, which can be used Indicates, where MI is the abbreviation of Memory Information, which can be understood as memory information, which can be expressed as but not limited to:

[0053]

[0054] in, yes During the execution The memory information queried at yes The actual number of breakpoints), so that the collected memory information retains the control flow information of the program running process. exist The number of variables collected at , Contains three lengths List of: , and , whose expressions can be respectively:

[0055] Among them, the embodiments of this application yes During execution Found The name of a variable, which can be represented by, but is not limited to:

[0056]

[0057] yes During execution Found The value of a variable (for some special variables, it can be processed according to its type. For example, for a pointer variable, the embodiment of the present application can index the pointed value according to the address, and the present application does not make specific restrictions), which can be expressed as but not limited to:

[0058]

[0059] yes During execution Found The stack frame depth of a variable can be expressed as, but not limited to:

[0060]

[0061] The above gives During the execution Runtime memory information collected at this single breakpoint. The running memory information queried at all breakpoints can be expressed as, but not limited to:

[0062]

[0063] in, Represents an append operation between two lists, , and The length is actually The total number of variables collected at all breakpoints during execution is denoted as , which can be expressed as but not limited to:

[0064]

[0065] Among them, in the process of executing the failed test case set to collect running memory information, when the program stops at a breakpoint, the embodiment of the present application can actually only collect the memory information at the position before the breakpoint is executed. In order to ensure that the memory information is collected at the high-risk statements recommended by the SBFL technology, when the program stops at each breakpoint, it will continue to execute one step forward and then start the collection operation; in addition, in the actual program execution process, a statement may be executed multiple times. In this case, the collection operation of the variable value will be performed after the statement is executed, because the final variable value reflects the accumulation of the entire execution process; at the same time, in order to save the cost of the method, if a program statement contains a function call, when querying the memory information at this place, it will not iteratively enter the called function for further query, but will focus on the original position of the preset breakpoint.

[0066] For example, the embodiment of the present application runs a failed test case on a program with breakpoints, and collects the running memory information MI at the breakpoint according to formula (2). Among them, the MI of the embodiment of the present application includes variable names, variable values ​​and stack frame numbers, wherein the content and structure of the memory information at a single breakpoint are defined by formulas (3) to (5), the content and structure of the memory information at all breakpoints are defined by formulas (6) to (8), and the length of MI is determined by formula (9); then, the variable names and variable values ​​in MI are converted into numerical forms according to formula (10).

[0067] In step S103, a PMS corresponding to each failed test case is obtained based on the running memory information, and at least one PMS pair of the failed test case set is obtained based on the PMS.

[0068] In some embodiments, the embodiments of the present application can convert the variable name and variable value dimensions of the running memory information from a string form to a numerical form and normalize them. The stack frame number is directly normalized. After the information of the above three dimensions is processed into a numerical form, it is scaled to the value range specified by the RGB (Red, Green, Blue) color system, thereby converting the running memory information corresponding to a failed test case into a three-channel color picture that can be intuitively recognized by the human eye, and using this picture (called PMS) as a representation of the failed test case.

[0069] For example, in the embodiment of the present application, a set of MI corresponding to each failed test case is calculated according to Figure 2 As a demonstration implementation method, the present application embodiment does not need to list all the PMS images of failed test cases one by one. Therefore, the present application embodiment can randomly select seven from all failed test cases for display, which can be but not limited to , , , , , and (Other failed test cases omitted here also support the conclusion of this specific implementation method, and this application does not make specific restrictions.) and is triggered by the bug in line 3168, and It is triggered by the defect in line 4685. , and It is triggered by the bug in line 7484.

[0070] Optionally, in one embodiment of the present application, a PMS corresponding to each failed test case is obtained based on running memory information, including: constructing a failed test case matrix for each failed test case based on variable name memory information, variable value memory information and stack frame number memory information of the running memory information; normalizing the failed test case matrix to obtain a normalized failed test case matrix, and obtaining the PMS corresponding to each failed test case based on the normalized failed test case matrix.

[0071] It can be understood by those skilled in the art that the embodiments of the present application can further process the running memory information and convert it into a human vision-friendly color memory spectrum image to obtain the PMS corresponding to each failed test case.

[0072] Specifically, for each failed test case, A corresponding set of memory information Convert to memory spectrum image . is a shape of A matrix where "1" represents 1 column, "express The total number of variables collected at all breakpoints during execution. "3" represents the three dimensions of memory information, namely variable name, variable value, and stack frame number. The matrix is ​​reorganized into a shape of It can be understood that the embodiment of the present application first takes Before the Matrix Elements as The first column of the matrix, and then continue to take The matrix ( ) to Elements as The second column of the matrix, until All elements are taken. The side length of the new square matrix is , that is, Round up. If If it is not a perfect square number, there will be a few elements in the last few columns of the new square matrix that cannot be filled. At this time, these elements are set to 0 to distinguish them from the previous elements.

[0073] Furthermore, the matrix after reorganization in the embodiment of the present application The matrix can be viewed as three The superposition of matrices: [:,:,0], [:,:,1] and [:,:,2] (representing , and ),in, The elements in are integers, and and The elements in are in string form. In order to make them have a unified format and provide preparation for subsequent conversion into pictures, the embodiment of the present application can and The elements in are converted into numerical form. In this embodiment of the application, for the variable name / variable value in string format (denoted as ), use the following formula to convert it into a numerical value (denoted as ), which can be expressed as but not limited to:

[0074]

[0075] Among them, the function The function is to get the Ascii code of a given single character and multiply it by It is used to distinguish between two strings that have the same characters but in different order.

[0076] in this way, Each element in the matrix is ​​already an integer, which has the conditions for being converted into a three-channel color image. Among them, the embodiment of the present application can use RGB, one of the most widely used color systems, to complete the conversion process. In addition, in order to make the embodiment of the present application The matrix is ​​adapted to the RGB mode, and the elements in the three sub-matrices [:,:,0], [:,:,1] and [:,:,2] are normalized respectively, and their values ​​are scaled to the numerical range specified by RGB. Because the three sub-matrices represent three different aspects of memory information, this normalization process can also alleviate the problem of different numerical scales among the three sub-matrices. Then, through the above steps, the embodiment of the present application can The matrix is ​​converted into a colorful PMS picture. The failed test case in the form of a PMS picture is human-friendly and can be intuitively identified by the naked eye, which can effectively help human programmers understand the failure root cause isolation results.

[0077] In step S104, the PMS pairs are respectively input into the trained twin convolutional neural network to obtain the similarity between all PMS pairs, and the distance information between all PMS pairs is calculated based on the similarity and the target formula.

[0078] As a possible implementation method, the embodiment of the present application can input the PMS pair into the trained twin convolutional neural network. The training process uses the "PMS pair" as a single sample. The model obtained after training can be used to judge the root cause similarity of failed test cases in the new environment, and the distance information between all PMS pairs can be calculated according to the similarity and target formula to obtain the distance information.

[0079] Optionally, in one embodiment of the present application, the PMS pairs are respectively input into the trained twin convolutional neural network to obtain the similarity between all PMS pairs, including: constructing a twin convolutional neural network, wherein the twin convolutional neural network includes at least two AlexNet or VGG-16 with the same structure and weights, and at least two fully connected layers, and the two fully connected layers contain a ReLU activation function; based on the set of failed test cases, a training set of the twin convolutional neural network is obtained; based on the training set, the twin convolutional neural network is trained to obtain the trained twin convolutional neural network, and the PMS pairs are input into the trained twin convolutional neural network to obtain the similarity between the PMS pairs, wherein when the similarity is 1, it is determined that the two failed test cases corresponding to the PMS pair have the same root cause of failure, and when the similarity is 0, it is determined that the two failed test cases corresponding to the PMS pair have different root causes of failure. Wherein, the calculation formula of the target formula can be, but is not limited to, as follows:

[0080] ,

[0081] in, is the similarity of the two PMS images output by the twin neural network, It is the ratio of the larger side length to the smaller side length of the two PMS images.

[0082] It is understandable that the twin learning in the embodiment of the present application is a classic supervision-based strategy in the field of similarity learning. The goal of the neural network based on twin learning is to learn the similarity measure between given input sample pairs, and based on this, make similarity predictions for new input sample pairs. The twin convolutional neural network model usually includes two identical sub-CNN (Convolutional Neural Network) networks, which share the same network structure and weights. These two networks are responsible for feature extraction of the two input samples respectively; followed by a fully connected network, which is responsible for further processing the features transmitted by the upstream feature extraction subnetwork to generate a final value reflecting the similarity of the two input samples.

[0083] Furthermore, in the embodiment of the present application, the composition structure of the twin convolutional neural network may include, but is not limited to: two AlexNet or VGG-16 sub-feature extraction networks with the same structure and weights, and two fully connected layers (with ReLU activation function in the middle). In addition, the twin convolutional neural network in the embodiment of the present application is trained based on the BCELoss (Binary Cross Entropy Loss) loss function, and its formula may be, but is not limited to, expressed as:

[0084]

[0085] in, is the number of data samples, It is The true label (positive or negative) of each sample, It is The probability of a sample being predicted as positive. During the training process, the true label of a pair of failed test cases (i.e., a pair of PMS images) is either "1", that is, the two failed test cases are triggered by the same defect (so their similarity should be 1); or "0", that is, the two failed test cases are triggered by different defects (so their similarity should be 0). The pair of PMS images with the label "1" is recorded as a "positive" sample, and the pair of PMS images with the label "0" is recorded as a "negative" sample.

[0086] Furthermore, during the training process of the twin convolutional neural network in the embodiment of the present application, the BatchSize can be set to 16, the initial learning rate can be set to 1e-4, and then gradually decreased at a rate of 0.96 in each epoch. The specific settings can be made by technicians in this field according to actual conditions, and this application does not impose any specific restrictions.

[0087] Furthermore, the embodiment of the present application can obtain a trained twin neural network model, which can be used to predict the similarity between a pair of new failed test cases (i.e., a pair of PMS images), which can reflect the possibility that the two failures are triggered by the same defect.

[0088] Through the above analysis, it can be seen that the failed test case of the embodiment of the present application The length of the corresponding PMS depends on ,Right now The total number of variables queried at all breakpoints during execution. It is likely to correspond to different , which results in different sizes of the PMS to be compared, while the two sub-network structures and weights of the twin convolutional neural network model are consistent, making it difficult to handle such a situation. Therefore, before inputting a pair of PMS pairs into the twin network model, the embodiment of the present application first processes them into the same size. At the same time, in order to avoid the possible loss of accuracy caused by this processing method ( yes The total number of variables queried during operation can also reflect the characteristics of failure behavior to a certain extent). The embodiment of the present application can further process the similarity of the output of the twin network model and convert the similarity value into a distance value. The formula involved can be expressed as but not limited to:

[0089]

[0090] in, is the similarity of the two PMS images output by the twin neural network, It is the ratio of the larger side length to the smaller side length of the two PMS images.

[0091] The formula in the embodiment of the present application has two functions: one is to convert similarity information into distance information, and the other is to "compensate" for the loss of accuracy that may be caused by preprocessing the two input images to the same size in the previous step. Specifically, the embodiment of the present application " " is to subtract the similarity from 1 to get the distance, because the greater (smaller) the similarity, the smaller (larger) the distance should be. And " " is to multiply the size difference information of the two pictures. Specifically, the embodiments of the present application are different. May correspond to different , so it corresponds to the side length of PMS They may also be different and need to be processed into the same size to meet the input requirements of the twin neural network model. yes The total number of variables queried at all breakpoints during the run, which itself can also reflect to a certain extent characteristics, and thus to identify a pair To alleviate this problem, the design The weight coefficient is equal to the ratio of the side length of the larger PMS to the side length of the smaller PMS, which is used to quantitatively reflect the size difference between the two PMS. Multiplying the weight coefficient by the distance can enable the distance measurement module of the present invention to more comprehensively calculate the similarities and differences between two failed test cases, thereby providing more accurate data for subsequent clustering steps.

[0092] During the actual implementation process, the embodiment of the present application can input the PMS pairs into the trained twin convolutional neural network respectively to obtain the similarity between all PMS pairs.

[0093] For example, the embodiment of the present application can use the trained twin convolutional neural network to predict the similarities between all failed test cases, such as Figure 3 As shown; then combined with the image size, the distance information is obtained using formula (12), as Figure 4 As shown, Figure 4 The box diagram cells in the table represent other failure behaviors that are closest to a certain failure behavior.

[0094] In step S105, the failure behavior similarities and differences information of the program under test is determined according to the distance information and the failed test case set, and the failure root cause of the program under test is isolated based on the failure behavior similarities and differences information.

[0095] As an implementation method, the embodiment of the present application can output the distance information between PMS pairs to the downstream clustering algorithm, so that the failed test cases are divided into different clusters according to the distance information, and the failed test cases are divided according to the underlying root causes of the defects, thereby completing the failure root cause isolation process.

[0096] Specifically, the embodiment of the present application successively extracts features and models the failure behaviors, measures the distances between the failure behaviors, and makes all the failure behaviors have favorable conditions for being divided. Then, the embodiment of the present application can use the clustering algorithm of the failure root cause isolation technology MSeer for clustering, which is mainly divided into two parts:

[0097] Part I: Estimation of the number of clusters (number of defects).

[0098] Among them, the embodiment of the present application first completes the step of estimating the number of clusters (number of defects) based on the mountain method. That is, first determine a potential value for each sample point (i.e., each failed test case) based on the density, so that the sample point with a higher density environment has a higher potential value, and vice versa. This potential value will be used to measure the possibility of the sample point being the centroid of the cluster. Then, the embodiment of the present application (1) selects the sample point with the highest density value as the current centroid; (2) updates the potential values ​​of all sample points based on their distance from the current latest centroid. The principle is that the sample points closer to the latest centroid have a greater decrease in potential value (i.e., the sample points closer to the current centroid are less likely to continue to be selected as the centroid); (3) iteratively repeat the above two steps until the potential values ​​of all sample points fall into a certain range.

[0099] Part II: Clustering Execution.

[0100] The embodiment of the present application utilizes the K-medoid algorithm, which only considers the actual sample points in the process of taking the centroid, and does not construct virtual points by averaging. This makes it more suitable for failure root cause isolation based on memory information, because averaging memory information is often undefined. In addition, the K-medoid algorithm is also more robust to noise and boundary values.

[0101] For example, the embodiment of the present application can estimate the number of clusters based on the distance information obtained above, and perform clustering. The seven failed test cases are divided into three groups: , and It can be seen that the failure root cause isolation results of the embodiment of the present application are similar to Figure 4 The distance information presented in is highly consistent with the visual information and is consistent with the actual division relationship between these failed test cases.

[0102] The embodiment of the present application uses memory information as the source data for failure characterization, realizes distance prediction by means of a twin convolutional neural network model, and realizes a highly flexible failure root cause isolation method including multiple manually intervened interfaces in an automated form, effectively improving the accuracy of the failure root cause isolation task. At the same time, the embodiment of the present application represents the failed test case in the form of a color memory spectrum image that can be directly understood by the human eye, which can effectively solve the problem of insufficient comprehensibility commonly faced by the current failure root cause isolation technology. The application embodiment ultimately forms a complete set of software failure root cause isolation methods based on program memory spectrum images. Users can use this method to achieve efficient and automated failure root cause isolation in a multi-defect environment, and use it for debugging work in actual production.

[0103] The working principle of the failure root cause isolation device method based on memory spectrum proposed in the embodiment of the present application is described in detail below in conjunction with a specific embodiment.

[0104] in, Figure 5 The flowchart is a working principle of a failure root cause isolation method based on memory spectrum according to an embodiment of the present application.

[0105] Step S501: Error program.

[0106] Step S502: Test case set.

[0107] Step S503: mark the error program with a breakpoint.

[0108] Step S504: running state memory information.

[0109] Step S505: PMS picture.

[0110] Step S506: Twin convolutional neural network.

[0111] Step S507: Similarity value.

[0112] Step S508: PMS picture.

[0113] Step S509: Similarity value.

[0114] Step S510: distance.

[0115] Step S511: Failure root cause isolation distance.

[0116] It can be understood that the embodiment of the present application divides the entire process into a training phase and a deployment phase. Among them, the training phase involves step S101: using SBFL technology to determine risky execution statements as breakpoints of the program to be tested; step S102: running a set of failed test cases and collecting running memory information at breakpoints; step S103: converting the running memory information into a visual PMS and step S104: training the twin convolutional neural network; the deployment phase involves step S104: the actual application of the trained twin neural network, calculating the distance information between failed test cases, and step S105: clustering based on distance information.

[0117] Furthermore, the embodiment of the present application provides a specific demonstration program example file pattern searcher Grep. Among them, the function of the file pattern searcher Grep is to print out the lines that meet a specific pattern given a file. Specifically, the embodiment of the present application first obtains Grep v2.4 (containing 13274 lines of code) from the Software Infrastructure Repository (https: / / sir.csc.ncsu.edu / portal / index.php), and then randomly mutates three locations therein (source program lines 3168, 4685, and 7484) to inject three defects into the original program and obtain a 3-bug erroneous version. Among them, the defect on line 3168 is to mutate the source code "MALLOC (grps [ngrps]. elems, position, d -> nleaves)" to "MALLOC (grps [ngrps]. elems, position, d -> nleaves * -1)", the defect on line 4685 is to mutate the source code "d = d1 [U (tp [-1])], tp + = d" to "d = d1 [U (! tp [-1])], tp + = d", and the defect on line 7484 is to mutate the source code "compile_stack.size = INIT_COMPILE_STACK_SIZE" to "compile_stack.size = 0". Compile the program after implanting the mutation defect and run the given test case set, and you can observe a series of failed test cases and successful test cases. These failed test cases are the direct work objects of the failure root cause isolation task.

[0118] According to the method of the failure root cause isolation device based on memory spectrum proposed in the embodiment of the present application, the breakpoints of the executable statements of the program to be tested are obtained through the test case set, and the running memory information of the program to be tested at all breakpoints is obtained by using the failed test case set, and then the corresponding PMS is generated, and the PMS pairs are respectively input into the trained twin convolutional neural network to obtain the similarity between all PMS pairs, and the distance information between all PMS pairs is calculated based on the similarity, and finally the failure behavior similarities and differences of the program to be tested are determined to achieve the failure root cause isolation of the program to be tested, and the running memory information is used as the source data of the failure representation, and the distance prediction is realized by the twin convolutional neural network model, and a highly flexible failure root cause isolation method including multiple manually intervened interfaces is realized in an automated form, which effectively improves the accuracy of the failure root cause isolation task. At the same time, by characterizing the failed test case in the form of PMS that can be directly understood by the human eye, the problem of insufficient comprehensibility commonly faced by the current failure root cause isolation technology can be effectively solved. This solves the problem in related technologies that it is difficult to deeply explore the internal state of the program when the failure occurs, hindering its accurate characterization, making it difficult for the failure root cause isolation technology to achieve satisfactory results. In addition, it is difficult for humans to intuitively understand, resulting in low comprehensibility of the output of the failure root cause isolation technology, affecting the possibility of human programmers adopting the results.

[0119] Next, a failure root cause isolation device based on memory spectrum proposed according to an embodiment of the present application is described with reference to the accompanying drawings.

[0120] Figure 6 The present invention is a block diagram of a failure root cause isolation device based on memory spectrum according to an embodiment of the present application.

[0121] like Figure 6 As shown, the failure root cause isolation device 10 based on memory spectrum includes: a first generation module 100 , an acquisition module 200 , a second generation module 300 , a calculation module 400 and an isolation module 500 .

[0122] Among them, the first generation module 100 is used to obtain the risk value of the executable statement based on the executable statement and the test case set of the program to be tested, select the executable statement whose risk value meets the preset risk condition to obtain the risk execution statement of the program to be tested, and obtain at least one breakpoint of the program to be tested based on the risk execution statement, wherein the test case set includes a failed test case set and a successful test case.

[0123] The acquisition module 200 is used to obtain the running memory information of the program under test at all breakpoints in combination with the program under test and the set of failed test cases.

[0124] The second generating module 300 is used to obtain the PMS corresponding to each failed test case based on the running memory information, and obtain at least one pair of PMS pairs of the failed test case set based on the PMS.

[0125] The calculation module 400 is used to input the PMS pairs into the trained twin convolutional neural network respectively to obtain the similarity between all PMS pairs, and calculate the distance information between all PMS pairs based on the similarity and the target formula.

[0126] The isolation module 500 is used to determine the failure behavior similarities and differences of the program under test according to the distance information and the failed test case set, and isolate the failure root cause of the program under test based on the failure behavior similarities and differences information.

[0127] Optionally, in one embodiment of the present application, the second generating module 300 includes: a first constructing unit and a first generating unit.

[0128] The first construction unit is used to construct a failure test case matrix for each failed test case based on the variable name memory information, the variable value memory information and the stack frame number memory information of the running memory information.

[0129] The first generating unit is used to normalize the failed test case matrix to obtain a normalized failed test case matrix, and obtain a PMS corresponding to each failed test case based on the normalized failed test case matrix.

[0130] Optionally, in one embodiment of the present application, the running memory information may be represented by, but not limited to:

[0131] ,

[0132] in, yes During the execution The memory information queried at yes The actual number of breakpoints.

[0133] Optionally, in one embodiment of the present application, the calculation module 400 includes: a second construction unit, a second generation unit and a third generation unit.

[0134] Among them, the second construction unit is used to construct a twin convolutional neural network, wherein the twin convolutional neural network includes at least two AlexNet or VGG-16 with the same structure and weights, and at least two fully connected layers, and the two fully connected layers contain a ReLU activation function.

[0135] The second generation unit is used to obtain a training set of the twin convolutional neural network based on the set of failed test cases.

[0136] The third generating unit is used to train the twin convolutional neural network based on the training set to obtain the trained twin convolutional neural network, and input the PMS pairs into the trained twin convolutional neural network to obtain the similarity between the PMS pairs, wherein when the similarity is 1, it is determined that the two failed test cases corresponding to the PMS pair have the same root cause of failure, and when the similarity is 0, it is determined that the two failed test cases corresponding to the PMS pair have different root causes of failure.

[0137] Optionally, in one embodiment of the present application, the calculation formula of the target formula may be, but is not limited to,:

[0138] ,

[0139] in, is the similarity of the two PMS images output by the twin neural network, It is the ratio of the larger side length to the smaller side length of the two PMS images.

[0140] It should be noted that the above explanations of the embodiment of the failure root cause isolation method based on memory spectrum are also applicable to the failure root cause isolation device based on memory spectrum in this embodiment, and will not be repeated here.

[0141] According to the memory spectrum-based failure root cause isolation device proposed in the embodiment of the present application, the breakpoints of the executable statements of the program to be tested are obtained through the test case set, and the running memory information of the program to be tested at all breakpoints is obtained by using the failed test case set, and then the corresponding PMS is generated, and the PMS pairs are respectively input into the trained twin convolutional neural network to obtain the similarity between all PMS pairs, and the distance information between all PMS pairs is calculated based on the similarity, and finally the failure behavior similarities and differences of the program to be tested are determined to achieve the failure root cause isolation of the program to be tested, and the running memory information is used as the source data for failure characterization, and the distance prediction is achieved by means of the twin convolutional neural network model, and a highly flexible failure root cause isolation method including multiple manually intervened interfaces is realized in an automated form, which effectively improves the accuracy of the failure root cause isolation task. At the same time, by characterizing the failed test case in the form of PMS that can be directly understood by the human eye, the problem of insufficient comprehensibility commonly faced by the current failure root cause isolation technology can be effectively solved. This solves the problem in related technologies that it is difficult to deeply explore the internal state of the program when the failure occurs, hindering its accurate characterization, making it difficult for the failure root cause isolation technology to achieve satisfactory results. In addition, it is difficult for humans to intuitively understand, resulting in low comprehensibility of the output of the failure root cause isolation technology, affecting the possibility of human programmers adopting the results.

[0142] Figure 7 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. The electronic device may include:

[0143] A memory 701 , a processor 702 , and a computer program stored in the memory 701 and executable on the processor 702 .

[0144] When the processor 702 executes the program, the failure root cause isolation method based on memory spectrum provided in the above embodiment is implemented.

[0145] Furthermore, the electronic device further comprises:

[0146] The communication interface 703 is used for communication between the memory 701 and the processor 702 .

[0147] The memory 701 is used to store computer programs that can be executed on the processor 702 .

[0148] The memory 701 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0149] If the memory 701, the processor 702 and the communication interface 703 are implemented independently, the communication interface 703, the memory 701 and the processor 702 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0150] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can communicate with each other through an internal interface.

[0151] The processor 702 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0152] The embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for isolating root causes of failures based on memory spectrum.

[0153] An embodiment of the present application further provides a computer program product, including a computer program, which, when executed, implements the above-mentioned method for isolating root causes of failures based on memory spectrum.

[0154] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0155] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0156] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0157] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or N wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.

[0158] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one or a combination of multiple of the following technologies known in the art: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0159] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0160] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0161] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for isolating root causes of failures based on memory spectrum, characterized in that: The following steps are involved: Based on the executable statements and the test case set of the program to be tested, a risk value of the executable statement is obtained, the executable statement whose risk value satisfies a preset risk condition is selected to obtain a risk execution statement of the program to be tested, and at least one breakpoint of the program to be tested is obtained based on the risk execution statement, wherein the test case set includes a failed test case set and a successful test case set; In combination with the program to be tested and the set of failed test cases, the running memory information of the program to be tested at all breakpoints is obtained; Obtaining a memory spectrum PMS corresponding to each failed test case based on the running memory information, and obtaining at least one pair of PMS pairs of the failed test case set based on the PMS; The PMS pairs are respectively input into the trained twin convolutional neural network to obtain the similarity between all PMS pairs, and the distance information between all PMS pairs is calculated based on the similarity and the target formula; The failure behavior similarities and differences information of the program under test is determined according to the distance information and the set of failed test cases, and the failure root cause of the program under test is isolated based on the failure behavior similarities and differences information.

2. The method according to claim 1, characterized in that The obtaining the PMS corresponding to each failed test case based on the running memory information includes: Constructing a failure test case matrix for each failed test case based on the variable name memory information, the variable value memory information and the stack frame number memory information of the running memory information; The failed test case matrix is ​​normalized to obtain a normalized failed test case matrix, and the PMS corresponding to each failed test case is obtained based on the normalized failed test case matrix.

3. The method according to claim 1, characterized in that The running memory information is represented as follows: , in, yes During the execution The memory information queried at yes The actual number of breakpoints.

4. The method according to claim 1, characterized in that: The PMS pairs are respectively input into the trained twin convolutional neural network to obtain the similarity between all PMS pairs, including: Constructing the twin convolutional neural network, wherein the twin convolutional neural network includes at least two AlexNet or VGG-16 with the same structure and weights, and at least two fully connected layers, and the two fully connected layers contain a ReLU activation function; Based on the set of failed test cases, obtaining a training set of the twin convolutional neural network; The twin convolutional neural network is trained based on the training set to obtain a trained twin convolutional neural network, and the PMS pairs are input into the trained twin convolutional neural network to obtain the similarity between the PMS pairs, wherein when the similarity is 1, it is determined that the two failed test cases corresponding to the PMS pair have the same root cause of failure, and when the similarity is 0, it is determined that the two failed test cases corresponding to the PMS pair have different root causes of failure.

5. The method according to claim 1, characterized in that The calculation formula of the target formula is: , in, is the similarity of the two PMS images output by the twin neural network, It is the ratio of the larger side length to the smaller side length of the two PMS images.

6. A failure root cause isolation device based on memory spectrum, characterized in that: include: A first generating module is used to obtain a risk value of the executable statement based on the executable statement and the test case set of the program to be tested, select the executable statement whose risk value meets the preset risk condition to obtain the risk execution statement of the program to be tested, and obtain at least one breakpoint of the program to be tested based on the risk execution statement, wherein the test case set includes a failed test case set and a successful test case set; An acquisition module, used to obtain the running memory information of the program under test at all breakpoints by combining the program under test and the failed test case set; A second generating module, configured to obtain a PMS corresponding to each failed test case based on the running memory information, and obtain at least one PMS pair of the failed test case set based on the PMS; A calculation module, used for inputting the PMS pairs into the trained twin convolutional neural network respectively to obtain the similarity between all PMS pairs, and calculating the distance information between all PMS pairs based on the similarity and the target formula; The isolation module is used to determine the failure behavior similarities and differences of the program under test according to the distance information and the set of failed test cases, and isolate the failure root cause of the program under test based on the failure behavior similarities and differences information.

7. The device according to claim 6, characterized in that The second generating module comprises: A first construction unit is used to construct a failure test case matrix of each failed test case based on the variable name memory information, the variable value memory information and the stack frame number memory information of the running memory information; The first generating unit is used to normalize the failed test case matrix to obtain a normalized failed test case matrix, and obtain the PMS corresponding to each failed test case based on the normalized failed test case matrix.

8. The device according to claim 6, characterized in that The running memory information is represented as follows: , in, yes During the execution The memory information queried at yes The actual number of breakpoints.

9. The device according to claim 6, characterized in that The computing module comprises: A second construction unit is used to construct the twin convolutional neural network, wherein the twin convolutional neural network includes at least two AlexNet or VGG-16 with the same structure and weights, and at least two fully connected layers, and the two fully connected layers contain a ReLU activation function; A second generating unit, configured to obtain a training set of the twin convolutional neural network based on the set of failed test cases; The third generating unit is used to train the twin convolutional neural network based on the training set to obtain the trained twin convolutional neural network, and input the PMS pairs into the trained twin convolutional neural network to obtain the similarity between the PMS pairs, wherein when the similarity is 1, it is determined that the two failed test cases corresponding to the PMS pair have the same root cause of failure, and when the similarity is 0, it is determined that the two failed test cases corresponding to the PMS pair have different root causes of failure.

10. The device according to claim 6, characterized in that The calculation formula of the target formula is: , in, is the similarity of the two PMS images output by the twin neural network, It is the ratio of the larger side length to the smaller side length of the two PMS images.

11. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for isolating root causes of failures based on memory spectrum according to any one of claims 1 to 5.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the failure root cause isolation method based on memory spectrum as described in any one of claims 1 to 5.

13. A computer program product, characterized in that It comprises a computer program, which, when executed, is used to implement the failure root cause isolation method based on memory spectrum as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Power transmission line fault positioning method based on power grid operation and maintenance multi-source data

    CN113484664A

  • Multi-defect positioning method, system and equipment based on two-dimensional program spectrum

    CN115185814A