Test case generation method and system and electronic equipment
By disassembling the software requirements information and processing the agent tool, combined with the distributed processing of the Agent agent module, the problems of high labor consumption, low quality, high cost and poor flexibility in the existing test case generation methods are solved, and the problem of high labor consumption, low quality, high cost and poor flexibility are achieved. Efficient and high-quality test case generation.
Patent Information
- Application Number
- CN202411211216.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-26
AI Technical Summary
The existing test case generation methods consume a lot of manpower and time, insufficient quality, high cost and poor flexibility, which affect the testing efficiency and quality.
By functionally disassembling the software requirements information of the target software, multiple groups of subtest cases are generated, and target test cases are determined based on these subtest cases, and formatted with proxy tools to ensure that the generated test cases meet the enterprise or business requirements. Use the Agent agent module for distributed processing to improve generation efficiency and accuracy.
It greatly reduces manpower investment in the process of generating test cases, saves costs and time, improves the quality and efficiency of test cases, increases flexibility for complex business logic and unscheduled rules, and ensures the correctness of test cases and Conformity.
Smart Images

Figure CN119025428A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of test case generation, and in particular to a test case generation method, system and electronic device. Background Art
[0002] During the automotive software development process, test cases are usually used to verify software functionality, performance, and safety to ensure software quality.
[0003] At present, the test cases generated by test engineers for executing tests mainly include manual writing and sorting methods and the use of digital systems to assist in manual automatic generation methods. Among them, in the manual writing and sorting method, the progress of writing test cases will be relatively slow, and test engineers may cause unreasonable design of test cases, errors or omissions of important test points due to negligence, misunderstanding or lack of experience. Therefore, the method of manually writing and sorting test cases has the problem of consuming a lot of manpower and time, insufficient quality of test cases, and affecting test efficiency and quality. For the many problems of manually writing and sorting test cases, some companies will self-develop or purchase digital systems to assist test engineers in generating test cases. The existing digital system generates test cases based on natural language processing (Natural Language Processing, NLP) technology and rule combination methods or large language model assisted methods to generate test cases. Among them, the method of generating test cases based on NLP and rules, with the complexity of business logic, the number of rules will increase sharply, and the digital system will become complicated and costly to add new rules or modify rules. Moreover, for complex business logic or requirements that have not been scheduled, the digital system will not be able to handle it and lose flexibility. On the other hand, the method of using large language models to assist in generating test cases has quality problems in engineering applications because the large language model will focus on a single task when directly applied, and the results generated by the large model are unstable and unexplainable. At this time, a large number of manual interventions are required to screen, review, and adjust the test cases, which also consumes a lot of manpower and time, leads to insufficient test case quality, and affects test efficiency and quality.
[0004] In summary, the existing test case generation methods have the problems of consuming a lot of manpower and time, insufficient test case quality, high cost and poor flexibility, which affect test efficiency and quality. Summary of the invention
[0005] The present application provides a test case generation method, system and electronic device for solving the problems of the test case generation method in the prior art, which consumes a lot of manpower and time, has insufficient test case quality, high cost and poor flexibility, and affects test efficiency and quality.
[0006] To solve the above technical problems, in the first aspect, the implementation method of the present application discloses a test case generation method, which includes: obtaining software requirement information of the target software; identifying and processing the software requirement information to determine at least one target requirement function included in the software requirement information; determining multiple groups of first test cases corresponding to the target software according to the target requirement functions, the first test cases including sub-test cases corresponding to each target requirement function; determining the target test cases corresponding to the target software according to the multiple groups of first test cases.
[0007] By adopting the above technical scheme, in the process of generating test cases, the software requirement information of the target software is firstly subjected to functional decomposition processing to obtain multiple target requirement functions included in the software requirement information. Then, according to the target requirement functions, multiple groups of first test cases corresponding to the target software including sub-test cases corresponding to each target requirement function are obtained, and finally, the target test cases corresponding to the target software are determined from multiple groups of first test cases. That is, in the process of generating test cases, the complete requirement document (i.e., software requirement information) is cut, and after cutting, the sub-functions are decomposed according to the itemized requirements to obtain multiple target requirement functions, which minimizes the segmentation requirements and simplifies the single input of the test case generation model (i.e., the original input is split from the entire software requirement information into multiple small target requirement functions, and each target requirement function is used as a single input of the model), preventing the model from being interfered by irrelevant requirement contexts, and improving the correctness of the output of the large model content (i.e., test cases). Thus, the problem of poor quality of the test cases obtained due to the instability of the process of generating test cases can be effectively avoided. In addition, test case generation based on this method greatly reduces the manpower input in the test case generation process, saves manpower cost and time, improves the test case generation efficiency, and can obtain test cases with higher quality, thereby effectively improving test efficiency and quality.
[0008] Furthermore, the test case generation process can first obtain sub-test cases according to each target requirement function, and then obtain the target test case according to the sub-test cases. In other words, complex business logic can be broken down into multiple functions for processing, which increases the flexibility of test case generation; for requirements with unreserved rules, it is only necessary to break down the content of this part of the requirement and analyze and process it separately, which will not affect the generation of test cases corresponding to other existing requirements (such as target requirement functions). Therefore, this test case generation method has good flexibility for complex business logic and requirements with unreserved rules.
[0009] According to another specific implementation of the present application, the implementation of the present application discloses a test case generation method, which determines the target test case corresponding to the target software based on multiple groups of first test cases, including: determining the second test case based on the multiple groups of first test cases; formatting and adapting the second test case to obtain the target test case corresponding to the target software.
[0010] By adopting the above technical solution, the test case generation result (i.e., the second test case) is formatted through the proxy tool. The generation result can be formatted using the tool according to different enterprise or business requirements, and the final result can be obtained according to the enterprise or business requirements, thereby obtaining a test case that better meets the requirements and improving the test case generation efficiency.
[0011] According to another specific implementation of the present application, the implementation of the present application discloses a test case generation method, which determines a second test case based on multiple groups of first test cases, including: determining a target score for each first test case; and selecting the first test case with the highest target score as the second test case.
[0012] By adopting the above technical scheme, in the process of generating test cases, multiple groups of first test cases are first determined, and then the target scores of each first test case are determined according to the content of the first test case, and the first test case with the highest target score is selected as the second test case. That is, the test case with relatively optimal quality (i.e., the second test case) can be obtained, thereby effectively improving the test efficiency and quality.
[0013] According to another specific implementation of the present application, the implementation of the present application discloses a test case generation method, which identifies and processes software requirement information to determine at least one target requirement function included in the software requirement information, including: according to a preset identification algorithm, cutting and processing the software requirement information to obtain multiple initial requirement functions; when it is determined that the initial requirement function meets the functional comprehensiveness and consistency conditions, determining the initial requirement function as the target requirement function.
[0014] By adopting the above technical solution, the software requirement information is segmented and processed according to the preset recognition algorithm to obtain multiple initial requirement functions, and the minimum segmentation requirements (i.e., initial requirement functions) of the software requirement information can be obtained. Moreover, when it is determined that the initial requirement functions meet the functional comprehensiveness and consistency conditions, the initial requirement functions are determined as the target requirement functions, thereby improving the accuracy of the target requirement function decomposition.
[0015] According to another specific implementation of the present application, the implementation of the present application discloses a test case generation method, which also includes: when it is determined that the initial requirement function does not meet the functional comprehensiveness and consistency conditions, generating feedback information for re-identifying and processing the software requirement information to determine at least one target requirement function included in the software requirement information.
[0016] By adopting the above technical solution, when it is determined that the initial requirement functions do not meet the functional comprehensiveness and consistency conditions, feedback information is generated, the software requirement information is re-identified and processed, and multiple target requirement functions included in the software requirement information are determined. This circular feedback mechanism ensures that the target requirement functions finally obtained meet the functional comprehensiveness and consistency conditions, thereby improving the accuracy of the target requirement function decomposition.
[0017] According to another specific implementation of the present application, the implementation of the present application discloses a test case generation method, which also includes determining the sub-test cases corresponding to each target requirement function in the following manner: according to the target information of the target requirement function, parameterizing and filling the preset initial test cases to obtain sub-test cases.
[0018] The above technical solution can meet different functional conditions and scenarios of the target required functions and generate specific sub-test cases.
[0019] According to another specific implementation of the present application, the implementation of the present application discloses a test case generation method, wherein the multiple groups of first test cases include three groups of first test cases, and each first test case includes different sub-test cases.
[0020] By adopting the above technical solution, the target test cases corresponding to the target software are selected from the three groups of first test cases generated, so that the obtained target test cases are relatively optimal, which effectively improves the test efficiency and quality.
[0021] On the second aspect, the implementation method of the present application also discloses a test case generation system, including: a functional decomposition module, used to obtain software requirement information of the target software, identify and process the software requirement information, and determine at least one target requirement function included in the software requirement information; a use case generation module, used to determine multiple groups of first test cases corresponding to the target software according to the target requirement functions, and determine second test cases according to the multiple groups of first test cases, the first test cases including sub-test cases corresponding to each target requirement function; a formatting module, used to format and adapt the second test case to obtain a target test case corresponding to the target software.
[0022] In the third aspect, the implementation method of the present application also discloses an electronic device, including: a processor, and a memory connected to the processor for communication; the memory stores a computer program; the processor executes the computer program stored in the memory, so that the electronic device implements the test case generation method provided in any one of the implementation methods of the first aspect above.
[0023] In a fourth aspect, the implementation method of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the test case generation method provided in any one of the implementation methods of the first aspect above.
[0024] In a fifth aspect, an implementation of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements a test case generation method as provided in any one of the implementations of the first aspect above.
[0025] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can also be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a structural diagram of a test case generation system provided in an embodiment of the present application;
[0027] Figure 2 It is a structural diagram of another test case generation system provided in an embodiment of the present application;
[0028] Figure 3 It is a flowchart of a test case generation method provided in an embodiment of the present application;
[0029] Figure 4 It is a flowchart of another test case generation method provided in an embodiment of the present application;
[0030] Figure 5 It is a flowchart of determining a target test case corresponding to a target software according to a plurality of groups of first test cases provided by an embodiment of the present application;
[0031] Figure 6 It is a flowchart of determining a second test case according to multiple groups of first test cases provided by an embodiment of the present application;
[0032] Figure 7 It is a flowchart of determining at least one target requirement function included in software requirement information provided by an embodiment of the present application;
[0033] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0034] Specific implementation method
[0035] As mentioned above, the existing test case generation methods have the problems of consuming a lot of manpower and time, insufficient test case quality, high cost and poor flexibility, which affect the test efficiency and quality.
[0036] Based on this, the implementation of the present application provides a test case generation method. In the test case generation process, the software requirement information of the target software is first functionally decomposed to obtain multiple target requirement functions included in the software requirement information. Then, according to the target requirement functions, multiple groups of first test cases corresponding to the target software including sub-test cases corresponding to each target requirement function are obtained, and finally, the target test cases corresponding to the target software are determined from the multiple groups of first test cases. The test case generation process greatly reduces the manpower input, saves manpower cost and time, improves the test case generation efficiency, and can obtain test cases with better quality, thereby effectively improving the test efficiency and quality.
[0037] Next, in conjunction with the accompanying drawings, the test case generation method and system provided by the implementation of the present application are described in detail.
[0038] In one implementation of the present application, the test case generation method provided in the implementation of the present application is applied to a test case generation system, such as Figure 1 As shown, the test case generation system includes:
[0039] The function decomposition module is used to obtain software requirement information of the target software, identify and process the software requirement information, and determine at least one target requirement function included in the software requirement information.
[0040] The use case generation module is used to determine multiple groups of first test cases corresponding to the target software according to the target requirement functions, and determine the second test cases according to the multiple groups of first test cases. The first test cases include sub-test cases corresponding to each target requirement function.
[0041] The formatting module is used to perform formatting and adaptation processing on the second test case to obtain a target test case corresponding to the target software.
[0042] In one implementation of the present application, the test case generation system provided by the present application can be a distributed test case generation system based on a multi-solver (Multi-Agent), which can include a functional module (i.e., a functional decomposition module), a use case module (i.e., a use case generation module), and a formatting module. Among them, the functional module uses a functional solver (i.e., a functional agent) agent to realize the analysis of the software system requirements and complete the sub-function disassembly of each part of the system (i.e., obtain the software requirement information of the target software, identify and process the software requirement information, and determine at least one target requirement function included in the software requirement information). The use case module uses a use case solver (i.e., a use case agent) agent and a scoring solver (i.e., an agent) agent to cooperate with each other to jointly complete the generation of use cases with better quality (i.e., determine multiple groups of first test cases corresponding to the target software according to the target requirement function, and determine the second test case according to multiple groups of first test cases). The formatting module uses a tool solver (i.e., a tool agent) agent to realize the formatting of the generated results. According to different enterprise or business requirements, the generated results can be formatted using tools to obtain the final results according to the enterprise or business requirements.
[0043] Furthermore, in one implementation of the present application, the function module may also include an expert solver (i.e., expert Agent) agent, which is used to judge the decomposed function points (i.e., target requirement functions). The expert Agent agent can judge the function comprehensiveness and consistency conditions of the function points through the semantic understanding ability of the large language model, ensuring the integrity and consistency of the decomposed sub-function points.
[0044] Furthermore, in one implementation of the present application, the use case Agent can use the reasoning ability of the large language model, Chain-of-Thought (COT) and other capabilities to generate test cases, but due to the uncertainty of its output, the quality of the generated test cases is uneven. Therefore, the use case Agent generates three test cases each time, and then the scoring solver (i.e., the scoring Agent) scores the three generated test cases. The test case with the highest score will be output as the optimal case.
[0045] That is, in one implementation of the present application, Figure 2 As shown, the test case generation system provided by the present application can also be called a distributed test case generation system, including a functional module, a use case module, and a formatting module. Among them, the functional module includes a functional agent and an expert agent, the use case module includes a use case agent and a scoring agent, and the formatting module includes a tool agent.
[0046] In one implementation of the present application, Figure 3 As shown, based on the above-mentioned distributed test case generation system, the modules will input the software requirements through the function module input end, the function module output end will be used as the input end of the use case module, the output end of the use case module will be used as the input end of the formatting module, and the output of the formatting module will be output as the End Result. The test case generation method includes the following steps:
[0047] Step 1: In the functional module, the software requirement document (i.e., software requirement information) of the target software, which is mainly text, is imported into the functional agent. The functional agent will use predefined rules or pattern recognition algorithms to cut the complete software requirement document, and then decompose it into sub-functions according to the itemized requirements to obtain multiple sub-functions (i.e., target requirement functions, such as sub-function 1, ..., sub-function N). The output multiple sub-functions (sub-function 1, ..., sub-function N) will be sent to the expert agent for evaluation.
[0048] The expert agent will evaluate the comprehensiveness and consistency of the decomposed sub-functions. If the expert agent's evaluation results show that the sub-functions are comprehensive and consistent, these sub-functions will be automatically transferred to the use case module for the next step of use case design and development. If the expert agent's evaluation results show that there are problems with the sub-function decomposition, such as being incomplete or inconsistent with the original requirement document, the expert agent will summarize the evaluation result information and send it back to the functional agent as evaluation feedback. The functional agent will re-decompose the sub-functions based on the expert agent's feedback information. After the re-decomposed sub-functions are generated, they will be sent to the expert agent for evaluation again. This circular feedback mechanism will continue until the sub-function evaluation is passed, that is, sub-functions 1, ..., sub-function N all meet the comprehensiveness and consistency evaluation.
[0049] In this way, through the text parsing and summarizing capabilities of the functional agent, the software requirement documents described in natural language can be identified and understood, functional decomposition can be performed, and sub-function points in the software requirements can be identified and output, which can minimize the segmentation requirements, simplify the single input of the model when the large model is performing sub-function decomposition, prevent the model from being disturbed by irrelevant requirement contexts, and improve the correctness of the content output of the large model. In addition, the loop feedback mechanism of the expert agent can improve the accuracy of the decomposition of sub-function points of software requirements. At the same time, in this loop feedback mechanism, the functional agent and the expert agent can efficiently and repeatedly perform process-based and automated operations, greatly shortening the work of manual document review, function point decomposition, offline review, and document rework and modification, improving the efficiency in the actual workflow, and thus improving the efficiency of test case generation.
[0050] Step 2: The use case module obtains the sub-functions judged by the expert agent, and generates parameterized initial test cases according to the requirements of the sub-functions (i.e., target information) to generate specific test cases. The specific use case agent will generate three groups of test cases (i.e., multiple groups of first test cases), such as use case 1, ..., use case N generated for the first time, use case 1, ..., use case N generated for the second time, and use case 1, ..., use case N generated for the third time. The three groups of test cases include use cases 1, ..., and use case N that are not exactly the same. The three groups of test cases generated are input to the scoring agent, which scores the three generated test cases according to the use case generation criteria, and selects the use case with the highest score as the relatively optimal use case output (i.e., the second test case), and enters the formatting module. Among them, the use case generation criteria can be, for example, whether the generated use case covers forward testing, reverse testing, boundary testing, and abnormal testing conditions.
[0051] In this way, different functional conditions and scenarios of sub-functions can be met, specific test cases can be generated, and relatively optimal case outputs can be obtained and enter the formatting module.
[0052] Step 3: After the formatting module obtains the second test case, the Tool Agent agent is used to perform formatting and adaptation processing on the generated second test case to obtain the target test case (ie, End Result) of the target software.
[0053] In this way, the generated result (i.e., the second test case) can be formatted using the Tool Agent. According to different enterprise or business requirements, the generated result can be formatted using the tool, and the final result can be obtained according to the enterprise or business requirements. This can obtain a test case that better meets the requirements and improve the test case generation efficiency.
[0054] like Figure 4 As shown, in one implementation of the present application, the test case generation method provided by the present application specifically includes the following steps:
[0055] S100: Acquire software requirement information of the target software, the software requirement information being, for example, the aforementioned software requirement document, or other forms of software requirement information.
[0056] S200: Identify and process the software requirement information to determine at least one target requirement function included in the software requirement information.
[0057] For example, the software requirement information document is segmented using predefined rules or pattern recognition algorithms to obtain multiple sub-functions (ie, target requirement functions).
[0058] S300: Determine a plurality of groups of first test cases corresponding to the target software according to the target requirement functions, wherein the first test cases include sub-test cases corresponding to the target requirement functions.
[0059] For example, the aforementioned test case Agent is used to generate three groups of test cases. Of course, four groups, five groups, etc. can also be generated, and the specific number is set according to needs.
[0060] S400: Determine target test cases corresponding to the target software according to the multiple groups of first test cases.
[0061] Specifically, the target test case can be directly determined from multiple groups of first test cases through the aforementioned scoring strategy, or the second test case can be determined from multiple groups of first test cases through the aforementioned scoring strategy, and then formatted to obtain the target test case, or other selection strategies can be adopted to determine the target test case corresponding to the target software from multiple groups of first test cases.
[0062] That is, in one implementation of the present application, Figure 5 As shown, determining target test cases corresponding to target software according to multiple groups of first test cases includes the following steps:
[0063] S410: Determine a second test case according to multiple groups of first test cases.
[0064] S420: Perform formatting and adaptation processing on the second test case to obtain a target test case corresponding to the target software.
[0065] In one implementation of the present application, Figure 6 As shown, determining the second test case according to multiple groups of first test cases includes the following steps:
[0066] S411: Determine a target score for each first test case.
[0067] S412: Select the first test case with the highest target score as the second test case.
[0068] For example, the scoring agent scores the three test cases generated according to the use case generation criteria. The three test cases include use cases 1, ..., and N, which are not exactly the same, and selects the use case with the highest score as the relatively optimal use case output (i.e., the second test case).
[0069] In one implementation of the present application, Figure 7 As shown, identifying and processing the software requirement information to determine at least one target requirement function included in the software requirement information includes the following steps:
[0070] S210: According to a preset recognition algorithm, the software requirement information is segmented and processed to obtain a plurality of initial requirement functions.
[0071] S220: When it is determined that the initial requirement function meets the functional comprehensiveness and consistency conditions, the initial requirement function is determined as the target requirement function.
[0072] For example, the aforementioned expert agent evaluates the comprehensiveness and consistency of the decomposed sub-functions. If the expert agent's evaluation results show that the sub-functions are comprehensive and consistent, these sub-functions will be automatically transferred to the use case module for the next step of use case design and development, that is, the generation of test cases.
[0073] In one implementation of the present application, the method further includes: when it is determined that the initial requirement function does not meet the functional comprehensiveness and consistency conditions, generating feedback information for re-identifying and processing the software requirement information to determine at least one target requirement function included in the software requirement information.
[0074] For example, if the evaluation results of the aforementioned expert agent show that there are problems with the sub-function decomposition, such as being incomplete or inconsistent with the original requirement document, the expert agent will summarize the evaluation result information and send it back to the functional agent as evaluation feedback. The functional agent will re-decompose the sub-function according to the feedback information of the expert agent.
[0075] In one implementation of the present application, the method further includes: determining the sub-test cases corresponding to each target requirement function by: performing parameterized filling processing on the preset initial test cases according to the target information of the target requirement function to obtain the sub-test cases. The target information of the target requirement function may be the key information for generating the test cases corresponding to the sub-functions, and the preset initial test cases may be, for example, a test case generation template. According to the key information corresponding to the sub-functions, the parameters in the test case generation template may be filled to obtain the sub-test cases corresponding to the sub-functions.
[0076] The test case generation method provided in this application is based on the distributed architecture of Agent agents. Functional agents, expert agents, use case agents, and scoring agents are both independent and collaborative with each other to complete the real-time generation, analysis, and scoring of software test cases, forming a business closed loop of "software requirement analysis-functional point decomposition-multiple generation of test cases-use case scoring-format adaptation processing", which can achieve high-quality software test case generation.
[0077] The distributed software test case generation system based on Multi-Agent provided by this application can solve the problems of uneven quality and low efficiency of manually written test cases, and can also make up for the high maintenance cost and lack of flexibility of rule-based generation systems. Its modular design, collaborative work and distributed processing make the overall test case generation system more flexible, easier to maintain and upgrade, and can effectively solve or improve the shortcomings of the existing technology.
[0078] The distributed software test case generation system based on Multi-Agent provided by the present application is different from the system design concept and implementation mechanism of the system based on NLP combined with rule algorithm and single-task large language model system. The distributed software test case generation system based on Multi-Agent provided by the present application is composed of multiple Agent agent modules with certain intelligence and autonomy. Multiple Agent agent modules can split the task process based on the understanding of the test case generation task, gradually complete the process task, and systematically score or judge the process results at key links to ensure the accuracy of the final task results. Based on the NLP combined with rule algorithm, natural language processing technology is combined with a series of predefined rules to process and generate text information. The single-task large language model will rely on the text understanding and generation capabilities of the large language model, and can be combined with retrieval-augmented generation (RAG) or supervised fine-tuning (SFT) and other technologies to optimize the generation results, but due to the unexplainability of the large language model itself and hallucinations, it is necessary to rely on more manpower to intervene and debug the generated content.
[0079] The design and implementation method of the distributed test case generation system based on Multi-Agent provided in this application is composed of multiple Agent agents with certain intelligence and autonomy. Each Agent agent will focus on a specific task or field and can solve complex problems through collaboration, thereby making up for the shortcomings of single-agent solutions or rule-based algorithms for large language models. At the same time, multiple modules in the system are independent and autonomous. Each module can add more Agent agents or optimize the algorithm of each Agent agent as the demand changes, and its scalability is also stronger.
[0080] The Multi-Agent-based distributed test case generation system provided in this application can reduce the cost and increase the efficiency of test case generation in the software development field (such as the automotive software development field). Through this system, higher quality test cases can be produced, and at the same time, the work cycle can be greatly shortened, and the test case generation efficiency can be improved, thereby effectively improving the testing efficiency and quality.
[0081] In another implementation of the present application, the automobile safety risk analysis method of the present application can be applied to electronic devices.
[0082] Among them, the automobile safety risk analysis method can be applied to electronic devices such as computers. Figure 8 , Figure 8 The figure shows a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device may include: a transceiver 121 , a processor 122 , and a memory 123 .
[0083] The processor 122 executes the computer execution instructions stored in the memory, so that the processor 122 executes part of the technical solutions of the test case generation method in the above embodiment. The processor 122 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital data processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0084] The memory 123 is connected to the processor 122 via a system bus and completes communication between them. The memory 123 is used to store computer program instructions.
[0085] By way of example and not limitation, the memory 123 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 123 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 123 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 123 is a non-volatile solid-state memory. In a particular embodiment, the memory 123 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.
[0086] The transceiver 121 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.
[0087] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.
[0088] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the test case generation method in the above embodiment.
[0089] An embodiment of the present application also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a processor of an electronic device, the processor of the electronic device executes the technical solution of the test case generation method of the above embodiment.
[0090] In some possible implementations, various aspects of the method provided in the present application can also be implemented in the form of a program product, which includes program code. When the program product runs on a processor of an electronic device, the program code is used to enable the processor of the electronic device to execute the steps of the method described above in this specification according to various exemplary implementations of the present application. For example, the electronic device can execute the test case generation method recorded in the embodiments of the present application.
[0091] The program product may employ any combination of one or more readable media. The readable medium may be a readable data medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0092] The implementation method of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the test case generation method in the above embodiment.
[0093] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable information processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable information processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0094] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable information processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0095] These computer program instructions can also be loaded onto a computer or other programmable information processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0096] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0097] It should be noted that, in addition to the implementation of the present application described in the above-mentioned specific embodiments, those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Although the description of the present application is introduced in conjunction with the preferred embodiment, this does not mean that the features of this invention are limited to the implementation. On the contrary, the purpose of introducing the invention in conjunction with the implementation is to cover other options or modifications that may extend based on the claims of the present application. In order to provide an in-depth understanding of the present application, the above description contains many specific details, and the present application may also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present application, some specific details will be omitted in the description. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0098] It should be noted that in this specification, similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0099] Although the present application has been illustrated and described by referring to certain preferred implementations of the present application, it should be understood by those skilled in the art that the above contents are further detailed descriptions of the present application in combination with specific implementations, and it cannot be determined that the specific implementation of the present application is limited to these descriptions. Those skilled in the art may make various changes in form and details, including making several simple deductions or substitutions, without departing from the spirit and scope of the present application.
Claims
1. A test case generation method, characterized in that: The method comprises: Obtain software requirement information of target software; Identify and process the software requirement information to determine at least one target requirement function included in the software requirement information; Determine a plurality of groups of first test cases corresponding to the target software according to the target requirement function, wherein the first test cases include sub-test cases corresponding to each of the target requirement functions; A target test case corresponding to the target software is determined according to the multiple groups of first test cases.
2. The test case generation method according to claim 1, characterized in that: Determining target test cases corresponding to the target software according to the multiple groups of first test cases includes: Determine a second test case according to the plurality of groups of first test cases; The second test case is formatted and adapted to obtain a target test case corresponding to the target software.
3. The test case generation method according to claim 2, characterized in that: Determining a second test case according to the plurality of groups of first test cases comprises: determining a target score for each of the first test cases; The first test case with the highest target score is selected as the second test case.
4. The test case generation method according to any one of claims 1 to 3, characterized in that: The software requirement information is identified and processed to determine at least one target requirement function included in the software requirement information, including: According to a preset recognition algorithm, the software requirement information is segmented and processed to obtain a plurality of initial requirement functions; When it is determined that the initial requirement function meets the functional comprehensiveness and consistency conditions, the initial requirement function is determined to be the target requirement function.
5. The test case generation method according to claim 4, characterized in that: The method further comprises: When it is determined that the initial required function does not meet the functional comprehensiveness and consistency conditions, feedback information is generated for re-identifying and processing the software requirement information to determine at least one target required function included in the software requirement information.
6. The test case generation method according to any one of claims 1 to 5, characterized in that: The method further includes determining the sub-test cases corresponding to each of the target requirement functions in the following manner: According to the target information of the target requirement function, parameter filling processing is performed on the preset initial test case to obtain the sub-test case.
7. The test case generation method according to any one of claims 1 to 6, characterized in that: The multiple groups of first test cases include three groups of first test cases, and each of the first test cases includes different sub-test cases.
8. A test case generation system, characterized in that: include: A function decomposition module, used to obtain software requirement information of the target software, identify and process the software requirement information, and determine at least one target requirement function included in the software requirement information; A case generation module, used to determine a plurality of groups of first test cases corresponding to the target software according to the target requirement functions, and determine a second test case according to the plurality of groups of first test cases, wherein the first test case includes sub-test cases corresponding to each of the target requirement functions; The formatting module is used to perform formatting and adaptation processing on the second test case to obtain a target test case corresponding to the target software.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores a computer program; The processor executes the computer program stored in the memory so that the electronic device implements the test case generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program; When the computer program is executed by a processor, it is used to implement the test case generation method as described in any one of claims 1 to 7.
Citation Information
Cited By
Test case generation method and device
CN120973690A
Test case generation method and device, equipment and computer program product
CN121070344A
