Test case generation method and system, electronic equipment and storage medium

By constructing a risk gene evolution knowledge graph and analyzing it using the BERT model, test cases were generated, which solved the problem of insufficient utilization of historical production problem information, achieved the accuracy and consistency of test cases, and avoided repetition.

CN121387749APending Publication Date: 2026-01-23AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511727775.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Existing technologies cannot effectively utilize information from historical production problems, resulting in a lack of accuracy and consistency in test case design, and making it impossible to prevent the recurrence of historical production problems.

Method used

Tags of historical production problems are extracted using natural language processing models, an evolutionary knowledge graph based on risk genes is constructed, and the BERT model is used to analyze new project requirements and generate test cases.

Benefits of technology

This ensures the accuracy and consistency of test cases, prevents historical production issues from recurring, and improves test quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387749A_ABST
    Figure CN121387749A_ABST
Patent Text Reader

Abstract

The invention discloses a test case generation method and system, electronic equipment and a storage medium. The method comprises the steps that files of historical production problems are recognized through a natural language processing model, and labels of all target dimensions are extracted; wherein the target dimension at least comprises a trigger module, a trigger scene, root cause analysis, a test key point and a solution; constructing a problem evolution knowledge graph based on the risk genes by using the tags; wherein the risk gene is an essential feature set of historical production problems and is composed of technical gene defects and business logic genes; when a new project exists, semantic analysis is carried out on the demand file of the new project through a BERT model, and demand information of the new project is obtained; retrieving risk genes and solution information corresponding to the new project from the problem evolution knowledge graph based on the demand information of the new project; and generating a test case of the new project by using the retrieved risk gene and the solution information corresponding to the new project.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of system problem information management, and in particular relates to a test case generation method and system, an electronic device, and a storage medium. BACKGROUND

[0002] With the increasing complexity of system architecture and the widespread application of distributed technology, the modular design and frequent iterative update of information systems lead to the repeated occurrence of historical production problems with the online of different systems, which requires the test team to be more comprehensive in test case design and scenario coverage.

[0003] In order to avoid the repeated occurrence of historical production problems as much as possible, the keywords and key points of historical production problems and other data are currently manually analyzed and written by relevant staff, and the data of historical production problems are stored in unstructured documents and shared among different system project teams. Therefore, test personnel of new project teams learn the historical production problem documents to add corresponding scenarios when writing test cases to avoid similar defects.

[0004] However, the current way of historical production problem documents relies on the ability of the writer, so it lacks accuracy and consistency. Moreover, the design of test cases depends on the learning and understanding of test personnel on historical production problem documents, so it cannot guarantee effective use of previous experience to design test cases. Therefore, the existing way cannot guarantee effective use of historical production problem information to avoid the repeated occurrence of historical production problems, so the test quality is relatively low. SUMMARY

[0005] Based on the deficiencies of the prior art, the present application provides a test case generation method and system, an electronic device, and a storage medium to solve the problem that the prior art cannot effectively use historical production problem information and cannot avoid the repeated occurrence of historical production problems.

[0006] To achieve the above purpose, the present application provides the following technical solutions:

[0007] The first aspect of the present application provides a test case generation method, comprising:

[0008] identifying and extracting labels of each target dimension of the historical production problem file through a natural language processing model; wherein the target dimension at least includes a trigger module, a trigger scenario, a root cause analysis, a test point, and a solution;

[0009] constructing a problem evolution knowledge graph based on a risk gene using each of the labels; wherein the risk gene is a set of essential characteristics of the historical production problem, which consists of technical gene defects and business logic genes;

[0010] performing semantic analysis on a demand document of the new project by a BERT model to obtain demand information of the new project;

[0011] retrieving the risk gene and the solution information corresponding to the new project from the problem evolution knowledge graph based on the demand information of the new project;

[0012] generating a test case of the new project by using the retrieved risk gene and the solution information corresponding to the new project.

[0013] Optionally, in the test case generation method described above, the identifying and extracting labels of each target dimension from the historical production problem document by the natural language processing model comprises:

[0014] identifying entities and keywords in the historical production problem document by the natural language processing model, and extracting labels from each target dimension based on the entities and keywords in the historical production problem document.

[0015] Optionally, in the test case generation method described above, the constructing a problem evolution knowledge graph based on a risk gene by using each label comprises:

[0016] generating a risk gene of the historical production problem by using each label.

[0017] constructing a problem evolution knowledge graph based on the risk gene based on the risk gene and a gene variation relationship, and associating environmental pressure and an evolution path; wherein the gene variation relationship is a relationship describing changes of the risk gene with versions and demand iterations; the environmental pressure is generated based on the label of the trigger scenario; and the evolution path is generated based on the solution.

[0018] Optionally, in the test case generation method described above, the performing semantic analysis on a demand document of the new project by a BERT model to obtain demand information of the new project comprises:

[0019] when there is a new project, obtaining a demand document of the new project, and preprocessing the demand document of the new project;

[0020] performing demand text classification and keyword extraction on the preprocessed demand document of the new project by a BERT model to obtain demand information of the new project.

[0021] Optionally, in the test case generation method described above, the retrieving, from the problem evolution knowledge graph, of the risk genes corresponding to the new project and solution information based on the demand information of the new project comprises:

[0022] Multi-dimensional matching of the demand information of the new project with each of the labels to obtain a label matching result;

[0023] Retrieving, from the problem evolution knowledge graph, the risk genes corresponding to the new project based on an environmental stress parameter in the label matching result;

[0024] Retrieving, from the problem evolution knowledge graph, an optimal solution to the risk genes corresponding to the new project to obtain solution information corresponding to the new project.

[0025] Optionally, in the test case generation method described above, the generating of the test case of the new project by using the retrieved risk genes corresponding to the new project and the solution information comprises:

[0026] Filling the retrieved risk genes corresponding to the new project and the solution information into a test case template of a corresponding type to generate the test case of the new project.

[0027] The second aspect of the present application provides a test case generation system, comprising:

[0028] A label extraction unit configured to identify and extract labels of each target dimension from files of historical production problems by using a natural language processing model; wherein the target dimensions at least include a trigger module, a trigger scenario, a root cause analysis, a test point, and a solution;

[0029] A graph construction unit configured to construct a problem evolution knowledge graph based on risk genes by using each of the labels; wherein the risk genes are a set of essential characteristics of the historical production problems, and are composed of technical gene defects and business logic genes;

[0030] A project analysis unit configured to perform semantic analysis on a demand file of a new project by using a BERT model to obtain demand information of the new project whenever the new project exists;

[0031] An information retrieval unit configured to retrieve, from the problem evolution knowledge graph, the risk genes corresponding to the new project and solution information based on the demand information of the new project;

[0032] A case generation unit configured to generate a test case of the new project by using the retrieved risk genes corresponding to the new project and the solution information.

[0033] Optionally, in the test case generation system described above, the label extraction unit comprises:

[0034] A label extraction subunit is configured to identify entities and keywords in the historical production problem file through a natural language processing model, and extract labels from each of the target dimensions based on the entities and keywords in the historical production problem file.

[0035] Optionally, in the test case generation system described above, the graph construction unit comprises:

[0036] A gene generation unit is configured to generate a risk gene of the historical production problem using each of the labels.

[0037] A construction unit is configured to construct a problem evolution knowledge graph based on the risk gene and a gene variation relationship thereof, and associate environmental stress and an evolution path; the gene variation relationship is a relationship describing changes in the risk gene with version and demand iteration; the environmental stress is generated based on the labels of the trigger scenarios; and the evolution path is generated based on the solutions.

[0038] Optionally, in the test case generation system described above, the project analysis unit comprises:

[0039] A preprocessing unit is configured to, whenever there is a new project, acquire a demand file of the new project and pre-process the demand file of the new project.

[0040] A demand information analysis unit is configured to perform demand text classification and keyword extraction on the pre-processed demand file of the new project through a BERT model to obtain demand information of the new project.

[0041] Optionally, in the test case generation system described above, the information retrieval unit comprises:

[0042] A matching unit is configured to perform multi-dimensional matching of the demand information of the new project with each of the labels to obtain a label matching result.

[0043] A risk retrieval unit is configured to retrieve the risk gene corresponding to the new project from the problem evolution knowledge graph based on an environmental stress parameter in the label matching result.

[0044] A solution retrieval unit is configured to retrieve, from the problem evolution knowledge graph, an optimal solution for the risk gene corresponding to the new project to obtain solution information corresponding to the new project.

[0045] Optionally, in the test case generation system described above, the case generation unit comprises:

[0046] a case generation sub-unit, configured to fill the retrieved risk genes corresponding to the new project and the solution information into a test case template of a corresponding type to generate a test case of the new project.

[0047] The third aspect of the present application provides an electronic device, comprising:

[0048] a memory and a processor;

[0049] The memory is configured to store a program.

[0050] The processor is configured to execute the program, and the program, when executed, is specifically configured to implement the test case generation method according to any one of the preceding aspects.

[0051] The fourth aspect of the present application provides a computer storage medium for storing a computer program, and the computer program, when executed by a processor, is configured to implement the test case generation method according to any one of the preceding aspects.

[0052] The test case generation method provided by the present application can recognize and extract labels of each target dimension of historical production problems through a natural language processing model, so as to extract labels through the natural language processing model, and ensure the accuracy and consistency of the extracted information without manual analysis and writing. The target dimensions at least include a trigger module, a trigger scene, a root cause analysis, a test point and a solution. Then, each label is used to construct a problem evolution knowledge graph based on risk genes. The risk genes are a set of essential characteristics of historical production problems, and are composed of technical gene defects and business logic genes, so as to analogize software production problems to "biological organisms", abstract "risk genes" as essential characteristics of problems, construct a problem evolution knowledge graph to describe the evolution law of historical production problems, highlight the dynamic changes and predictability of the problems, and then provide accurate information for reuse. Whenever there is a new project, a BERT model is used to perform semantic analysis on a requirement file of the new project to obtain requirement information of the new project, so as to efficiently analyze the requirement information of the new project. Then, based on the requirement information of the new project, risk genes and solution information corresponding to the new project are retrieved from the problem evolution knowledge graph. Finally, the risk genes and the solution information corresponding to the new project are used to generate a test case of the new project, so as to realize accurate landing of organizational-level experience to specific project requirement scenarios, establish a matching mechanism of historical production problems and new project requirements, solve the difficulty of manual memory of all historical production problems at the organizational level, reduce the influence of individual learning differences on the quality of project test cases, and therefore effectively ensure the accuracy of the test cases and avoid the repeated occurrence of historical production problems. BRIEF DESCRIPTION OF DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the accompanying drawings in the following description only only the embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.

[0054] Figure 1 The flow chart of a test case generation method provided by the embodiments of the present application;

[0055] Figure 2 The flow chart of a method for constructing a problem evolution knowledge graph provided by the embodiments of the present application;

[0056] Figure 3 The flow chart of a method for performing semantic analysis on a new project requirement document provided by the embodiments of the present application;

[0057] Figure 4 The flow chart of a method for retrieving information from a problem evolution knowledge graph provided by the embodiments of the present application;

[0058] Figure 5 The architecture schematic diagram of a test case generation system provided by the embodiments of the present application;

[0059] Figure 6 The architecture schematic diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0061] In this application, the terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between such entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0062] The embodiment of the present application provides a test case generation method, as shown in the method comprises the following steps: Figure 1

[0063] S101, identifying and extracting labels of each target dimension of a historical production problem file through a natural language processing model.

[0064] The target dimension at least includes a trigger module, a trigger scene, root cause analysis, test points and a solution.

[0065] It should be noted that the current historical production problem is often stored in the form of original documents such as "certain event analysis report". The document content is detailed, so it needs to spend more time reading, and has certain understanding, analysis and summary ability threshold requirements for the reading personnel. The keywords extracted by different test personnel through manual extraction lack consistency and accuracy. Therefore, in the embodiment of the present application, a natural language processing model is used for standard accurate information extraction, and manual analysis and writing are no longer needed.

[0066] In order to analyze the related information of the historical production problem and construct the knowledge graph of the information of the historical production problem changing with the version and the demand, the labels of at least the trigger module, the trigger scene, the root cause analysis, the test points and the solution are extracted.

[0067] Optionally, in another embodiment of the present application, a specific implementation of step S101 comprises:

[0068] The entities and keywords in the historical production problem file are recognized through the natural language processing model, and the labels are extracted from each target dimension based on the entities and keywords in the historical production problem file.

[0069] ​Specifically, by using a natural language processing model, entities and keywords in the problem report are quickly extracted, and labels are automatically extracted from trigger modules, trigger scenarios, root cause analysis, test points, and solutions. For example, if the input file of the model is: X e-commerce system X year X month X day user repeated payment but order not updated event analysis report, the automatically extracted labels are:

[0070] Trigger module: payment module, order center.

[0071] Trigger scenario: user repeated payment order not updated.

[0072] Root cause analysis: (a) idempotency logic defect; (b) performance defect under high concurrency.

[0073] Test points: (a) same request ID repeated order test; (b) consistency comparison between payment flow and order status; (c) simulate user behavior under high concurrency.

[0074] Solution: add idempotency logic check in payment module and order center.

[0075] S102, construct a problem evolution knowledge graph based on risk genes using various labels.

[0076] Among them, the risk gene is a set of essential characteristics of historical production problems, which consists of technical gene defects and business logic genes.

[0077] It should be noted that, in order to facilitate the reuse of related information of historical production problems, in the embodiments of the present application, a knowledge graph is constructed using the extracted information. The knowledge graph stores data in entities (nodes) and relationships (edges), supports multi-hop query and deep correlation analysis. However, the existing method directly constructs the connection relationship between entities according to the relationship between entities, and only the information of entities and the relationship between entities can be obtained through the knowledge graph. Therefore, the description of historical production problems is relatively vague, and the recorded information cannot be directly used to construct test cases. Therefore, in the embodiments of the present application, risk genes are analyzed using various labels, and a problem evolution knowledge graph based on risk genes is constructed, that is, a knowledge graph reflecting the change relationship of historical production problems through risk genes. Breakthrough traditional "linear correlation" mode, not only structured storage, but also active prediction of risks, driving of test design, and precipitation of implicit experience. The problem of software is analogous to "biological organisms", and "risk genes" are abstracted as the essential characteristics of the problem, which describe the evolution law of historical production problems.

[0078] Alternatively, in another embodiment of the present application, a specific implementation of step S102 includes: Figure 2 as shown, comprising:

[0079] S201, generate a risk gene of a historical production problem by using each label.

[0080] Specifically, the essential feature set of the historical production problem is extracted based on each label, and specifically, the risk gene of the historical production problem can be composed of a technical gene defect (such as a null pointer) and a business logic gene (such as a lack of permission verification).

[0081] S202, based on the risk gene and the gene mutation relationship, a problem evolution knowledge graph based on the risk gene is constructed, and the environmental pressure and the evolution path are associated.

[0082] The gene mutation relationship is a relationship for describing the change of the risk gene with the version and the demand iteration. The environmental pressure is generated based on the label of the triggering scene. The evolution path is generated based on the solution. That is, in order to highlight the dynamic change and predictability of the problem, the environmental pressure (triggering scene) and the evolution path (solution iteration) are associated. Therefore, the definition of each information of the problem evolution knowledge graph constructed by the embodiments of the present application and the difference compared with the traditional knowledge graph are shown in Table 1.

[0083] Table 1

[0084]

[0085] S103, whenever there is a new project, the demand file of the new project is analyzed by the BERT model to obtain the demand information of the new project.

[0086] It should be noted that in the embodiments of the present application, whenever a new project needs to generate a test case, the BERT model is used to perform semantic classification on the demand file of the new project, such as the demand specification of the new project, which aims to automatically understand the content of the demand document, identify the demand type or risk point, and realize the conversion of the project demand file into structured demand, thereby supporting the matching search in the knowledge graph of the historical production problem, thereby reducing the time cost of manually reading the demand file, and accurately extracting all demand key points, preventing omissions caused by human negligence or reader understanding differences.

[0087] Optionally, in another embodiment of the present application, a specific implementation of step S103 includes: Figure 3 as shown in the following table.

[0088] S301, whenever there is a new project, the demand file of the new project is obtained, and the demand file of the new project is preprocessed.

[0089] Specifically, the demand file of the new project is first data cleaned, labeled, and redundant descriptions removed, mainly including removing text stop words and processing repeated words, default values, etc. Then the processed data is expressed in a standardized terminology to ensure the accuracy of understanding in the subsequent model analysis process.

[0090] S302, classifying the demand text and extracting the keywords of the demand file of the new project by the BERT model to obtain the demand information of the new project.

[0091] Specifically, the BERT model is used to extract keywords and classify demand text from the pre-processed demand file of the new project. For example, the text in the demand file is: "The system should maintain an API response time of <2 seconds under high concurrency". The BERT model outputs a probability distribution after the CLS vector is connected through a fully connected layer: performance requirement: 0.85, reliability requirement: 0.12, safety requirement: 0.03. Therefore, according to the maximum probability, this demand text is classified as "performance requirement". At the same time, the model can deeply understand the context meaning and dynamically truncate to obtain keywords such as "high concurrency", "2 seconds", "API response time", etc. The model can be fine-tuned to adjust the parameters on specific tasks (i.e. demand text classification) with a small amount of labeled data, and repeatedly trained to continuously improve the accuracy of semantic classification.

[0092] S104, retrieving the risk genes and solution information corresponding to the new project from the problem evolution knowledge graph based on the demand information of the new project.

[0093] Specifically, based on the demand information of the new project, the risk genes and solution information that can be reused in the new project are retrieved by matching the demand information of the new project with the problem evolution knowledge graph.

[0094] Optionally, in another embodiment of the present application, a specific implementation of step S104 includes the following steps as shown in Figure 4

[0095] S401, multi-dimensionally matching the demand information of the new project with each label to obtain a label matching result.

[0096] Among them, the demand information of the new project mainly includes keywords and demand text classification, that is, the key information and demand type of the demand of the new project, so the information of the problem that meets the type of the new project can be retrieved according to the demand information of the new project, and applied to generate test cases for the new project, so as to avoid the occurrence of the problem of this type in the new project.

[0097] ​Specifically, the demand text in the demand information of the new project is classified and matched with each label extracted in step S101 in multiple dimensions based on a matching rule, so that it can be determined which labels the new project meets. The matching rule includes hard rules and soft rules. The hard rules mainly include the same module name (such as "order center"), the same technical term (such as "high concurrency" and "idempotency check"), and the like. The soft rule is the semantic similarity of the scene (such as "fund check" is approximately equal to "account consistency").

[0098] S402, based on the environmental pressure parameter in the label matching result, retrieve the risk gene corresponding to the new project from the problem evolution knowledge graph.

[0099] Specifically, by comparing the trigger conditions such as the environmental pressure parameter in the label matching result in the new project, the possible risk point, i.e. the risk gene, can be directly identified, so that the risk prediction is more accurate.

[0100] S403, retrieve the best solution for the risk gene corresponding to the new project from the problem evolution knowledge graph, and obtain the solution information corresponding to the new project.

[0101] After determining the risk point of the new project, i.e. the possible problem, the most effective solution can be further retrieved. Different repair solutions have different effects and different costs, and can be matched according to the complexity of the new demand.

[0102] S105, generating a test case of the new project by using the retrieved risk gene and solution information corresponding to the new project.

[0103] It should be noted that the retrieved risk gene and solution information corresponding to the new project are information of historical problems that may occur in the new project and corresponding solutions, so the test case of the new project can be generated according to the retrieved risk gene and solution information corresponding to the new project, so that the historical production problems that may occur can be tested and the same type of historical production problems can be prevented from occurring in the new project.

[0104] Optionally, in another embodiment of the present application, one specific implementation of step S105 includes:

[0105] Filling the retrieved risk gene and solution information corresponding to the new project into the test case template of the corresponding type to generate the test case of the new project.

[0106] Specifically, the test case standardized output templates of different test types such as functions, performances, and securities are defined in advance. Therefore, based on the search result of the previous step, the structured data and the project requirement keywords can be filled into the test case templates of the corresponding test types as the input of the automatic generation of the test case, the readable test case is generated by filling the structured data and the project requirement keywords into the test case templates of the corresponding test types, and the landing of the historical experience and lessons to the specific project test scene is realized. Finally, in combination with the test methods such as the boundary value analysis and the equivalence class division, the reverse test case is generated. For example, for the test points of "simulating user requests under high concurrency" and the keyword of "supporting 100 users to log in simultaneously" in the new project requirement, a plurality of positive and negative test cases such as single user login, simulation of 100 users logging in simultaneously, simulation of 101 users logging in simultaneously, and simulation of high-concurrency user login are automatically generated.

[0107] The embodiment of the present application provides a test case generation method, which identifies and extracts labels of each target dimension of historical production problems through a natural language processing model, so as to extract labels through the natural language processing model, guarantee the accuracy and consistency of the extracted information, and avoid manual analysis and writing. The target dimensions at least include a trigger module, a trigger scene, a root cause analysis, test points, and a solution. Then, a problem evolution knowledge graph based on risk genes is constructed by using each label. The risk genes are a set of essential characteristics of historical production problems, which are composed of technical gene defects and business logic genes, so as to analogize software production problems to "biological organisms", abstract "risk genes" as essential characteristics of problems, construct a problem evolution knowledge graph, describe the evolution law of historical production problems, highlight the dynamic changes and predictability of the problems, and then provide accurate information for reuse. When there is a new project, the demand file of the new project is analyzed by using a BERT model to obtain demand information of the new project, so that the demand information of the new project can be efficiently analyzed. Then, the risk genes and solution information corresponding to the new project are retrieved from the problem evolution knowledge graph based on the demand information of the new project. Finally, the test case of the new project is generated by using the retrieved risk genes and solution information corresponding to the new project, so as to realize the accurate landing of the organizational level experience to the specific project requirement scene, establish a matching mechanism of historical production problems and new project requirements, solve the difficulty of manually memorizing all historical production problems of the organizational level, reduce the influence of individual learning differences on the quality of the project test case, and therefore the accuracy of the test case can be effectively guaranteed, and the repeated occurrence of historical production problems can be avoided.

[0108] Another embodiment of the present application provides a test case generation system, as shown in Figure 5 The system comprises:

[0109] The label extraction unit 501 is configured to identify and extract labels of each target dimension from the file of the historical production problem by using a natural language processing model. The target dimension at least includes a trigger module, a trigger scenario, a root cause analysis, a test point, and a solution.

[0110] The graph construction unit 502 is configured to construct a problem evolution knowledge graph based on a risk gene by using the labels. The risk gene is a set of essential characteristics of the historical production problem, and is composed of a technical gene defect and a business logic gene.

[0111] The project analysis unit 503 is configured to perform semantic analysis on a requirement file of a new project by using a BERT model to obtain requirement information of the new project when the new project exists.

[0112] The information retrieval unit 504 is configured to retrieve a risk gene corresponding to the new project and solution information from the problem evolution knowledge graph based on the requirement information of the new project.

[0113] The case generation unit 505 is configured to generate a test case of the new project by using the risk gene corresponding to the new project and the solution information.

[0114] Optionally, in the test case generation system provided in another embodiment of the present application, the label extraction unit comprises:

[0115] The label extraction sub-unit is configured to identify entities and keywords in the file of the historical production problem by using a natural language processing model, and extract labels from each target dimension based on the entities and keywords in the file of the historical production problem.

[0116] Optionally, in the test case generation system provided in another embodiment of the present application, the graph construction unit comprises:

[0117] The gene generation unit is configured to generate a risk gene of the historical production problem by using the labels.

[0118] The construction unit is configured to construct a problem evolution knowledge graph based on the risk gene and a gene variation relationship, and associate environmental pressure and an evolution path. The gene variation relationship is a relationship describing changes of the risk gene with versions and requirement iterations. The environmental pressure is generated based on the label of the trigger scenario. The evolution path is generated based on the solution.

[0119] Optionally, in the test case generation system provided in another embodiment of the present application, the project analysis unit comprises:

[0120] The preprocessing unit is configured to obtain a requirement file of a new project and perform preprocessing on the requirement file of the new project when the new project exists.

[0121] The demand information analysis unit is configured to perform demand text classification and keyword extraction on the demand document of the new project by using a BERT model, to obtain demand information of the new project.

[0122] Optionally, in the test case generation system provided in another embodiment of the present application, the information retrieval unit comprises:

[0123] The matching unit is configured to perform multi-dimensional matching of the demand information of the new project with each label, to obtain a label matching result.

[0124] The risk retrieval unit is configured to retrieve, based on an environmental stress parameter in the label matching result, a risk gene corresponding to the new project from the problem evolution knowledge graph.

[0125] The scheme retrieval unit is configured to retrieve, from the problem evolution knowledge graph, an optimal solution for the risk gene corresponding to the new project, to obtain solution information corresponding to the new project.

[0126] Optionally, in the test case generation system provided in another embodiment of the present application, the case generation unit comprises:

[0127] The case generation sub-unit is configured to fill the retrieved risk gene corresponding to the new project and the solution information into a test case template of a corresponding type, to generate a test case of the new project.

[0128] It should be noted that the specific working processes of the various units provided in the above embodiments of the present application can be correspondingly referred to the implementation processes of the corresponding steps in the above method embodiments, which will not be described here.

[0129] Another embodiment of the present application provides an electronic device, as shown in the figure, comprising: Figure 6

[0130] The memory 601 and the processor 602.

[0131] The memory 601 is configured to store a program.

[0132] The processor 602 is configured to execute the program stored in the memory 601, and the program, when executed, is specifically configured to implement the test case generation method provided in any one of the above embodiments.

[0133] Another embodiment of the present application provides a computer storage medium for storing a computer program, and the computer program, when executed by a processor, is configured to implement the test case generation method provided in any one of the above embodiments.

[0134] ​Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disks (DVDs) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information for access by a computing device. According to the definitions provided herein, computer readable media does not include transitory computer readable medium, such as a modulated data signal and a carrier wave.

[0135] Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality, without reference to a specific

[0136] The above description of disclosed embodiments provides information sufficient to understand how to make and use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Accordingly, the application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating test cases, characterized in that, include: The system uses a natural language processing model to identify historical production issues and extract tags for each target dimension. The target dimensions include at least the triggering module, triggering scenario, root cause analysis, test points, and solutions. A problem evolution knowledge graph based on risk genes is constructed using the various tags; wherein, the risk genes are the set of essential features of the historical production problems, composed of technological defects and business logic genes; Whenever a new project exists, semantic analysis of the new project's requirement document is performed using the BERT model to obtain the new project's requirement information. Based on the demand information of the new project, the risk genes and solution information corresponding to the new project are retrieved from the problem evolution knowledge graph; Using the risk genes and solution information corresponding to the retrieved new project, test cases for the new project are generated.

2. The method according to claim 1, characterized in that, The process of identifying historical production issues through a natural language processing model and extracting tags for each target dimension includes: The entity and keyword in the historical production problem document are identified by the natural language processing model, and the label is extracted from each target dimension based on the entity and keyword in the historical production problem document.

3. The method according to claim 1, characterized in that, The construction of a problem evolution knowledge graph based on risk genes using each of the aforementioned tags includes: The risk genes for the historical production problems are generated using each of the aforementioned tags; Based on the risk genes and their gene mutation relationships, a problem evolution knowledge graph based on the risk genes is constructed, and environmental pressure and evolutionary path are associated; wherein, the gene mutation relationship describes the relationship of the risk genes changing with version and requirement iteration; the environmental pressure is generated based on the tags of the triggering scenario; and the evolutionary path is generated based on the solution.

4. The method according to claim 1, characterized in that, Whenever a new project exists, semantic analysis of the new project's requirement document is performed using the BERT model to obtain the new project's requirement information, including: Whenever a new project exists, obtain the requirements document for the new project and preprocess it. The BERT model is used to classify the preprocessed requirements document of the new project and extract keywords to obtain the requirements information of the new project.

5. The method according to claim 1, characterized in that, The process of retrieving the risk genes and solution information corresponding to the new project from the problem evolution knowledge graph based on the new project's demand information includes: The requirements information of the new project are matched with each of the tags in a multi-dimensional manner to obtain the tag matching results; Based on the environmental pressure parameter in the tag matching results, the risk gene corresponding to the new project is retrieved from the problem evolution knowledge graph; The optimal solution for the risk gene corresponding to the new project is retrieved from the problem evolution knowledge graph, and the solution information corresponding to the new project is obtained.

6. The method according to claim 1, characterized in that, The step of generating test cases for the new project using the retrieved risk genes and solution information corresponding to the new project includes: The risk genes and solution information corresponding to the retrieved new project are filled into the corresponding type of test case template to generate test cases for the new project.

7. A test case generation system, characterized in that, include: The tag extraction unit is used to identify and extract tags for various target dimensions from files of historical production issues using a natural language processing model; wherein, the target dimensions include at least triggering modules, triggering scenarios, root cause analysis, test points, and solutions; The graph construction unit is used to construct a problem evolution knowledge graph based on risk genes using the various tags; wherein, the risk genes are the set of essential features of the historical production problems, which are composed of technical gene defects and business logic genes; The project analysis unit is used to perform semantic analysis on the requirement document of a new project using the BERT model whenever a new project exists, so as to obtain the requirement information of the new project. An information retrieval unit is used to retrieve the risk genes and solution information corresponding to the new project from the problem evolution knowledge graph based on the demand information of the new project; The case generation unit is used to generate test cases for the new project by using the risk genes and solution information corresponding to the retrieved new project.

8. The system according to claim 7, characterized in that, The tag extraction unit includes: The tag extraction subunit is used to identify entities and keywords in historical production problem files through a natural language processing model, and extract tags from each of the target dimensions based on the entities and keywords in the historical production problem files.

9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program, which, when executed, is specifically used to implement the test case generation method as described in any one of claims 1 to 6.

10. A computer storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, is used to implement the test case generation method as described in any one of claims 1 to 6.