Metamorphic relation identification method and device based on node and path characteristics

By generating control flow diagrams and extracting node and path features using support vector machine models, metamorphic relationships are automatically identified, solving the problem of reliance on manual identification in traditional software testing. This improves the efficiency and automation of metamorphic relationship identification, and addresses the cumbersome process of identification in traditional software testing.

CN120849269APending Publication Date: 2025-10-28HUANENG NUCLEAR ENERGY TECH RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510818857.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

In traditional software testing, identifying metamorphic relationships is a laborious task that relies heavily on the domain knowledge of testers, is difficult to automate, and cannot effectively alleviate Oracle problems.

Method used

By obtaining the source code of multiple objective functions to generate control flow graphs, extracting node and path features, and using support vector machine models to train and identify metamorphic relationships, the reliance on the professional knowledge of testers is reduced.

Benefits of technology

It improves the automation level of metamorphosis testing, reduces reliance on professional knowledge, and increases the efficiency of identifying metamorphosis relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120849269A_ABST
    Figure CN120849269A_ABST
Patent Text Reader

Abstract

The invention provides a metamorphic relation identification method and device based on node and path characteristics, and the method comprises the steps: obtaining a plurality of objective functions which comprise a plurality of first functions with a target metamorphic relation and a plurality of second functions without the target metamorphic relation; analyzing the source code of each objective function to generate a corresponding control flow chart; feature extraction is conducted on the control flow chart to determine node features and path features, and the node features and the path features corresponding to the multiple target functions are combined to serve as training data; performing model training on the initial support vector machine model based on the training data to obtain a target support vector machine model; and based on the target support vector machine model, obtaining a target metamorphic relation identification result of the to-be-tested function. Therefore, the automation degree of the metamorphic test can be effectively improved, the dependence of testers on professional knowledge is greatly reduced, and meanwhile, the identification efficiency of the metamorphic relationship is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of software testing technology, and specifically to a method and apparatus for identifying metamorphic relationships based on node and path features. Background Technology

[0002] Software quality is the most critical step in the application of software. To ensure software quality, software testing is essential. As software grows in size and complexity, testers often struggle to obtain or construct the expected output, leading to the "ORACLE problem." Traditional software testing infers errors by observing whether the expected output matches the actual output, but this fails to mitigate the ORACLE problem. Metamorphic testing, on the other hand, infers problems by repeatedly running the program under test and checking whether its input and output satisfy metamorphic relationships. It doesn't require constructing expected output; if a specific metamorphic relationship is violated, the program is defective. Metamorphic testing effectively alleviates the ORACLE problem and is now widely used in many fields, such as bioinformatics, network simulation, and machine learning.

[0003] In related technologies, the identification of metamorphic relationships is a laborious and difficult task, and it relies on the domain knowledge of the testers. Summary of the Invention

[0004] This disclosure aims to at least partially address one of the technical problems in the related art.

[0005] Therefore, the purpose of this disclosure is to propose a method, apparatus, computer device and storage medium for identifying metamorphic relationships based on node and path features, which can effectively improve the automation level of metamorphic testing, greatly reduce the testers' reliance on professional knowledge, and improve the efficiency of identifying metamorphic relationships.

[0006] To achieve the above objectives, the metamorphic relationship identification method based on node and path features proposed in the first aspect of this disclosure includes:

[0007] Obtain multiple objective functions, wherein the multiple objective functions include: multiple first functions having a target metamorphic relationship, and multiple second functions not having the target metamorphic relationship;

[0008] The source code of each objective function is parsed to generate the corresponding control flow diagram;

[0009] Feature extraction is performed on the control flow graph to determine node features and path features, wherein the node features and path features corresponding to the multiple objective functions are jointly used as training data.

[0010] The initial support vector machine model is trained based on the training data to obtain the target support vector machine model;

[0011] Based on the target support vector machine model, the target transformation relationship identification result of the function to be tested is obtained.

[0012] To achieve the above objectives, the metamorphic relationship identification device based on node and path features proposed in the second aspect of this disclosure includes:

[0013] An acquisition module is used to acquire multiple target functions, wherein the multiple target functions include: multiple first functions having a target transformation relationship, and multiple second functions not having the target transformation relationship;

[0014] The processing module is used to parse the source code of each of the target functions to generate the corresponding control flow diagram;

[0015] The feature extraction module is used to extract features from the control flow graph to determine node features and path features, wherein the node features and path features corresponding to the multiple objective functions are jointly used as training data;

[0016] The training module is used to train the initial support vector machine model based on the training data to obtain the target support vector machine model.

[0017] The identification module is used to obtain the identification results of the target transformation relationship of the function under test based on the target support vector machine model.

[0018] The computer device proposed in the third aspect of this disclosure includes: 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 metamorphic relationship identification method based on node and path features as proposed in the first aspect of this disclosure.

[0019] The fourth aspect of this disclosure provides a non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements a metamorphic relationship identification method based on node and path features as proposed in the first aspect of this disclosure.

[0020] A fifth aspect of this disclosure provides a computer program product in which, when instructions are executed by a processor, a metamorphic relationship identification method based on node and path features as proposed in a first aspect of this disclosure is performed.

[0021] The present disclosure provides a method, apparatus, computer device, and storage medium for identifying metamorphic relationships based on node and path features. This involves acquiring multiple objective functions, including multiple first functions with target metamorphic relationships and multiple second functions without target metamorphic relationships; parsing the source code of each objective function to generate a corresponding control flow diagram; extracting features from the control flow diagram to determine node and path features, wherein the node and path features corresponding to multiple objective functions are jointly used as training data; training an initial support vector machine model based on the training data to obtain a target support vector machine model; and obtaining the target metamorphic relationship identification result of the function under test based on the target support vector machine model. Therefore, this effectively improves the automation level of metamorphic testing, significantly reduces the reliance on testers' professional knowledge, and simultaneously improves the efficiency of metamorphic relationship identification.

[0022] Additional aspects and advantages of this disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this disclosure. Attached Figure Description

[0023] The above and / or additional aspects and advantages of this disclosure will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, in which:

[0024] Figure 1 This is a flowchart illustrating a method for identifying metamorphic relationships based on node and path features, as proposed in an embodiment of this disclosure.

[0025] Figure 2 This is a schematic diagram illustrating the steps of the metamorphic relationship identification method proposed in this disclosure;

[0026] Figure 3 This is a control flow diagram of the summation function proposed in this disclosure;

[0027] Figure 4 This is a control flow diagram of the summation function proposed in this disclosure after labeling;

[0028] Figure 5 This is a schematic diagram of the structure of a metamorphic relationship identification device based on node and path features according to an embodiment of this disclosure;

[0029] Figure 6 A block diagram of an exemplary computer device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation

[0030] Embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are used only to explain this disclosure, and should not be construed as limiting this disclosure. Rather, embodiments of this disclosure include all variations, modifications, and equivalents falling within the spirit and scope of the appended claims.

[0031] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this disclosure are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0032] Figure 1 This is a flowchart illustrating a method for identifying metamorphic relationships based on node and path features, as proposed in an embodiment of this disclosure.

[0033] It should be noted that the execution subject of the metamorphic relationship identification method based on node and path features in this embodiment is a metamorphic relationship identification device based on node and path features. This device can be implemented by software and / or hardware. The device can be configured in a computer device, which may include, but is not limited to, a terminal, a server, etc. For example, the terminal may be a mobile phone, a PDA, etc.

[0034] like Figure 1 As shown, this metamorphic relationship identification method based on node and path features includes:

[0035] S101: Obtain multiple objective functions, including: multiple first functions with objective transformation relationships, and multiple second functions without objective transformation relationships.

[0036] The objective function may refer to the computational function used for model training in this embodiment of the disclosure.

[0037] Here, the metamorphic relationship can refer to the logical constraints between program input and output. The target metamorphic relationship, on the other hand, refers to the metamorphic relationship that needs to be identified in this embodiment. This embodiment does not limit the type of target metamorphic relationship.

[0038] Optionally, in some embodiments, the target metamorphic relation includes any of the following: a permutation relation; an additive relation; a multiplicative relation; a subtractive relation; a containment relation; or a removal relation.

[0039] The first function can refer to a function among multiple objective functions that has an objective transformation relationship.

[0040] The second function can refer to a function among multiple objective functions that does not have an objective transformation relationship.

[0041] In this embodiment of the disclosure, when multiple objective functions are obtained, reliable execution objects can be provided for subsequent acquisition of control flow diagrams.

[0042] S102: Parse the source code of each objective function to generate the corresponding control flow diagram.

[0043] In the control flow graph, the execution path of a program can be represented by a directed graph. Nodes represent basic blocks (a group of continuous statements without branches), and edges represent control flow transfers (such as conditional jumps and loops).

[0044] In this embodiment of the disclosure, when the source code of each objective function is parsed to generate a corresponding control flow diagram, the logical relationship of the objective function can be visualized, which facilitates subsequent feature extraction.

[0045] S103: Perform feature extraction on the control flow graph to determine node features and path features, wherein the node features and path features corresponding to multiple objective functions are jointly used as training data.

[0046] Node characteristics can be used to indicate the attribute characteristics corresponding to nodes in a control flow diagram. These node characteristics can include static characteristics (such as node type, number of operators, number of operands, and variable usage) and dynamic characteristics (such as execution frequency).

[0047] Optionally, in some embodiments, node characteristics include at least one of the following: node in-degree; node out-degree; node complexity.

[0048] Among them, path features can be used to describe the execution path attributes between nodes. For example, they can include: path length, branch coverage, loop depth, and critical path, etc., without any restrictions.

[0049] Optionally, in some embodiments, the path features include at least one of the following: the shortest path from the target node to other nodes; path length; path complexity.

[0050] In this embodiment of the disclosure, when feature extraction is performed on the control flow graph to determine node features and path features, reliable data support can be provided for subsequent model training of the initial support vector machine model.

[0051] S104: Train the initial support vector machine model based on the training data to obtain the target support vector machine model.

[0052] The initial support vector machine model can refer to the support vector machine model that has not been trained in the embodiments of this disclosure.

[0053] The target support vector machine model can refer to the support vector machine model after the initial support vector machine model has been trained.

[0054] Optionally, in some embodiments, when training an initial support vector machine (SVM) model based on training data to obtain a target SVM model, the initial SVM model can be trained based on training data to obtain an intermediate SVM model. Based on the intermediate SVM model, multiple reference recognition results for objective functions are obtained, where the reference recognition results indicate whether the objective function contains a target metamorphic relation. Based on the multiple reference recognition results, the recognition accuracy of the intermediate SVM model for the target metamorphic relation is determined. When the recognition accuracy is greater than or equal to a preset threshold, the intermediate SVM model is used as the target SVM model. Therefore, the recognition accuracy of the intermediate SVM model for the target metamorphic relation can provide a reliable trigger for ending model training, and ensure the reliability and practicality of the obtained target SVM model.

[0055] The intermediate support vector machine model can refer to the support vector machine model obtained after one or more rounds of training from the initial support vector machine model.

[0056] Among them, recognition accuracy can be used to indicate the accuracy of intermediate support vector machine models in recognizing target metamorphic relationships.

[0057] The preset threshold can refer to the threshold value configured in this embodiment for the recognition accuracy of the intermediate support vector machine model for the target metamorphic relationship, and can be used to determine whether the intermediate support vector machine model can meet the expected requirements.

[0058] It is understandable that the recognition effect of the intermediate support vector machine model may not meet the expected requirements. Therefore, in this embodiment of the disclosure, multiple reference recognition results of objective functions can be obtained based on the intermediate support vector machine model. The reference recognition results are used to indicate whether the objective function contains a target metamorphic relationship. Based on the multiple reference recognition results, the recognition accuracy of the intermediate support vector machine model for the target metamorphic relationship is determined. When the recognition accuracy is greater than or equal to a preset threshold, the intermediate support vector machine model is used as the target support vector machine model.

[0059] Optionally, in some embodiments, when the recognition accuracy is less than a preset threshold, the model parameters of the intermediate support vector machine model are optimized to obtain a new intermediate support vector machine model. This allows for timely parameter optimization when the recognition accuracy of the intermediate support vector machine model is low.

[0060] S105: Based on the target support vector machine model, the target transformation relationship identification result of the function to be tested is obtained.

[0061] The function to be tested can refer to the function to be used for target metamorphosis relationship identification in the embodiments of this disclosure.

[0062] Among them, the target metamorphic relationship identification result can be used to indicate whether there is a target metamorphic relationship in the function to be tested.

[0063] In this embodiment of the disclosure, when obtaining the target transformation relationship identification result of the function to be tested based on the target support vector machine model, the node features and path features of the function to be tested can be extracted based on the above steps and input into the target support vector machine model to obtain the corresponding target transformation relationship identification result.

[0064] In this embodiment, multiple objective functions are acquired, including multiple first functions with target metamorphic relationships and multiple second functions without target metamorphic relationships. The source code of each objective function is parsed to generate a corresponding control flow diagram. Feature extraction is performed on the control flow diagram to determine node features and path features, wherein the node features and path features corresponding to multiple objective functions are jointly used as training data. Based on the training data, an initial support vector machine model is trained to obtain a target support vector machine model. Based on the target support vector machine model, the target metamorphic relationship identification result of the function under test is obtained. Therefore, the automation level of metamorphic testing can be effectively improved, the reliance of testers on professional knowledge can be greatly reduced, and the efficiency of metamorphic relationship identification can be improved.

[0065] In summary, as described in the above embodiments, Figure 2 As shown, Figure 2 This is a schematic diagram illustrating the steps of the metamorphic relationship identification method proposed in this disclosure. The steps include:

[0066] Step S1: Analyze the source code of the objective function to generate a control flow graph. Specifically, based on the mapping relationship between node labels, label the generated control flow graph to obtain a labeled control flow graph, and define the node labels.

[0067] Step S2: Extract the node features and path features of the control flow graph. Node features include the in-degree and out-degree of each node, as well as the complexity of the node. Path features include the shortest path from each node to other nodes, as well as the length and complexity of the path.

[0068] Step S3: Train a support vector machine model using the node features and path features. Use the node features and path features as training data, and optimize the model parameters using methods such as cross-validation.

[0069] Step S4: Use the support vector machine model to predict whether a given function contains a specific metamorphic relationship. Input the node features and path features of the function to be tested into the trained support vector machine model, and make a judgment based on the model output.

[0070] This disclosure also provides a metamorphic relationship identification system based on control flow graph node and path features to implement the above method, including:

[0071] The basic form library creation module is used to construct input relations and create the basic form library of input relations;

[0072] The database creation module is used to calculate the output convergence value and create a database to store test cases.

[0073] The output relationship mining module is used to mine output relationships using regression analysis.

[0074] The likelihood metamorphosis relationship verification module is used to verify the likelihood metamorphosis relationships discovered through analysis.

[0075] The metamorphic relationship acquisition module is used to analyze the component coefficients of the mined output relationships to obtain the metamorphic relationships.

[0076] To illustrate in detail and clearly the process of dynamic identification of metamorphic relationships in the Monte Carlo program of this invention, the code of the getSum function is analyzed below as an example, and a control flow diagram and a labeled flowchart are generated.

[0077] Example of the getSum function: calculates the sum of all elements in a one-dimensional array and returns it.

[0078] like Figure 3 and Figure 4 As shown, Figure 3 It is based on the control flow diagram of the summation function proposed in this disclosure. Figure 4 This is the control flow diagram after labeling the summation function proposed in this disclosure. The node label definitions are shown in Table 1.

[0079] Table 1

[0080]

[0081] In this embodiment, substitution, addition, multiplication, subtraction, inclusion, and removal relationships can all be classified as single-line metamorphic relationships as defined herein. Therefore, this invention uses the six metamorphic relationships in Table 1 as the preset metamorphic relationships for this method (i.e., the aforementioned target metamorphic relationships). Metamorphic testing determines whether the program has defects by comparing the output of the source test case with the output of subsequent test cases to see if they satisfy the metamorphic relationship.

[0082] For example, the permutation relationship in Table 1 involves swapping two random elements in the source test case to generate a subsequent test case. If the output of the subsequent test case equals the output of the source test case, the program satisfies the permutation metamorphosis relationship. The addition relationship involves adding a positive number to the source test case to generate a subsequent test case. If the output of the subsequent test case is less than the output of the source test case, the program satisfies the addition metamorphosis relationship. The multiplication relationship involves multiplying the source test case by a positive number to generate a subsequent test case. If the output of the subsequent test case is greater than the output of the source test case, the program satisfies the multiplication metamorphosis relationship. The subtraction relationship involves subtracting a positive number from the source test case to generate a subsequent test case. If the output of the subsequent test case is less than the output of the source test case, the program satisfies the subtraction metamorphosis relationship. The inclusion relationship involves adding one or more elements greater than 0 to the source test case to generate a subsequent test case. If the output of a subsequent test case is greater than the output of the original test case, then the program satisfies the inclusion metamorphosis relation; the removal relation is to remove one or more elements greater than 0 from the original test case and generate a subsequent test case. If the output of the subsequent test case is less than the output of the original test case, then the program satisfies the removal metamorphosis relation.

[0083] In this embodiment of the disclosure, the preset metamorphic relationships are shown in Table 2.

[0084] Table 2

[0085]

[0086] In step S2, node features and path features of the control flow graph are extracted, specifically including: since the quality of features directly affects the classification performance of the support vector machine, the features extracted by the present invention should simultaneously contain the structural information and semantic information of the program.

[0087] To comprehensively showcase the program's hierarchical structure and internal logic, nodes and paths are used as features to preserve the program's logic and hierarchical structure to the greatest extent possible.

[0088] This invention uses the control flow diagram of the getSum function as an example to illustrate the process of obtaining node features. Feature represents the node's characteristics, i.e., op-ent-out. op is the name of the labeled node, ent is the in-degree of the node, and out is the out-degree of the node. Value is the total number of instances of this node in the CFG after labeling. One op-ent-out represents the number of neighboring nodes associated with the current node.

[0089] In this disclosure, the node characteristics calculated from the control flow diagram marked by the getSum function are shown in Table 3:

[0090] Table 3

[0091] Feature Value start-0-1 1 assign-1-1 1 loop-2-2 1 sum-1-1 1 end-1-0 1

[0092] Because the weight of each edge in the control flow graph cannot be determined, for ease of calculation, we assume that the weight of each edge in the control flow graph is equal and equal to 1 before finding the shortest path. Taking the control flow graph of the `getSum` function as an example, we demonstrate the process of extracting path features. A Feature represents a directed path sequence from the current node to other nodes, where the endpoints are nodes in the control flow graph, and the nodes are connected by `->`. Value represents the number of times this path sequence appears in the entire control flow graph.

[0093] In this embodiment of the disclosure, the shortest path features extracted from the control flow graph generated by the getSum function are shown in Table 4:

[0094] Table 4

[0095] Feature Value start->assign 1 start->assign->loop 1 start->assign->loop->sum 1 start->assign->loop->end 1 assign->loop 1 assign->loop->sum 1 assign->loop->end 1 loop->sum 1 loop->end 1

[0096] In step S3, a support vector machine (SVM) model is trained using the node features and path features. In step S4, the SVM model is used to predict whether a given function contains a specific metamorphic relationship. Specifically, in this example, a commonly used C++ function library was selected, and 30 functions were extracted as the subjects of this experiment. The `understand` tool was used to generate control flow graphs for these functions, and the generated control flow graphs were labeled. Features were extracted from the simplified control flow graphs using the method described above. The extracted node features and path features were used as the training set to create a prediction model. Conversely, the path features and node features generated from these 30 functions were also used as the test set to evaluate the model.

[0097] The training set is input into a support vector machine, and the model is trained using PYML to obtain a trained model. Then, the test set is input into the model to evaluate its accuracy. This invention defines a model whose accuracy is below 60% as having poor performance and not meeting the prediction standards of this invention; such a model cannot be used for subsequent prediction and identification of metamorphic relationships.

[0098] The metamorphosis relationship identification method and system provided by this invention can effectively and automatically identify metamorphosis relationships from program code, reduce reliance on testers' domain knowledge, and improve the efficiency of metamorphosis testing.

[0099] Figure 5 This is a schematic diagram of the structure of a metamorphic relationship identification device based on node and path features proposed in an embodiment of this disclosure.

[0100] like Figure 5 As shown, the metamorphic relationship identification device 50 based on node and path features includes:

[0101] The acquisition module 501 is used to acquire multiple objective functions, wherein the multiple objective functions include: multiple first functions with objective transformation relationships, and multiple second functions without objective transformation relationships;

[0102] Processing module 502 is used to parse and process the source code of each objective function to generate the corresponding control flow diagram;

[0103] The feature extraction module 503 is used to extract features from the control flow graph to determine node features and path features, wherein the node features and path features corresponding to multiple objective functions are jointly used as training data.

[0104] Training module 504 is used to train the initial support vector machine model based on training data to obtain the target support vector machine model;

[0105] The identification module 505 is used to obtain the identification result of the target transformation relationship of the function under test based on the target support vector machine model.

[0106] It should be noted that the foregoing explanation of the metamorphic relationship identification method based on node and path features also applies to the metamorphic relationship identification device based on node and path features in this embodiment, and will not be repeated here.

[0107] In this embodiment, multiple objective functions are acquired, including multiple first functions with target metamorphic relationships and multiple second functions without target metamorphic relationships. The source code of each objective function is parsed to generate a corresponding control flow diagram. Feature extraction is performed on the control flow diagram to determine node features and path features, wherein the node features and path features corresponding to multiple objective functions are jointly used as training data. Based on the training data, an initial support vector machine model is trained to obtain a target support vector machine model. Based on the target support vector machine model, the target metamorphic relationship identification result of the function under test is obtained. Therefore, the automation level of metamorphic testing can be effectively improved, the reliance of testers on professional knowledge can be greatly reduced, and the efficiency of metamorphic relationship identification can be improved.

[0108] Figure 6 A block diagram of an exemplary computer device suitable for implementing embodiments of the present disclosure is shown. Figure 6 The computer device 12 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0109] like Figure 6As shown, the computer device 12 is represented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing unit 16).

[0110] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0111] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0112] Memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 6 Not shown; usually referred to as a "hard drive".

[0113] although Figure 6Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disc drive for reading and writing to a removable non-volatile optical disc (e.g., a Compact Disc Read-Only Memory (CD-ROM), a Digital Video Disc Read-Only Memory (DVD-ROM), or other optical media). In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this disclosure.

[0114] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of this disclosure.

[0115] Computer device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable human interaction with the computer device 12, and / or with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0116] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the metamorphic relationship identification method based on node and path features mentioned in the foregoing embodiments.

[0117] To implement the above embodiments, this disclosure also proposes a non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements the metamorphic relationship identification method based on node and path features as proposed in the foregoing embodiments of this disclosure.

[0118] To implement the above embodiments, this disclosure also proposes a computer program product that, when the instruction processor in the computer program product is executed, performs the metamorphic relationship identification method based on node and path features as proposed in the foregoing embodiments of this disclosure.

[0119] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this disclosure all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0120] It should be noted that personal information collected from users should be used for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. Furthermore, such collection / sharing should only be conducted after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization that includes authorization of relevant user information before the user uses the function. In addition, any necessary steps must be taken to protect and safeguard access to such personal information data and ensure that others with access to personal information data comply with their privacy policies and procedures.

[0121] This disclosure is intended to provide implementation schemes for users to selectively prevent the use or access to their personal information data. Specifically, this disclosure is intended to provide hardware and / or software to prevent or block access to such personal information data. Once personal information data is no longer needed, risks can be minimized by restricting data collection and deleting data. Furthermore, where applicable, such personal information is de-identified to protect user privacy.

[0122] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0123] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0124] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain.

[0125] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, 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, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.

[0126] It should be understood that various parts of this disclosure can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0127] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0128] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0129] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present disclosure.

Claims

1. A method for identifying metamorphic relationships based on node and path features, characterized in that, include: Obtain multiple objective functions, wherein the multiple objective functions include: multiple first functions having a target metamorphic relationship, and multiple second functions not having the target metamorphic relationship; The source code of each objective function is parsed to generate the corresponding control flow diagram; Feature extraction is performed on the control flow graph to determine node features and path features, wherein the node features and path features corresponding to the multiple objective functions are jointly used as training data. The initial support vector machine model is trained based on the training data to obtain the target support vector machine model; Based on the target support vector machine model, the target transformation relationship identification result of the function to be tested is obtained.

2. The method as described in claim 1, characterized in that, in, The node features include at least one of the following: Node in-degree; Node out-degree; Node complexity.

3. The method as described in claim 1, characterized in that, in, The path features include at least one of the following: The shortest path from the target node to other nodes; Path length; Path complexity.

4. The method as described in claim 1, characterized in that, in, The target metamorphic relationship includes any of the following: Permutation relationship; Additive relationship; Multiplication relation; Subtraction relationship; Inclusion relationship; Remove the relationship.

5. The method as described in claim 1, characterized in that, in, The step of training the initial support vector machine model based on the training data to obtain the target support vector machine model includes: The initial support vector machine model is trained based on the training data to obtain an intermediate support vector machine model. Based on the intermediate support vector machine model, reference identification results of multiple objective functions are obtained, wherein the reference identification results are used to indicate whether the objective function contains the objective transformation relationship; Based on multiple reference recognition results, the recognition accuracy of the intermediate support vector machine model for the target metamorphic relationship is determined; When the recognition accuracy is greater than or equal to a preset threshold, the intermediate support vector machine model is used as the target support vector machine model.

6. The method as described in claim 5, characterized in that, in, The step of training the initial support vector machine model based on the training data to obtain the target support vector machine model further includes: When the recognition accuracy is less than the preset threshold, the model parameters of the intermediate support vector machine model are optimized to obtain a new intermediate support vector machine model.

7. A device for identifying metamorphic relationships based on node and path features, characterized in that, include: An acquisition module is used to acquire multiple target functions, wherein the multiple target functions include: multiple first functions having a target transformation relationship, and multiple second functions not having the target transformation relationship; The processing module is used to parse the source code of each of the target functions to generate the corresponding control flow diagram; The feature extraction module is used to extract features from the control flow graph to determine node features and path features, wherein the node features and path features corresponding to the multiple objective functions are jointly used as training data; The training module is used to train the initial support vector machine model based on the training data to obtain the target support vector machine model. The identification module is used to obtain the identification results of the target transformation relationship of the function under test based on the target support vector machine model.

8. A computer device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, in, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-6.