Test case recommendation method and device, equipment, storage medium and program product

By building an information network and extracting node sequences for feature extraction and fusion, the problem of poor test case recommendation in the prior art is solved, and more efficient test case recommendation and more comprehensive test coverage are achieved.

CN119690825APending Publication Date: 2025-03-25MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411629541.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art ignores the association between different test cases when recommending test cases, resulting in poor recommendation results in different test scenarios, making it difficult to efficiently and accurately execute test cases for different test scenarios.

Method used

By building an information network, based on the task information of the task to be tested and the test case data of multiple test cases, the node sequence is extracted for feature extraction and fusion, and the recommended test cases corresponding to the task to be tested are determined.

Benefits of technology

It improves the recommendation effect of recommended test cases in different complex scenarios, enhances the coverage of test cases to test tasks, and improves the testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690825A_ABST
    Figure CN119690825A_ABST
Patent Text Reader

Abstract

The invention provides a test case recommendation method and device, equipment, a storage medium and a program product. The method comprises the following steps: constructing an information network based on task information of a to-be-tested task and test case data of a plurality of test cases; extracting a plurality of node sequences from the information network according to a connection relationship between nodes in the information network; performing feature extraction processing on the plurality of node sequences to obtain a plurality of task features and a plurality of test case features; performing fusion processing on the plurality of task features to obtain a first fusion feature of the to-be-tested task, and performing fusion processing on the test case feature of each test case to obtain a second fusion feature of each test case; and based on the association degree between each second fusion feature and the first fusion feature, determining a recommended test case corresponding to the to-be-tested task. By means of the method and device, the recommendation effect of recommending the test cases in different complex scenes can be improved.
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 test case recommendation method, device, equipment, storage medium and program product. Background Art

[0002] In the process of executing the test system functions, as the functions and requirements are iteratively increased, the test cases stored in the test case library do not fully cover the functions of the tasks to be tested, and the test case coverage is insufficient. Related technologies extract and process the requirement documents, recommend test cases for the tasks to be tested from the existing test cases, and ignore the association between different test cases. The recommendation effect in different scenarios is poor, and it is difficult to efficiently and accurately execute the recommended test cases for different test scenarios. Summary of the invention

[0003] The embodiments of the present application provide a test case recommendation method, apparatus, device, storage medium and program product, which can improve the recommendation effect of test cases in different complex scenarios.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present invention provides a test case recommendation method, which includes:

[0006] Building an information network based on the task information of the task to be tested and the test case data of multiple test cases;

[0007] Extracting a plurality of node sequences from the information network according to a connection relationship between nodes in the information network, wherein the information network includes nodes of a task information type and nodes of a test case data type, and the node sequences include nodes of the task information type and nodes of the test case data type having a connection relationship;

[0008] Performing feature extraction processing on the multiple node sequences respectively to obtain multiple task features and multiple test case features;

[0009] Performing fusion processing on the plurality of task features to obtain a first fusion feature of the task to be tested, and performing fusion processing on the test case feature of each of the test cases to obtain a second fusion feature of each of the test cases;

[0010] Based on the degree of association between each of the second fused features and the first fused features, a recommended test case corresponding to the task to be tested is determined.

[0011] The present application provides a test case recommendation device, comprising:

[0012] A network construction module, for constructing an information network based on task information of a task to be tested and test case data of a plurality of test cases;

[0013] A feature extraction module is used to extract multiple node sequences from the information network according to the connection relationship between the nodes in the information network, the information network includes nodes of the task information type and nodes of the test case data type, and the node sequence includes nodes of the task information type and nodes of the test case data type with a connection relationship; perform feature extraction processing on the multiple node sequences respectively to obtain multiple task features and multiple test case features; perform fusion processing on the multiple task features to obtain a first fusion feature of the task to be tested, and perform fusion processing on the test case features of each of the test cases to obtain a second fusion feature of each of the test cases;

[0014] A recommendation module is used to determine a recommended test case corresponding to the task to be tested based on the degree of association between each of the second fusion features and the first fusion features.

[0015] An embodiment of the present application provides an electronic device, the electronic device comprising:

[0016] A memory for storing computer executable instructions or computer programs;

[0017] The processor is used to implement the test case recommendation method provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.

[0018] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the test case recommendation method provided in the embodiment of the present application when executed by a processor.

[0019] An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, the test case recommendation method provided in the embodiment of the present application is implemented.

[0020] The embodiments of the present application have the following beneficial effects:

[0021] By constructing an information network based on the task information to be tested and the test case data of multiple test cases, it is possible to uniformly process different types of data and assist in understanding the semantic association between the task information to be tested and the test cases; according to the connection relationship between the nodes in the information network, feature extraction is performed on the node sequence. Since the information network includes not only nodes of the task information type and nodes of the test case data type, but also the node sequence includes nodes of the task information type and nodes of the test case data type with a connection relationship, the obtained multiple task features and multiple test case features can make the differences between different types of task and test case nodes more obvious, which is helpful to distinguish the differences in functions and construct multiple The feature vector of the dimension can more comprehensively characterize the features of the test tasks and use cases, and then determine the recommended test cases corresponding to the task to be tested based on the degree of correlation between the first fusion feature obtained by fusing multiple task features and the second fusion feature obtained by fusing test case features. Since the degree of correlation is reflected in the similarity of structure and function between tasks and test cases in the information network, the test cases with higher adaptability to the test tasks can be determined based on the degree of correlation, so that the test cases used in the task to be tested are more in line with the requirements of the task to be tested, thereby improving the recommendation effect of the recommended test cases, thereby improving the code coverage of the application program in the task to be tested and improving the testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a schematic diagram of the application mode of the test case recommendation method provided in the embodiment of the present application;

[0023] Figure 2 It is a schematic diagram of the structure of the server provided in the embodiment of the present application;

[0024] Figure 3A This is a first flow chart of the test case recommendation method provided in an embodiment of the present application;

[0025] Figure 3B It is a second flow chart of the test case recommendation method provided in an embodiment of the present application;

[0026] Figure 3C It is a third flow chart of the test case recommendation method provided in the embodiment of the present application;

[0027] Figure 4 It is a schematic diagram of the principle of the test case recommendation method provided in the embodiment of the present application;

[0028] Figure 5 This is a fourth flow chart of the test case recommendation method provided in an embodiment of the present application;

[0029] Figure 6 is a schematic diagram of a heterogeneous information network structure provided by an embodiment of the present application;

[0030] Figure 7 This is the fifth flow chart of the test case recommendation method provided in the embodiment of the present application.

[0031] It should be pointed out that the above-mentioned "first" and "second" are only used to distinguish different solutions, and do not represent the degree of superiority or inferiority of the solutions or the priority in the implementation process. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0033] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0034] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0035] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0036] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0037] The relevant data collection and processing (for example, data of test cases and tasks to be tested) in the embodiments of this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained, and subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.

[0038] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0039] 1) Heterogeneous Information Network (HIN): A network model used to represent and process different types of entities and relationships, represented by a directed graph. In the embodiments of the present application, the heterogeneous information network is used to represent entities such as projects, requirements, functions, test cases, and the connection relationships between entity nodes.

[0040] 2) Meta-path: It refers to an ordered set of relationships between entities in a heterogeneous information network, reflecting the deep semantic association between entities. The meta-path includes multiple entity nodes. The meta-path carries information about entity types and relationship types. In the embodiment of the present application, the meta-path is a path formed by connecting different types of nodes in the task information to be tested and the test case data. It is a path defined in the network model, for example: Represents the relationship between a node A1 and a node A2, R = R1οR2οR n , ο represents the coincidence operator between relations, A n Represents the node type, R n Represents the relationship type. The types of meta-paths include: task-to-be-tested-use-case meta-path, task-to-be-tested-task meta-path, and use-case-use-case meta-path.

[0041] 3) Network Embedding: It is a method of using vectors to represent network structure and node attributes, while maintaining the topological structure and relationship information between nodes in the original network. The goal is to use a low-dimensional dense vector to represent any node in the network. In the embodiment of the present application, network embedding can reveal the relationship and similarity between nodes by learning the vector representation of nodes.

[0042] 4) Random walk mode: It is a specific type of random traversal process in a heterogeneous information network, which guides the random walk process according to a predefined meta-path. In each step, the next node is not randomly selected, but selectively jumped according to the node type and relationship type defined in the meta-path, thereby generating a random walk sequence in the heterogeneous information network. In the embodiment of the present application, the walk is described as a traversal of the node.

[0043] 5) Skip-gram: It is an algorithm for processing word embeddings, which can map each word in the vocabulary to a vector of a fixed size to capture the semantic information of the word. The main purpose of the skip-gram model is to predict the words in the context through known words.

[0044] 6) Normalized exponential function (softmax): It is the logarithmic normalization of the gradient of a finite discrete probability distribution, which is used to compress a K-dimensional vector containing arbitrary real numbers into another K-dimensional real vector, where each element ranges between (0, 1) and the sum of the elements in the compressed vector is 1.

[0045] In the related technology, the requirement documents are extracted and processed, and use cases for the tasks to be tested are recommended from the existing test cases, while the associations between different test cases are ignored. As the functions and requirements are iteratively increased, the test cases do not fully cover the functions of the tasks to be tested, and the accuracy and efficiency of the recommended test case coverage are low.

[0046] Embodiments of the present application provide a test case recommendation method, a test case recommendation device, an electronic device, a computer-readable storage medium, and a computer program product to improve the coverage of recommended test cases in different complex scenarios.

[0047] The following describes an exemplary application of the electronic device provided in the embodiments of the present application. The device provided in the embodiments of the present application can be implemented as various types of terminals such as a laptop computer, a tablet computer, a desktop computer, a set-top box, a smart phone, a smart speaker, a smart watch, a smart TV, and a vehicle-mounted terminal, and can also be implemented as a server. The following describes an exemplary application when the device is implemented as a terminal or a server.

[0048] See also Figure 1 , Figure 1 This is a schematic diagram of the application mode of the test case recommendation method provided in the embodiment of the present application, which is an example of supporting a test case recommendation application. Figure 1 The system involves a server 200, a network 300, a terminal device 400 and a database 500. The terminal device 400 is connected to the server 200 via the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0049] In some embodiments, the user is a tester, the server 200 is a server that executes the test case recommendation method, the terminal device 400 can be the tester's computer or mobile phone, the terminal device 400 is used to send the task information to be tested and the test case data, and the database 500 stores the constructed heterogeneous information network, the task information to be tested and the test case data.

[0050] For example, the terminal device 400 is used to send information about tasks to be tested and test case data. The server 200 executes a test case recommendation method based on the data sent by the terminal device 400, and stores the heterogeneous information network, information about tasks to be tested and test case data constructed during the execution process in the database 500. After the server 200 determines the test case that needs to be recommended, it feeds back the recommended test case corresponding to the task to be tested to the terminal device 400 through the network 300, and the test task can be executed in the terminal device 400 by recommending the test case.

[0051] In some embodiments, the test case recommendation method of the embodiment of the present application can also be applied in the following application scenarios: recommending test cases for tasks to be tested in different scenarios, for example: the interface in a certain test scenario includes multiple functional modules corresponding to the tasks to be tested. As the test requirements will increase iteratively, the number of test cases for the application to be tested will also gradually increase, resulting in incomplete coverage of the functions of the tasks to be tested by the test cases stored in the test case library, and insufficient coverage of the test cases. The test case recommendation method of the embodiment of the present application can construct a heterogeneous information network based on the information of the tasks to be tested and the test case data, uniformly process heterogeneous data, and assist in understanding the semantic association between the tasks to be tested and the test cases. According to the connection relationship of the nodes in the heterogeneous information network, feature extraction is performed on the node sequence, the extracted features are fused and the degree of association is calculated, and the recommended test cases corresponding to the tasks to be tested are determined according to the degree of association, so as to improve the coverage of the recommended test cases.

[0052] The embodiments of the present application can be implemented through database technology. In short, a database can be regarded as an electronic file cabinet where electronic files are stored. Users can add, query, update, delete, etc. data in the files. The so-called "database" is a collection of data that is stored together in a certain way, can be shared with multiple users, has as little redundancy as possible, and is independent of the application program.

[0053] Database Management System (DBMS) is a large-scale software for manipulating and managing databases. It is used to establish, use and maintain databases. Databases are managed and controlled in a unified manner to ensure the security and integrity of the database. Users access data in the database through the database management system, and database administrators also maintain the database through the database management system. It can support multiple applications and users to establish, modify and query the database in different ways at the same time or at different times. It provides data definition language and data manipulation language for users to define the database model structure and permission constraints, and implement operations such as appending and deleting data.

[0054] The embodiments of the present application can also be implemented through cloud computing, which is a type of distributed computing that decomposes a huge data computing program into countless small programs through the network "cloud", and then processes and analyzes these small programs through a system composed of multiple servers to obtain results and return them to users. Cloud computing is a system with extremely high computing power formed by a computer network, which can store and aggregate related resources and can be configured on demand to provide personalized services to users.

[0055] The embodiments of the present application can also be implemented through artificial intelligence (AI), which is a discipline that studies the use of computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), mainly including the principles of computer-implemented intelligence, manufacturing computers similar to human brain intelligence, and enabling computers to achieve higher-level applications. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence, so that the machine has the functions of perception, reasoning and decision-making. Natural language processing is a branch of the field of artificial intelligence, which combines the knowledge of computer science, artificial intelligence and linguistics, and is committed to enabling computers to understand and process human language. Natural language processing involves enabling computer programs to understand, interpret, generate and respond to human natural language texts, including but not limited to applications such as text analysis, machine translation, sentiment analysis, speech recognition and question-answering systems.

[0056] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0057] See also Figure 2 , Figure 2 is a schematic diagram of the structure of the server provided in the embodiment of the present application, Figure 2 The server 200 shown includes: at least one processor 410, a memory 450 and at least one network interface 420. The various components in the server 200 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 2 Various buses are labeled as bus system 440 .

[0058] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0059] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0060] The memory 450 includes a volatile memory or a nonvolatile memory, and may also include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0061] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0062] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0063] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless Authentication (WiFi), and Universal Serial Bus (USB).

[0064] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2 The test case recommendation method device 455 stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: a network construction module 4551, a feature extraction module 4552 and a recommendation module 4553. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.

[0065] In some embodiments, the terminal or server can implement the test case recommendation method provided by the embodiment of the present application by running various computer executable instructions or computer programs. For example, computer executable instructions can be commands, machine instructions or software instructions at the microprogram level. The computer program can be a native program or software module in the operating system; it can be a local (Native) application (APPlication, APP); it can also be a small program that can be embedded in any APP, that is, a program that can be run only by downloading it to a browser environment. In short, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.

[0066] The test case recommendation method provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the electronic device provided in the embodiment of the present application.

[0067] The following describes the test case recommendation method provided by the embodiment of the present application. As mentioned above, the electronic device that implements the test case recommendation method of the embodiment of the present application may be a server. Therefore, the execution subject of each step will not be repeatedly described below.

[0068] See also Figure 3A , Figure 3A This is a first flow chart of the test case recommendation method provided in the embodiment of the present application, which will be combined with Figure 3A The steps shown are explained.

[0069] In step 301, an information network is constructed based on task information of a task to be tested and test case data of a plurality of test cases.

[0070] For example, in the scenario of executing test case recommendation, the existing test case data in the case library is obtained, the test task information to be tested and the test case data of multiple test cases are extracted, and based on the obtained multiple different types of task information to be tested and the test case data of multiple test cases, an information network is constructed. The information network can be a heterogeneous information network, which is a network model for representing and processing different types of entities and relationships, represented by a directed graph. In the embodiment of the present application, the heterogeneous information network is used to represent the connection relationship between entities such as projects, requirements, functions, test cases, and entity nodes.

[0071] In an embodiment of the present application, the task information to be tested may be the interface information of the system to be tested, and the interface may be the functional area to be tested or the business logic to be tested, for example: the system to be tested involves multiple functional interfaces, each functional interface corresponding to a different function. The functional area to be tested is a specific functional module that needs to be tested in a software application, which is divided into different test ranges according to the business requirements of the application and user operations. The business logic to be tested is the business rules and processes that need to be verified in the software application, including: the functions most frequently used by users, the most complex operations and workflows in the system.

[0072] For example, the test case recommendation method provided in the embodiment of the present application can construct an information network based on the information of one functional interface, or can construct an information network based on the information of multiple functional interfaces, and can be applied to test scenarios of multiple functional interfaces.

[0073] Here, the task information to be tested includes: interface content, interface function and interface type. Interface content refers to all content information such as text, images, buttons, forms, etc. displayed on the interface. Interface function refers to the function of function buttons or forms. Interface types include: User Interface (UI), Command Line Interface (CLI) and Graphical User Interface (GUI). The user interface allows users to input commands and data and receive feedback and output from the computer system. The command line interface is a text user interface in which users interact with the computer system by entering commands and parameters in the command line. The command line interface is usually used for technical users and automated script writing. The graphical user interface is the way users interact with computer systems. The graphical user interface interacts through graphical elements and intuitive operations.

[0074] The test case data of a test case includes: the input parameter information, verification information and importance of the test case. The input parameter information refers to the test case input data type, data range, data format, quantity and data source. The verification information refers to the verification rules, expected results and actual results of the test case. The importance refers to the relative importance and priority of the test case in the test process. The priority can be set to high, medium or low according to the application scenario.

[0075] For example: the task to be tested is the user login interface of a software system to be tested. The task information to be tested includes the user login text and the input box icon. The interface function is user login. The type of the current interface is the user interface. The input information of the test case is the user name and password entered by the user. The verification information is to verify whether the user name and password data are correct. The priority of importance is high.

[0076] In some embodiments, step 301 may be implemented by the following method: characterizing the task information to be tested and the test case data as multiple nodes; and connecting the multiple nodes into a heterogeneous information network according to the mapping relationship corresponding to the task information to be tested and the test case data.

[0077] For example, the task information to be tested and the test case data contain multiple entities of different types, and each node represents a specific entity (for example: test case input, test case, interface, interface function and interface type). The mapping relationship corresponding to the task information to be tested is that the task information to be tested contains certain functions, contains certain interface content or belongs to a certain interface type, and the mapping relationship corresponding to the test case data is that the test case data belongs to a certain interface, the test case contains a certain case input, verification information, and the importance priority of the test case.

[0078] The edges between nodes represent the mapping relationship between entities. By connecting multiple nodes, the tasks to be tested and test cases are converted into specific and analyzable heterogeneous information networks. The heterogeneous information network contains many different types of objects and various types of connection relationships, which are represented by directed graphs. In the embodiment of the present application, the heterogeneous information network is used to represent the connection relationship between the interface node and the test case node.

[0079] See also Figure 6 , Figure 6 is a schematic diagram of a heterogeneous information network structure provided by an embodiment of the present application; Figure 6 A simple heterogeneous information network structure is shown in Figure 1, which includes five different types of entities in the tasks to be tested and the test cases, namely five types of nodes, including: use case input, use case, interface, interface function and type. The heterogeneous information network includes at least one of the following connection relationships: interface-use case, use case-interface, interface function-interface, interface-interface function, use case input-use case, use case-use case input, interface-interface type, interface type-interface.

[0080] For example: for a use case (A), an interface (U), a function (F), an interface type (T), and a use case input parameter (R), the connection relationship between the interface and the use case can represent that a certain interface (U) contains the use case (A).

[0081] In an embodiment of the present application, test case data in the task scenario to be tested is obtained, different types of information of the tasks and cases to be tested are extracted, and a heterogeneous information network is constructed by connecting different data nodes. It is possible to integrate a variety of different types of heterogeneous information, and the heterogeneous information is processed uniformly. The structure and deep semantic relationship between different types of data are represented by the nodes and edges in the heterogeneous information network.

[0082] In step 302, a plurality of node sequences are extracted from the information network according to the connection relationship between the nodes in the information network.

[0083] Here, the information network includes nodes of the task information type and nodes of the test case data type, and the node sequence includes nodes of the task information type and nodes of the test case data type having a connection relationship.

[0084] For example, the information network contains multiple nodes corresponding to the task information to be tested and the test case data, the edges between the nodes represent the connection relationship between the entities corresponding to the nodes, and the multiple connected nodes constitute a meta-path in the information network. Based on the specific meta-path, the node sequence corresponding to the multiple nodes is obtained by traversing. The meta-path is a path composed of different types of nodes in the use case and the interface. In the embodiment of the present application, the meta-path includes: use case-interface meta-path, use case-use case meta-path and interface-interface meta-path.

[0085] In some embodiments, see Figure 3B , Figure 3B It is a second flow chart of the test case recommendation method provided in an embodiment of the present application; Figure 3A Step 302 in can be Figure 3B Steps 3021 to 3022 in are implemented as described in detail below.

[0086] In step 3021, multiple meta-paths in the information network are determined based on the connection relationship between the node types in the information network, and each meta-path includes multiple types of nodes.

[0087] For example, different types of connection relationships exist between nodes in an information network. A combination of node types and edge types is constructed according to the task to be tested, and a meta-path is defined based on the combination. Each meta-path includes multiple nodes and edges between the nodes.

[0088] In step 3022, based on the connection relationship, the node sequence corresponding to each meta-path is determined to obtain multiple node sequences.

[0089] For example, the nodes in each meta-path are traversed by random walk. The random walk is a specific type of random process in the information network. The random walk process is guided according to the predefined meta-path, and selectively jumps according to the node type and relationship type defined in the meta-path to determine the node sequence corresponding to multiple nodes.

[0090] In some embodiments, step 3022 can be implemented by the following method: select a first node from the meta-path, where the first node is any node in the meta-path; based on the connection relationship, select multiple second nodes that have an association relationship with the first node from the meta-path, where the second node is a node that is directly or indirectly connected to the first node; and combine the first node and the second node into a node sequence corresponding to the meta-path according to the selection order.

[0091] For example, the nodes in each meta-path are traversed based on a random walk method, and a node is arbitrarily selected from the meta-path as the first node. Based on the connection relationship between the nodes, multiple second nodes that have an association relationship with the first node are selected, and the association relationship is that there is a direct or indirect connection between the first node and the second node. The first node and the second node are combined into a node sequence corresponding to the meta-path according to the order of selection.

[0092] In some embodiments, selecting multiple second nodes that have an association relationship with a first node from a meta-path based on a connection relationship can be achieved in the following manner: determining at least one fourth node that has a connection relationship with a third node in the meta-path; determining a first probability for each fourth node to be selected, and determining a target node from at least one fourth node based on the first probability; when the number of selected target nodes is less than a preset threshold, executing the step of determining at least one fourth node that has a connection relationship with the third node in the meta-path; wherein, when the target node is selected for the first time, the third node is the first node, and when the target node is not selected for the first time, the third node is the target node selected last time; when the number of selected target nodes is greater than or equal to the preset threshold, the selected multiple target nodes are used as multiple second nodes.

[0093] For example, at least one fourth node in the meta-path that is connected to the third node is determined, a first probability of each fourth node being selected is calculated, a target node is determined from at least one fourth node based on the first probability, and when the number of selected target nodes is less than a preset threshold, the fourth node continues to be selected, and when the target node is selected for the first time, the third node is the first node, and when it is not the first time the target node is selected, the third node is the target node selected last time; when the number of selected target nodes is greater than or equal to a preset threshold, the multiple selected target nodes are used as multiple second nodes, and the first node and the multiple second nodes are combined according to the selection order to obtain multiple node sequences of the meta-path.

[0094] For example, selecting multiple second nodes associated with the first node from the meta-path based on the connection relationship can be implemented by formula (1), which is described in detail below.

[0095]

[0096] in, Predefined metapath P = (A0, A1, A2, ..., A n ), A n Indicates the node type, n indicates the number of nodes, |{p x~y :p x~y ∈P}| represents the number of path instances from node x to node y under the guidance of meta-path P, |{p x~x :p x~x ∈P}| represents the number of path instances starting from node x and returning to node x under the guidance of meta-path P, |{p y~y :p y~y ∈P}| represents the number of path instances starting from node y and returning to node y under the guidance of meta-path P, The result is the first probability mentioned above.

[0097] The meaning of the above formula (1) is based on the paradigm of meta-path random walk. If walking under the guidance of a given meta-path, the transition probability is the ratio of 1 to the number of neighbors of the specified type of node. If walking without following the guidance of the meta-path, the transition probability is 0.

[0098] By executing the traversal formula (1), the first probability of the next node (second node) being selected under the guidance of the predefined meta-path is calculated, and the sequence of each node is determined. represents the first probability of each node being traversed under the guidance of the meta-path P, Indicates that at the i-th step, the node of type t, v i+1 represents the node of type t+1 at step i+1, Represents the neighbors of node v, and the node type of these neighbors is t+1.

[0099] The node sequence can be represented as {(B1, P1), (B2, P2)...(B n , P n )}. Among them, B n is the node information of the nth node, P n is the probability that the nth node is visited, where n is a positive integer.

[0100] In an embodiment of the present application, based on the connection relationship between nodes in the information network, the probability of the next node guided in a given meta-path being traversed is calculated, and multiple node sequences are determined based on the order of traversing nodes. The meta-path can characterize the deep structure and relationship in the information network. The random walk based on the meta-path can visit multiple nodes, collect node information, and generate a richer and multi-dimensional representation for each node, thereby reducing unnecessary node visits and improving algorithm efficiency.

[0101] Continue to see Figure 3A In step 303, feature extraction processing is performed on multiple node sequences respectively to obtain multiple task features and multiple test case features.

[0102] For example, after determining multiple node sequences, a feature extraction model is called to extract features from each node in the multiple node sequences to obtain features corresponding to multiple different types of nodes in the task to be tested and the test case.

[0103] In some embodiments, step 303 can be implemented by the following method: extracting features from the nodes included in each node sequence to obtain a feature set corresponding to each node sequence, wherein the node sequence includes nodes of task information type and nodes of test case data type; classifying the features in the feature set according to the type of each node to obtain multiple test case features and multiple task features, wherein the test case features are features corresponding to nodes of test case data type, and the task features are features corresponding to nodes of task information type.

[0104] For example, a feature extraction model is called to extract features from each node to obtain a feature set corresponding to each node sequence. Each node learns network embedding through the feature extraction model. The network embedding uses a vector to represent the network structure and node attributes, while maintaining the topological structure and relationship information between nodes in the original heterogeneous information network. The node sequence includes nodes of task information type and nodes of test case data type. In an embodiment of the present application, network embedding represents the relationship and similarity between nodes by learning the vector representation of the node. The feature extraction model can be a word skipping model, which is an algorithm for processing word embeddings and can map each node information to a vector of a fixed size. The features in the feature set are classified according to the type of each node to obtain multiple test case features and multiple task features. The test case feature is the feature corresponding to the node of the test case data type, and the task feature is the feature corresponding to the node of the task information type.

[0105] In some embodiments, before performing feature extraction on the nodes included in each node sequence to obtain the feature set corresponding to each node sequence, the feature extraction model is trained by the following method: determining the first weight parameter to be updated in the initialized feature extraction model; determining the second weight parameter that maximizes the value of the normalization function based on sample task characteristics, sample use case characteristics, and weight parameter variables of the feature extraction model; updating the first weight parameter with the second weight parameter to obtain an updated feature extraction model.

[0106] For example, the first weight parameter to be updated in the initialized feature extraction model is determined, and the first weight parameter to be updated is associated with a normalization function. The normalization function is the training target of the feature extraction model, and the normalization function is a maximization probability function. The model is trained based on the sample task features and the sample case features based on the maximization probability function. The second weight parameter that maximizes the normalization function value is determined, and the parameters in the feature extraction model are adjusted based on the target weight parameter. The first weight parameter is updated with the second weight parameter that optimizes the model performance to obtain the trained feature extraction model.

[0107] In some embodiments, determining the first weight parameter that maximizes the normalized function value can be implemented by formula (2), which is described in detail below.

[0108]

[0109] Among them, logp(C t |V;θ) is the normalization function, is the sum of multiple normalization functions, θ represents the target weight parameter of the normalization function, v represents the specific feature embedding vector, V represents the feature embedding vector set, t is the node type, T v Represents a node type set containing all node types, C t represents the neighbor vector, N t (V) indicates that node v is a neighbor of the t-th type node. Characterize and determine the normalization function The first weight parameter θ with the largest value.

[0110] The normalization function (softmax) is used to convert the output of the feature extraction model into a probability distribution, represented by logp(C t |V;θ), that is Among them, u represents the interface node, X represents the vector matrix of the node, and X V is the vth row in the X matrix, representing the embedding vector feature of node v.

[0111] In the embodiment of the present application, the feature extraction model is called to extract features from each node in the node sequence, and the network embedding is learned based on the word skipping model, and the nodes are represented as higher-dimensional feature vectors to determine the implicit structure and multi-level relationship between the nodes. By determining the target weight parameter that maximizes the associated normalized function value, the word skipping model is trained, the target weight parameter is optimized, and the performance and efficiency of the feature extraction model are improved.

[0112] Continue to see Figure 3A In step 304, a plurality of task features are fused to obtain a first fused feature of the task to be tested, and a test case feature of each test case is fused to obtain a second fused feature of each test case.

[0113] For example, the features of each task node to be tested and the features of each use case node under different meta-paths are fused through a fusion function to obtain a first fused feature after the fusion of multiple features of the task nodes to be tested and a second fused feature of each test case after the fusion of multiple features of the test case nodes.

[0114] In some embodiments, see Figure 3C , Figure 3C It is a third flow chart of the test case recommendation method provided in the embodiment of the present application; Figure 3A Step 304 in can be Figure 3C Steps 3041 to 3044 in are implemented as described in detail below.

[0115] In step 3041, for each meta-path in the information network, the task features of the task to be tested in the meta-path are aggregated to obtain the first sub-fusion features of the task to be tested in different meta-paths.

[0116] For example, for each meta-path in the information network, the meta-path contains multiple nodes corresponding to the tasks to be tested, and the features of the nodes of the tasks to be tested in different meta-paths are aggregated to obtain the first sub-fusion feature of the tasks to be tested. The first sub-fusion feature can be represented as in, represents the preference weight of node u for the sth meta-path in the task to be tested, M (s) and b (s) They represent the transformation matrix and bias vector under the s-th original path respectively.

[0117] In step 3042, a plurality of first sub-fusion features are combined into a first fusion feature of the task to be tested.

[0118] For example, a fusion function is called to combine multiple first sub-fusion features in each task to be tested to obtain a first fusion feature of the task to be tested.

[0119] In some embodiments, calling the fusion function to combine multiple first sub-fusion features in each task to be tested can be implemented by formula (3), which is described in detail below.

[0120]

[0121] in, represents the first fusion feature of the interface u corresponding to the task to be tested, represents the fusion function of the embedding vector, and s represents the s-th element path.

[0122] In some embodiments, a fusion function is used to fuse the feature vector embeddings (multiple first sub-fusion features) of the interface corresponding to the task to be tested under different meta-paths together to obtain a first fusion feature, which can be achieved by formula (4), as described in detail below.

[0123]

[0124] In step 3043, for each test case, the test case features of the test case in each meta-path are aggregated to obtain the second sub-fusion features of the test case in different meta-paths.

[0125] For example, each meta-path contains nodes corresponding to multiple test cases. For each test case, the features of the nodes in different meta-paths are aggregated to obtain the second sub-fusion feature of the test case. The second sub-fusion feature can be represented as in, represents the preference weight of node i for the sth meta-path in the test case, M (s) and b (s) They represent the transformation matrix and bias vector under the s-th original path respectively.

[0126] In step 3044, for each test case, multiple second sub-fusion features of the test case are combined to obtain a second fusion feature of each test case.

[0127] For example, the fusion function is called to combine multiple second sub-fusion features in each test case to obtain the second fusion feature of the test case.

[0128] In some embodiments, calling the fusion function to combine multiple second sub-fusion features in each test case can be implemented by formula (3), which is described in detail below.

[0129]

[0130] in, represents the second fused feature of test case i, represents the fusion function of the embedding vector, and s represents the s-th element path.

[0131] In some embodiments, a fusion function is used to fuse the feature vector embeddings (multiple second sub-fusion features) of each test node under different meta-paths together to obtain a second fusion feature, which can be achieved by formula (5), as described in detail below.

[0132]

[0133] Among them, |P| represents the number of sets of meta-paths, represents the preference weight of use case i for the sth meta-path, M (s) and b (s) They represent the transformation matrix and bias vector under the s-th original path respectively.

[0134] In an embodiment of the present application, the features of the task to be tested and the test case are fused based on a fusion function, and the obtained first fusion feature and the second fusion feature integrate the information of multiple node sequences, providing more comprehensive node information for the task to be tested, which can be applied to a variety of tasks to be tested in different scenarios and support a variety of heterogeneous information network analysis tasks.

[0135] Continue to see Figure 3AIn step 305, based on the correlation degree between each second fusion feature and the first fusion feature, a recommended test case corresponding to the task to be tested is determined.

[0136] For example, the association function is called to calculate the degree of association between each second fusion feature and the first fusion feature. When the calculated degree of association is greater than a preset recommendation preference threshold, the corresponding test case is determined to be a recommended test case corresponding to the task to be tested.

[0137] In some embodiments, step 305 can be implemented in the following manner: based on the preset coefficients corresponding to each second fusion feature and the first fusion feature respectively, determine the degree of association between each second fusion feature and the first fusion feature; select the test case corresponding to the second fusion feature whose degree of association is greater than the preset degree threshold, and use the selected test case as the recommended test case corresponding to the task to be tested.

[0138] For example, a linear addition method is used to integrate the fusion features of the task to be tested and the fusion features of the use case into a preconfigured correlation function, calculate the degree of correlation, pre-set a degree threshold according to the task to be tested, and select the test case corresponding to the second fusion feature with a correlation degree greater than the preset degree threshold as the recommended test case corresponding to the task to be tested. The preset degree threshold can be set according to the application scenario.

[0139] In some embodiments, the preconfigured association function may be implemented by formula (6), which is described in detail below.

[0140]

[0141] in, Indicates the degree of association between the interface u corresponding to the task to be tested and the test case i, represents the implicit vector of the interface u corresponding to the task to be tested, Y i represents the implicit vector of test case i, and They represent the embedding of u and i based on heterogeneous information networks respectively. α and β are adjustable parameters to prevent overfitting of the function.

[0142] For example, the preset degree threshold is 0.8, which indicates that test cases with a correlation degree greater than 0.8 with the task to be tested should be recommended. When the correlation degree between the task to be tested and a test case calculated based on the preconfigured correlation function is greater than 0.8, the test case is a test case with a high correlation degree with the task to be tested and can be used as a test case for the task to be tested. If the calculated correlation degree is less than 0.8, it is considered that the correlation degree between the test case and the task to be tested is not high and the test case is not recommended.

[0143] In some embodiments, multiple test cases with the highest degree of correlation may also be selected as recommended test cases for the task to be tested, and the number of selected test cases may be determined according to the test requirements in the application scenario.

[0144] In the embodiment of the present application, different types of information of the tasks to be tested and use cases in the task scenario to be tested are extracted, an information network is constructed, and heterogeneous information is uniformly processed, and the structure and deep semantic relationship between different types of data are represented by the nodes and edges in the information network. According to the connection relationship between the nodes, multiple node sequences are determined, and a richer and multidimensional representation is generated for each node. The pre-configured meta-path can reduce unnecessary node access. The feature extraction model is called for feature extraction, and the nodes are represented as feature vectors of higher dimensions, and the target weight parameter that maximizes the associated normalized function value is determined, and the word skipping model is trained, and the target weight parameter is optimized to improve the performance and efficiency of the feature extraction model. Based on the fusion function, the features of the tasks to be tested and the test cases are fused, and the information of multiple node sequences is integrated in the fusion features, which can be applied to a variety of tasks to be tested in different scenarios, and supports diversified heterogeneous information network analysis tasks. The degree of association between the fusion features is calculated, and the recommended test cases corresponding to the tasks to be tested are determined, and the applicability of the test cases is more comprehensively evaluated, and the efficiency and coverage of the recommended test cases are improved.

[0145] Below, an exemplary application of the test case recommendation method provided in an embodiment of the present application in an actual application scenario will be described.

[0146] Test cases are the most important part of software testing, and are used to measure the coverage of software requirements and code paths during software testing. With the continuous iteration of test system functions, a large number of test cases are stored in the test case library. Testers write test cases based on their own experience and understanding of project functions, which relies on testers' code knowledge and experience, increasing the risk of human errors. With the continuous iteration and update of business and requirements, the complexity of recommended test cases in different scenarios varies, resulting in incomplete coverage of written test cases when testers are insufficient in ability or do not understand the functions to be tested.

[0147] Related technologies for recommending test cases usually utilize requirement documents or technical documents, extract text from the requirement documents or technical documents based on natural language processing, and match the keywords therein. This requires a large amount of test case data for training, and recommends test cases for the requirements to be tested from the existing test cases, which increases the training cost and time cost. It ignores whether there is a correlation between different test cases, and is unable to efficiently and accurately recommend test cases with high coverage for the tasks to be tested.

[0148] In order to more clearly describe the recommendation process performed by the test case recommendation method provided in the embodiment of the present application, see Figure 4 , Figure 4 This is a schematic diagram of the principle of the test case recommendation method provided in the embodiment of the present application. Figure 4 Provide detailed explanation.

[0149] In the scenario of executing test case recommendation, in step 401, test case data is obtained.

[0150] In step 402, processing is performed on the test case data.

[0151] For example, the task information to be tested and the use case information in the test case data are extracted to obtain a plurality of different types of task information to be tested and use case information.

[0152] In step 403, a heterogeneous information network is constructed.

[0153] For example, according to the various types of to-be-tested task information and use case information processed in step 402 , a corresponding heterogeneous information network is constructed.

[0154] In step 404, a sequence of nodes is obtained.

[0155] For example, after the heterogeneous information network is constructed, multiple meta-paths in the heterogeneous information network are determined, and the sequence of each node in different meta-paths is obtained.

[0156] In step 405, the embedding of each node is obtained.

[0157] For example, after determining the sequence of each node in the meta-path, feature extraction processing is performed on each node to obtain the embedded features of each node.

[0158] In step 406, the embeddings are fused.

[0159] For example, the embedded features of the extracted nodes are fused to obtain fused embedded features corresponding to the task to be tested and the use case.

[0160] In step 407, test cases are recommended.

[0161] For example, based on the fused embedded features corresponding to the task to be tested and the use case obtained by fusion, the association relationship between the task to be tested and the use case is calculated, and the recommended test case is determined based on the association relationship.

[0162] According to the above principles, the embodiment of the present application provides a test case recommendation method, which extracts test case data, constructs a heterogeneous information network based on the extracted use case information and the task information to be tested, and uniformly processes different types of heterogeneous information. According to different meta-paths in the heterogeneous information network, the fusion features of the task to be tested and the fusion features of the use case are extracted and determined, and the degree of correlation between the fusion features is calculated to efficiently and accurately recommend test cases for the task to be tested.

[0163] The following is a description with reference to the accompanying drawings. Figure 5 , Figure 5 4 is a schematic diagram of a fourth flow chart of a test case recommendation method provided in an embodiment of the present application. The execution subject may be a terminal device, a server, or a combination of the two. In the embodiment of the present application, the server is used as the execution subject as an example. Figure 5 The steps shown are explained in detail.

[0164] In step 501, a heterogeneous information network is constructed based on the use case information and the task information to be tested extracted from the test case data.

[0165] For example, in the scenario of executing test case recommendations, the existing test case data in the use case library is obtained, and the information of the tasks and use cases to be tested is extracted from the test case data. In an embodiment of the present application, the information of the tasks to be tested may be the interface information of the system to be tested, and the interface includes but is not limited to: the functional area to be tested or the business logic to be tested. Based on the extracted information of the tasks and use cases to be tested, a corresponding heterogeneous information network is constructed. The functional area to be tested is the specific functional module that needs to be tested in the software application, which is usually divided into different test ranges according to the business requirements of the application and user operations. The business logic to be tested is the business rules and processes that need to be verified in the software application, including the core functions and workflow of the application.

[0166] The extracted task information to be tested includes: the content of the interface, the functions contained in the interface, and the interface type. The content of the interface refers to all content information such as text, images, buttons, and forms displayed on the interface. The functions contained in the interface refer to the functions of the function buttons or forms. The interface types include user interfaces, command line interfaces, and graphical user interfaces.

[0167] The extracted use case information includes: input parameter information of the use case, verification information of the use case, and importance of the use case. The input parameter information of the use case refers to the test case input data type, data range, data format, quantity, and data source. The verification information of the use case refers to the verification rules, expected results, and actual results of the test case. By comparing the actual results with the expected results, it is determined whether the test case has passed the verification and whether further adjustment or optimization is required. The importance of the use case refers to the relative importance and priority of the test case in the testing process. It is used to determine the order of the test plan and resource allocation. The priorities usually include: high, medium, and low.

[0168] For example, a heterogeneous information network can be constructed based on information of one interface, or based on information of multiple interfaces, and applied to a multi-interface test scenario.

[0169] See also Figure 6 , Figure 6 is a schematic diagram of a heterogeneous information network structure provided by an embodiment of the present application; Figure 6 There are five types of nodes, that is, five types of objects, including: use case input, use case, interface, interface function and type. Use case input 6011 and use case input 6012 are used to represent two types of input objects; use case 6021, use case 6022 and use case 6023 are used to represent three test cases; interface 6031 and interface 6032 are used to represent the interfaces in the two systems to be tested; interface function 6041 and interface function 6042 are used to represent the functions included in interface 6031, and interface function 6043 is used to represent the functions included in interface 6032; interface type 6051 is used to represent the type corresponding to interface 6031, and interface type 6052 is used to represent the type corresponding to interface 6032.

[0170] For example, according to the different types of data obtained, each node is connected to build a heterogeneous information network. The heterogeneous information network contains many different types of objects and various types of connection relationships, which are represented by a directed graph. In the embodiment of the present application, the heterogeneous information network is used to represent the connection relationship between the interface and the use case node. The heterogeneous information network includes at least one of the following connection relationships: interface-use case, use case-interface, interface function-interface, interface-interface function, use case input-use case, use case-use case input, interface-interface type, interface type-interface, Figure 6 The heterogeneous information network shown is a simple structural diagram. The actual network constructed based on multiple test cases and interfaces is more complex and large.

[0171] For example: for a use case (A), an interface (U), a function (F), an interface type (T) and a use case input (R), the above connection relationship can indicate that the use case (A) belongs to a certain interface (U), a certain interface (U) contains the use case (A), the interface (U) contains a certain function (F), a certain function (F) belongs to a certain interface (U), the use case (A) contains a certain use case input (R), a certain use case input (R) belongs to the use case (A), the interface (U) belongs to a certain type (T), and the interface (U) belongs to a certain type (T).

[0172] Continue to see Figure 5 ,In step 502, each node sequence is determined based on multiple meta-paths in the heterogeneous information network.

[0173] For example, different types of meta-paths are obtained based on heterogeneous information networks. Meta-paths are paths formed by connecting different types of nodes in use cases and interfaces, including use case-interface meta-paths, use case-use case meta-paths, and interface-interface meta-paths. The sequence of each node is determined by a random walk method based on meta-paths. The random walk method is a specific type of random walk in a heterogeneous information network, and the random walk process is guided according to a predefined meta-path. In each step, the next node is not randomly selected, but selectively jumped according to the node type and relationship type defined in the meta-path.

[0174] Given a metapath P = (A0, A1, A2, ..., A n ), A n Indicates the node type. For example, A0 indicates use case-use case input parameter-use case type. Figure 6 , which can be use case 6021-use case input parameter 6011-use case 6022, represents a meta-path, n represents the number of nodes, and the random walk method based on the meta-path (equivalent to the above traversal) can be implemented by formula (1), which is described in detail below.

[0175]

[0176] in, P is a given meta-path, {p x~y :p x~y ∈P} represents the number of path instances from node x to node y under the guidance of meta-path P, |{p x~x :p x~x ∈P}|| and |{p y~y :p y~y ∈P}|represents the number of path instances starting from node x and returning to node x and starting from node y and returning to node y under the guidance of meta-path P.

[0177] in, represents the probability of each node being visited under the guidance of the meta-path P (equivalent to the first probability mentioned above), Indicates that at the i-th step, the node of type t, v i+1 represents the node of type t+1 at step i+1, Represents the neighbors of node v, and the node type of these neighbors is t+1.

[0178] The random walk formula (1) is used to calculate the probability of the next node being walked under the guidance of a given meta-path, and the sequence of each node is determined.

[0179] Continue to see Figure 5 ,In step 503, feature extraction is performed on each node sequence to obtain the features of each task node to be tested and the features of each use case node in the heterogeneous information network.

[0180] For example, based on each node sequence, the feature extraction model is called to perform feature extraction, and the features of each task node to be tested and the features of each use case node in the heterogeneous information network are obtained, that is, the feature vectors of each interface node and the feature vectors of each use case node.

[0181] The feature extraction model is called to extract features, and each node learns network embedding through the feature extraction model. Network embedding is a method of representing network structure and node attributes with vectors, while maintaining the topological structure and relationship information between nodes in the original network. In the embodiment of the present application, network embedding can reveal the relationship and similarity between nodes by learning the vector representation of nodes. The feature extraction model can be a skip-gram model, which is an algorithm for processing word embedding, which can map each node information to a vector of a fixed size.

[0182] The maximization probability function is expressed as an arg function. Under given parameters or conditions, the optimal parameter value that maximizes the probability is determined. The maximization probability function is used as the training goal to train feature extraction to find the optimal model parameters. The training of the feature extraction model can be implemented by formula (2), which is described in detail below.

[0183]

[0184] Among them, θ is the weight parameter of the maximized probability function (equivalent to the above target weight parameter), v represents the specific feature embedding vector, V represents the feature embedding vector set, t is the node type, T v Represents a node type set containing all node types, C t represents the neighbor vector, N t(V) indicates that node v is the neighborhood of the t-th type node. The normalization function (equivalent to the normalization function associated with the above feature extraction model) is logp(C t |V;θ), that is u represents the interface node, X represents the vector matrix of the node, and X V is the vth row in the X matrix, representing the embedding vector feature of node v.

[0185] In step 504, the features of each task node to be tested and the features of each use case node are fused to determine the fused features of the task to be tested and the fused features of the use case.

[0186] For example, the features of each task node to be tested and the features of each use case node under different meta-paths are fused through a fusion function to obtain the fusion features of the task to be tested (equivalent to the first fusion features mentioned above) and the fusion features of the use case (equivalent to the second fusion features mentioned above), that is, the embedded feature vectors of the interface and the use case based on the heterogeneous information network.

[0187] The embedding feature vectors of interface u and use case i based on heterogeneous information networks can be realized by formula (3), which is explained in detail below.

[0188]

[0189] in, and They represent the feature vector embedding of interface u and use case i based on heterogeneous information networks (equivalent to the first fusion feature and the second fusion feature mentioned above), and They represent the fusion functions of the embedding vectors respectively, and s represents the sth meta-path.

[0190] The feature vectors of each interface node under different meta-paths (equivalent to the first sub-fusion feature) are embedded and fused together using a fusion function to obtain an embedding vector of the interface. This can be achieved using formula (4), which is described in detail below.

[0191]

[0192] The feature vectors of each use case node under different meta-paths (equivalent to the second sub-fusion feature mentioned above) are embedded and fused together using the fusion function to obtain the embedding vector of the use case. This can be achieved by formula (5), which is described in detail below.

[0193]

[0194] Among them, |P| represents the number of sets of meta-paths, represents the preference weight of interface u for the sth meta-path, M (s)and b (s) They represent the transformation matrix and bias vector under the s-th original path respectively.

[0195] In step 505, the correlation between the fusion features of the task to be tested and the fusion features of the test case is calculated, and a recommended test case is determined based on the correlation degree.

[0196] For example, the degree of correlation between the fusion features of the task to be tested and the fusion features of the use case is calculated, and the correlation degree is scored based on the feature scoring preference formula. When the calculated predicted score value is greater than a preset recommendation preference threshold, the corresponding test case is determined to be a recommended test case.

[0197] For example, the fusion features of the task to be tested and the fusion features of the use case are integrated into the scoring preference formula (equivalent to the above-mentioned preconfigured association function) by linear addition. The degree of association between the use case and the task to be tested can be realized by formula (6), which is described in detail below.

[0198]

[0199] in, represents the predicted score of interface u for use case i (the degree of association above), represents the implicit vector of interface u, Y i represents the implicit vector of use case i, and They represent the embedding of interface u and use case i based on heterogeneous information networks respectively. α and β are adjustable parameters to prevent function overfitting.

[0200] The test case recommendation method provided in the embodiment of the present application is characterized as a judgment process as follows. Figure 7 , Figure 7 This is the fifth flow chart of the test case recommendation method provided in the embodiment of the present application.

[0201] In step 701, a heterogeneous information network is constructed.

[0202] For example, test case data is obtained, and the information of the tasks to be tested and the use cases is extracted to construct a heterogeneous information network.

[0203] In step 702, the probabilities of nodes of the meta-path being wandered are calculated.

[0204] For example, based on the heterogeneous information network, different types of meta-paths are obtained, and the probability of the next node being wandered in a given meta-path is calculated as the importance of the meta-path.

[0205] In step 703, a random walk based on the meta-path is performed.

[0206] For example, the sequence of each node is determined based on the random walk of the meta-path.

[0207] In step 704, a low-dimensional embedding vector of the node is calculated.

[0208] For example, the feature extraction model is called to calculate the low-dimensional embedding vector of each node.

[0209] In step 705, the embedding vectors of the nodes under different meta-paths are fused.

[0210] For example, based on the fusion function, the low-dimensional embedding vectors of each node are fused to obtain the fused embedding vectors corresponding to the interface and the use case respectively.

[0211] In step 706, the deviation between the target value and the actual value is calculated.

[0212] For example, the actual value of the degree of association is calculated based on the fused embedding vectors corresponding to the interface and the use case, and the deviation between the target value and the actual value is calculated.

[0213] In step 707, the feature extraction model is trained based on parameter learning.

[0214] For example, based on the fused embedding vectors corresponding to the interface and the use case, respectively, a maximization probability function is called to determine the optimal parameters of the feature extraction model.

[0215] In step 708, it is determined whether the deviation meets the requirement. If the determination result is yes, the above process ends; if the determination result is no, the process returns to step 707.

[0216] For example, if the deviation meets the requirements, the test case meets the recommended conditions, and the corresponding test case is determined to be a recommended test case. If the conditions are not met, return to continue training the model and adjust the parameters.

[0217] The implementation principles in steps 701 to 708 are the same as those in steps 501 to 505 and will not be repeated here.

[0218] The test case recommendation method provided in the embodiment of the present application has the following beneficial effects:

[0219] Acquire test case data, extract different types of information about the tasks and cases to be tested, build a heterogeneous information network, integrate different types of data and information, uniformly process different types of heterogeneous information, and characterize the structure and deep semantic relationship between different types of objects. Determine multiple meta-paths through the connection relationship between nodes, and use a meta-path-based random walk method to determine the sequence of each node. It can explore the deep structure and relationship between nodes in the heterogeneous information network. By selecting a specific meta-path, it can reduce unnecessary node access and improve the efficiency of the algorithm. Extract and fuse features for each node sequence, calculate the degree of correlation between the fused features, and recommend test cases based on the degree of correlation. By fusing multiple features and determining the degree of correlation, the applicability of test cases can be more comprehensively evaluated, and the efficiency and coverage of recommended test cases can be improved.

[0220] The following is a description of an exemplary structure of the test case recommendation device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 2 As shown, the software modules stored in the test case recommendation device 455 of the memory 450 may include: a network construction module 4551, which is used to construct an information network based on the task information of the task to be tested and the test case data of multiple test cases; a feature extraction module 4552, which is used to extract multiple node sequences from the information network according to the connection relationship between the nodes in the information network, the information network includes nodes of the task information type and nodes of the test case data type, and the node sequence includes nodes of the task information type and nodes of the test case data type with a connection relationship; perform feature extraction processing on the multiple node sequences respectively to obtain multiple task features and multiple test case features; perform fusion processing on the multiple task features to obtain a first fusion feature of the task to be tested, and perform fusion processing on the test case features of each test case to obtain a second fusion feature of each test case; a recommendation module 4553, which is used to determine the recommended test case corresponding to the task to be tested based on the degree of association between each second fusion feature and the first fusion feature.

[0221] In some embodiments, the network construction module 4551 is further used to represent the task information to be tested and the test case data as multiple nodes; and connect the multiple nodes into an information network according to the mapping relationship between the task information to be tested and the test case data.

[0222] In some embodiments, the feature extraction module 4552 is also used to determine multiple meta-paths in the information network based on the connection relationship between node types in the information network, each meta-path includes multiple types of nodes; based on the connection relationship, determine the node sequence corresponding to each meta-path to obtain multiple node sequences; wherein, for each meta-path, based on the connection relationship, determine the node sequence corresponding to the meta-path, including: selecting a first node from the meta-path, the first node is any node in the meta-path; based on the connection relationship, select multiple second nodes from the meta-path that have an association relationship with the first node, the second node is a node that is directly or indirectly connected to the first node; and combine the first node and the second node into a node sequence corresponding to the meta-path according to the selection order.

[0223] In some embodiments, the feature extraction module 4552 is also used to determine at least one fourth node in the meta-path that has a connection relationship with the third node; determine a first probability of each fourth node being selected, and determine a target node from at least one fourth node based on the first probability; when the number of selected target nodes is less than a preset threshold, execute the step of determining at least one fourth node in the meta-path that has a connection relationship with the third node; wherein, when the target node is selected for the first time, the third node is the first node, and when the target node is not selected for the first time, the third node is the target node selected last time; when the number of selected target nodes is greater than or equal to the preset threshold, the selected multiple target nodes are used as multiple second nodes.

[0224] In some embodiments, the feature extraction module 4552 is also used to extract features from the nodes included in each node sequence to obtain a feature set corresponding to each node sequence, wherein the node sequence includes nodes of task information type and nodes of test case data type; the features in the feature set are classified according to the type of each node to obtain multiple test case features and multiple task features, wherein the test case features are features corresponding to the nodes of the test case data type, and the task features are features corresponding to the nodes of the task information type.

[0225] In some embodiments, before performing feature extraction on the nodes included in each node sequence to obtain the feature set corresponding to each node sequence, the feature extraction module 4552 is also used to determine the first weight parameter to be updated in the initialized feature extraction model; based on the sample task characteristics, the sample use case characteristics and the weight parameter variables of the feature extraction model, determine the second weight parameter that maximizes the value of the normalization function; update the first weight parameter with the second weight parameter to obtain an updated feature extraction model.

[0226] In some embodiments, the information network includes multiple meta-paths, and the meta-paths include nodes corresponding to task features and test case features respectively. The feature extraction module 4552 is also used to aggregate the task features of the task to be tested in the meta-path for each meta-path in the information network to obtain the first sub-fusion features of the task to be tested in different meta-paths; combine multiple first sub-fusion features into the first fusion features of the task to be tested; for each test case, aggregate the test case features of the test case in each meta-path to obtain the second sub-fusion features of the test case in different meta-paths; for each test case, combine multiple second sub-fusion features of the test case to obtain the second fusion features of each test case.

[0227] In some embodiments, the recommendation module 4553 is also used to call a preconfigured correlation function to calculate the degree of correlation based on each second fusion feature and the first fusion feature; select the test case corresponding to the second fusion feature whose correlation degree is greater than a preset degree threshold, and use the selected test case as the recommended test case corresponding to the task to be tested.

[0228] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the test case recommendation method described in the embodiment of the present application.

[0229] The present application embodiment provides a computer-readable storage medium, in which computer executable instructions or computer programs are stored. When the computer executable instructions or computer programs are executed by a processor, the processor will execute the test case recommendation method provided by the present application embodiment, for example, Figure 3A The test cases shown are recommended methods.

[0230] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0231] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0232] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0233] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0234] To summarize, through the embodiments of the present application, an information network is constructed based on the task information to be tested and the test case data of multiple test cases, feature extraction is performed on the node sequence in the information network, the features extracted separately are fused, and the test cases to be recommended are determined based on the degree of correlation calculated based on the fused features. This can improve the recommendation effect of test cases in different complex scenarios.

[0235] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A test case recommendation method, characterized in that: The method comprises: Building an information network based on the task information of the task to be tested and the test case data of multiple test cases; Extracting a plurality of node sequences from the information network according to a connection relationship between nodes in the information network, wherein the information network includes nodes of a task information type and nodes of a test case data type, and the node sequences include nodes of the task information type and nodes of the test case data type having a connection relationship; Performing feature extraction processing on the multiple node sequences respectively to obtain multiple task features and multiple test case features; Performing fusion processing on the plurality of task features to obtain a first fusion feature of the task to be tested, and performing fusion processing on the test case feature of each of the test cases to obtain a second fusion feature of each of the test cases; Based on the degree of association between each of the second fused features and the first fused features, a recommended test case corresponding to the task to be tested is determined.

2. The method according to claim 1, characterized in that The step of extracting a plurality of node sequences from the information network according to the connection relationship between the nodes in the information network comprises: Determining a plurality of meta-paths in the information network according to connection relationships between node types in the information network, each meta-path including nodes of a plurality of types; Based on the connection relationship, determine the node sequence corresponding to each of the meta-paths to obtain the multiple node sequences; Wherein, for each of the meta-paths, based on the connection relationship, determining a node sequence corresponding to the meta-path includes: Selecting a first node from the meta-path, where the first node is any node in the meta-path; Based on the connection relationship, selecting a plurality of second nodes associated with the first node from the meta-path, wherein the second nodes are nodes directly or indirectly connected to the first node; The first node and the second node are combined into a node sequence corresponding to the meta-path according to the selection order.

3. The method according to claim 2, characterized in that The selecting, from the meta-path based on the connection relationship, a plurality of second nodes associated with the first node comprises: Determine at least one fourth node in the meta-path that is connected to the third node; Determine a first probability that each of the fourth nodes is selected, and determine a target node from the at least one fourth node based on the first probability; When the number of the selected target nodes is less than a preset threshold, performing the step of determining at least one fourth node in the meta-path that has a connection relationship with the third node; Wherein, when the target node is selected for the first time, the third node is the first node; when the target node is not selected for the first time, the third node is the target node selected last time; When the number of the selected target nodes is greater than or equal to the preset threshold, the selected multiple target nodes are used as the multiple second nodes.

4. The method according to claim 1, characterized in that The performing feature extraction processing on the multiple node sequences respectively to obtain multiple task features and multiple test case features includes: Performing feature extraction on the nodes included in each of the node sequences to obtain a feature set corresponding to each of the node sequences, wherein the node sequences include nodes of task information type and nodes of test case data type; The features in the feature set are classified according to the type of each node to obtain a plurality of the test case features and a plurality of the task features, wherein the test case features are features corresponding to the nodes of the test case data type, and the task features are features corresponding to the nodes of the task information type.

5. The method according to claim 4, characterized in that Before extracting features from the nodes included in each of the node sequences to obtain a feature set corresponding to each of the node sequences, the method further includes: Determining a first weight parameter to be updated in the initialized feature extraction model; Determine a second weight parameter that maximizes the value of the normalization function based on the sample task feature, the sample use case feature, and the weight parameter variable of the feature extraction model; The first weight parameter is updated with the second weight parameter to obtain the updated feature extraction model.

6. The method according to claim 1, characterized in that The information network includes a plurality of meta-paths, each of which includes nodes corresponding to the task features and the test case features; The fusing of the plurality of task features to obtain a first fused feature of the task to be tested, and the fusing of the test case feature of each test case to obtain a second fused feature of each test case, include: For each of the meta-paths in the information network, aggregating the task features of the task to be tested in the meta-path to obtain first sub-fusion features of the task to be tested in different meta-paths; Combining a plurality of the first sub-fusion features into a first fusion feature of the task to be tested; For each of the test cases, aggregating the test case features of the test case in each of the meta-paths to obtain second sub-fusion features of the test case in different meta-paths; For each of the test cases, multiple second sub-fusion features of the test case are combined to obtain a second fusion feature of each of the test cases.

7. A test case recommendation device, characterized in that: The device comprises: A network construction module, for constructing an information network based on task information of a task to be tested and test case data of a plurality of test cases; A feature extraction module is used to extract multiple node sequences from the information network according to the connection relationship between the nodes in the information network, the information network includes nodes of the task information type and nodes of the test case data type, and the node sequence includes nodes of the task information type and nodes of the test case data type with a connection relationship; perform feature extraction processing on the multiple node sequences respectively to obtain multiple task features and multiple test case features; perform fusion processing on the multiple task features to obtain a first fusion feature of the task to be tested, and perform fusion processing on the test case features of each of the test cases to obtain a second fusion feature of each of the test cases; A recommendation module is used to determine a recommended test case corresponding to the task to be tested based on the degree of association between each of the second fusion features and the first fusion features.

8. An electronic device, characterized in that: The electronic device comprises: A memory for storing computer executable instructions or computer programs; A processor, used to implement the test case recommendation method described in any one of claims 1 to 6 when executing the computer executable instructions or computer programs stored in the memory.

9. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the test case recommendation method according to any one of claims 1 to 6 is implemented.

10. A computer program product comprising computer executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the test case recommendation method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Test case generation method and device, server and storage medium

    CN120631787A

  • Demand correlation prediction method and device based on mixed feature map and electronic equipment

    CN122679051A