Test case generation method and device, equipment and storage medium
By configuring test case rules and using big models to generate test case collections, the problem of low efficiency in traditional test case design is solved, automated test case generation is realized, testing efficiency and accuracy are improved, and software requirements are adapted to changes.
Patent Information
- Application Number
- CN202411168893.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-31
AI Technical Summary
Traditional test case design relies on manual experience and manual operations, resulting in low efficiency in test case generation, especially when software requirements change frequently, it is difficult to respond quickly and improve test efficiency.
By obtaining product requirements information, configuring test case rules, including test case algorithms and algorithm auxiliary data, using large models and preset prompt information to generate test case collections, combining test case design methods to generate guide words, and automatically generate test cases, thereby improving testing Use case generation efficiency.
It realizes automated test case generation, improves the efficiency and accuracy of test case generation, reduces manual intervention, and quickly responds to software requirements changes.
Smart Images

Figure CN119226146A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of software testing technology, and in particular, to a test case generation method, apparatus, device, and storage medium. Background Art
[0002] In the process of software product development, it is necessary to write test cases to test the software code to determine whether the software code meets the software requirements of the software product. With the development of Internet technology, software systems are becoming more and more complex, and the scope and depth of software testing are also increasing.
[0003] Traditional test case design relies on human experience and manual operations. R&D personnel need to invest a lot of time and energy to manually write and maintain test cases. This problem is particularly prominent when software requirements change frequently, resulting in low test case generation efficiency. Summary of the invention
[0004] The embodiments described herein provide a test case generation method, apparatus, device, and storage medium, which can improve the test case generation efficiency and thus improve the testing efficiency.
[0005] In a first aspect, the present disclosure provides a test case generation method, comprising:
[0006] Acquire product requirement information; configure test case rules according to the product requirement information, wherein the test case rules include test case algorithms and algorithm auxiliary data; generate a first test case set and a second test case set according to the product requirement information and the configured test case rules, wherein the first test case set includes multiple first test cases and the second test case set includes multiple second test cases; generate test case results according to the first test case set and the second test case set.
[0007] In some embodiments of the present disclosure, generating a first test case set and a second test case set according to the product requirement information and the configured test case rules includes:
[0008] Based on the big model, the first test case set is generated according to the product requirement information and preset prompt information; and the second test case set is generated according to the configured test case algorithm and the algorithm auxiliary data.
[0009] In some embodiments of the present disclosure, generating the first test case set based on the big model according to the product requirement information and preset prompt information includes:
[0010] Generate guide words according to the product requirement information and the preset prompt information; and generate the first test case set according to the guide words based on the large model.
[0011] In some embodiments of the present disclosure, the test case rules also include a test case design method, and the guide words include general guide words and special guide words.
[0012] The generating of the guide words according to the product demand information and the preset prompt information includes:
[0013] The general guide words are generated according to the product requirement information and the preset prompt information; the special guide words are generated according to the product requirement information and the configured test case design method.
[0014] In some embodiments of the present disclosure, generating test case results according to the first test case set and the second test case set includes:
[0015] All the first test cases in the first test case set and all the second test cases in the second test case set are determined as target test cases; and the target test cases are converted into readable documents to generate the test case results.
[0016] In some embodiments of the present disclosure, the preset prompt information includes roles, capabilities, product requirement input, expectations, professional requirements, sample prompts, output formats, and thinking processes.
[0017] In some embodiments of the present disclosure, the test case design method includes at least one of an equivalence class partitioning method, a boundary value analysis method, a cause-and-effect diagram method, an error guessing method, a decision table method, an orthogonal table method, an output domain coverage method, a flowchart method, and a state transition method.
[0018] The test case algorithm includes at least one of a boundary value algorithm, a decision table algorithm, an orthogonal table algorithm, a flow chart algorithm, a state transition algorithm and a cause-effect diagram algorithm.
[0019] In a second aspect, the present disclosure provides a test case generation device, comprising:
[0020] The acquisition module is used to obtain product demand information.
[0021] A configuration module is used to configure test case rules according to the product requirement information, wherein the test case rules include a test case algorithm and algorithm auxiliary data.
[0022] A generation module is used to generate a first test case set and a second test case set according to the product requirement information and the configured test case rules, and generate test case results according to the first test case set and the second test case set; the first test case set includes multiple first test cases, and the second test case set includes multiple second test cases.
[0023] In a third aspect, the present disclosure provides an electronic device, comprising a processor, wherein the processor is configured to execute a computer program stored in a memory, wherein the computer program, when executed by the processor, implements the steps of any one of the methods provided in the first aspect.
[0024] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any method provided in the first aspect are implemented.
[0025] In the technical solution provided by the present invention, by acquiring product requirement information, configuring test case rules according to the product requirement information, generating a first test case set and a second test case set according to the product requirement information and the configured test case rules, and generating test case results according to the first test case set and the second test case set, test cases can be automatically generated, thereby improving the test case generation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure, wherein:
[0027] Figure 1 A flow chart of a test case generation method provided by an embodiment of the present disclosure;
[0028] Figure 2 A flowchart of another test case generation method provided by an embodiment of the present disclosure;
[0029] Figure 3 A flowchart of another test case generation method provided by an embodiment of the present disclosure;
[0030] Figure 4 A flowchart of another test case generation method provided by an embodiment of the present disclosure;
[0031] Figure 5 A schematic diagram of the structure of a test case generation device provided by an embodiment of the present disclosure;
[0032] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.
[0034] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which the subject matter of the present disclosure belongs. It will be further understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meanings in the context of the specification and the relevant art, and will not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. In addition, terms such as "first" and "second" are only used to distinguish one component (or a portion of a component) from another component (or another portion of a component).
[0035] Figure 1 A flow chart of a test case generation method provided by an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the specific steps of the test case generation method include:
[0036] S101, obtaining product demand information.
[0037] For example, during the software product development process, the user needs to write a test document for the software product, namely a product requirement PRD document. The PRD document includes product requirement information, and the product requirement information of the tested software can be obtained by parsing the PRD document.
[0038] The PRD document can be generated based on the same template, and the corresponding product requirement information can be obtained by inputting the PRD document into the requirement analysis model. Alternatively, the PRD document can be manually read to obtain the corresponding product requirement information.
[0039] S102: Configure test case rules according to product requirement information.
[0040] Among them, the test case rules include test case algorithms and algorithm auxiliary data.
[0041] Exemplarily, the test case algorithm includes at least one of a boundary value algorithm, a decision table algorithm, an orthogonal table algorithm, a flowchart algorithm, a state transition algorithm, and a causal graph algorithm, and the algorithm auxiliary data may be a boundary value, a median, an outlier, or other special value of a numerical range.
[0042] It is necessary to select at least one test case algorithm that matches the product requirement information from the test case algorithm library. The test case algorithm library here includes boundary value algorithm, decision table algorithm, orthogonal table algorithm, flowchart algorithm, state transition algorithm and cause-effect diagram algorithm.
[0043] In addition, it is also necessary to determine the corresponding algorithm auxiliary data based on the product requirement information and the selected test case algorithm to complete the configuration of the test case rules.
[0044] S103, generating a first test case set and a second test case set according to product requirement information and configured test case rules.
[0045] The first test case set includes multiple first test cases, and the second test case set includes multiple second test cases.
[0046] Exemplarily, some of the first test cases in the first test case set are the same as some of the second test cases in the second test case set, that is, the first test case set and the second test case set have an intersection. Alternatively, each first test case in the first test case set is different from all the second test cases in the second test case set, that is, the first test case set and the second test case set do not have an intersection.
[0047] Product requirement information and configured test case rules can be input into two different large models, a first test case set is generated based on one of the large models, and a second test case set is generated based on the other large model. The two different large models can be different hyperparameter configurations of the same model or different models.
[0048] In other implementations, different first test case algorithms and second test case algorithms may be configured according to product requirement information, and algorithm auxiliary data may be set for the first test case algorithm and the second test case algorithm, respectively. A first test case set is generated based on the first test case algorithm and the corresponding algorithm auxiliary data, and a second test case set is generated based on the second test case algorithm and the corresponding algorithm auxiliary data.
[0049] S104: Generate test case results according to the first test case set and the second test case set.
[0050] Exemplarily, all first test cases in the first test case set and all second test cases in the second test case set can be determined as target test cases, and the target test cases can be converted into readable documents, such as Excel documents, Word documents, or TXT documents, to generate test case results. In this way, the test case results include all first test cases and all second test cases, which can expand the test scenario and improve the completeness of the test.
[0051] In other embodiments, all test cases in the intersection of the first test case set and the second test case set may be determined as target test cases to generate test case results. In this way, the test case results include all first test cases in the first test case set that are identical to the second test case, or the test case results include all second test cases in the second test case set that are identical to the first test case, which can improve the accuracy of the test cases.
[0052] In the embodiments of the present disclosure, by acquiring product requirement information, configuring test case rules according to the product requirement information, generating a first test case set and a second test case set according to the product requirement information and the configured test case rules, and generating test case results according to the first test case set and the second test case set, test cases can be automatically generated, thereby improving the test case generation efficiency.
[0053] In some embodiments, Figure 2 A flowchart of another test case generation method provided by an embodiment of the present disclosure is provided. Figure 2 for Figure 1 Based on the illustrated embodiment, a possible implementation method for executing S103 is specifically described as follows:
[0054] S201, based on the big model, generating a first test case set according to product requirement information and preset prompt information.
[0055] Exemplarily, the preset prompt information includes roles, capabilities, product requirement input, expectations, professional requirements, emphasis, sample prompts, output format and thought process. For example, the professional requirements may be ISO9126 and / or IEC2500 quality models.
[0056] For example, the thought process might include the following steps:
[0057] The first step is to understand product requirements.
[0058] The second step is to determine the type of testing based on the understanding of product requirements using the ISO9126 and / or IEC2500 quality model.
[0059] The third step is to use the skeptical mindset of testing to analyze user scenarios.
[0060] The fourth step is to dig deep into the test points of each scenario and maintain a high degree of skepticism about product demand input.
[0061] The fifth step is to conduct in-depth verification on the test points using at least one of equivalence classes, boundary values, causal diagrams, error speculation, decision tables, orthogonal tables, output domain coverage, flowcharts, and state transition methods.
[0062] Figure 3 A flowchart of another test case generation method provided by an embodiment of the present disclosure is provided. Figure 3 for Figure 2 Based on the illustrated embodiment, a possible implementation method for executing S201 is specifically described as follows:
[0063] S301, generating guide words according to product demand information and preset prompt information.
[0064] Exemplarily, the product demand information and the preset prompt information may be input into a guide word generation algorithm, or the product demand information may be input into a guide word generation algorithm, and the guide word generation algorithm is provided with the preset prompt information. The guide word generation algorithm may generate a plurality of guide words, i.e., a set of guide words, according to the preset prompt information and the received product demand information.
[0065] In other embodiments, the product demand information and the preset prompt information may be simultaneously input into multiple guide word generation algorithms, or the product demand information may be input into multiple guide word generation algorithms, and the multiple guide word generation algorithms are all provided with preset prompt information. Each guide word generation algorithm generates a set of guide words according to the preset prompt information and the received product demand information, thereby obtaining multiple sets of guide words.
[0066] S302, based on the large model, generate a first test case set according to the guide words.
[0067] Exemplarily, if a set of guide words is obtained when executing S301, the set of guide words can be input into a large model, and the large model can generate multiple first test cases based on the set of guide words, that is, generate a first test case set. Alternatively, the set of guide words can be input into multiple large models at the same time, and each large model can generate a first test case set based on the set of guide words, thereby obtaining multiple first test case sets.
[0068] If multiple groups of guide words are obtained when executing S301, the multiple groups of guide words can be sequentially input into a large model, and the large model generates a first test case set according to each group of guide words, thereby obtaining multiple first test case sets. Alternatively, different groups of guide words can be input into different large models, and each large model can generate a first test case set according to the input group of guide words, thereby obtaining multiple first test case sets.
[0069] S202: Generate a second test case set according to the configured test case algorithm and algorithm auxiliary data.
[0070] Exemplarily, a test case algorithm can be configured according to product requirement information, and corresponding algorithm auxiliary data can be set for the test case algorithm. Based on the test case algorithm and the corresponding algorithm auxiliary data, multiple second test cases can be generated, that is, a second test case set is generated.
[0071] In other embodiments, multiple test case algorithms can be configured according to product requirement information, and corresponding algorithm auxiliary data can be set for each test case algorithm. According to each test case algorithm and the corresponding algorithm auxiliary data, a second test case set can be generated, thereby obtaining multiple second test case sets.
[0072] It should be noted that S201 and S202 can be executed simultaneously to generate the first test case set and the second test case set simultaneously, which can reduce the time required for generating test cases, thereby further improving the generation efficiency of test cases.
[0073] In the disclosed embodiment, a first test case set is generated based on a big model according to product requirement information and preset prompt information, and a second test case set is generated according to the configured test case algorithm and algorithm auxiliary data. Since the first test case set is obtained based on the big model and the second test case set is obtained based on the algorithm, the test cases in the first test case set cover more test scenarios and the test cases in the second test case set are more accurate, thereby improving the accuracy and completeness of the test case results.
[0074] In some embodiments, the guide words include general guide words and special guide words, and the guide word generation algorithm includes a general guide word generation algorithm and a special guide word generation algorithm. The general guide word generation algorithm is used to generate general guide words, and the special guide word generation algorithm is used to generate special guide words.
[0075] The test case rules also include test case design methods, which include at least one of equivalence class partitioning method, boundary value analysis method, causal diagram method, error speculation method, decision table method, orthogonal table method, output domain coverage method, flowchart method and state transition method.
[0076] In this way, when executing S102, it is also necessary to select at least one test case design method that matches the product requirement information from the test case design method library. The test case design method library here includes equivalence class partitioning method, boundary value analysis method, cause-and-effect diagram method, error speculation method, decision table method, orthogonal table method, output domain coverage method, flowchart method and state transition method.
[0077] Figure 4 A flowchart of another test case generation method provided by an embodiment of the present disclosure is provided. Figure 4 for Figure 3 Based on the illustrated embodiment, a possible implementation method when executing S301 is specifically described as follows:
[0078] S401, generating a general guide word according to product demand information and preset prompt information.
[0079] Exemplarily, there is one preset prompt information, and the product demand information and the preset prompt information can be input into a universal guide word generation algorithm, or the product demand information can be input into a universal guide word generation algorithm, and the universal guide word generation algorithm is provided with the preset prompt information. The universal guide word generation algorithm can generate multiple universal guide words, that is, generate a group of universal guide words, according to the preset prompt information and the input product demand information.
[0080] In other embodiments, there is one preset prompt information, and the product demand information and the preset prompt information can be simultaneously input into multiple universal guide word generation algorithms, or the product demand information can be simultaneously input into multiple universal guide word generation algorithms, and the preset prompt information is set in each of the multiple universal guide word generation algorithms. Each universal guide word generation algorithm generates a set of universal guide words according to the preset prompt information and the input product demand information, thereby obtaining multiple sets of universal guide words.
[0081] In some other embodiments, there are multiple preset prompt information, and the product demand information can be input into a universal guide word generation algorithm, and multiple preset prompt information can be input into the universal guide word generation algorithm in sequence, or the product demand information can be input into a universal guide word generation algorithm, and the universal guide word generation algorithm is provided with multiple preset prompt information. The universal guide word generation algorithm can generate a group of universal guide words according to each preset prompt information and the input product demand information, so as to obtain multiple groups of universal guide words.
[0082] In some other embodiments, there are multiple preset prompt information, and the product demand information can be simultaneously input into multiple universal guide word generation algorithms, and different preset prompt information can be simultaneously input into different universal guide word generation algorithms, or the product demand information can be simultaneously input into multiple universal guide word generation algorithms, and different preset prompt information is set in the multiple universal guide word generation algorithms. Each universal guide word generation algorithm can generate a group of universal guide words according to the corresponding preset prompt information and the input product demand information, so that multiple groups of universal guide words can be obtained.
[0083] S402, generating special guide words according to product requirement information and configured test case design method.
[0084] Exemplarily, a test case design method is configured for product requirement information, and the product requirement information and the configured test case design method are input into a special guide word generation algorithm. The special guide word generation algorithm generates multiple special guide words, that is, generates a group of special guide words based on the input product requirement information and the test case design method.
[0085] In other embodiments, a test case design method is configured for product requirement information, and the product requirement information and the configured test case design method are simultaneously input into multiple special guide word generation algorithms. Each special guide word generation algorithm generates a group of special guide words based on the input product requirement information and test case design method, thereby obtaining multiple groups of special guide words.
[0086] In some other implementations, multiple test case design methods are configured for product requirement information, the product requirement information is input into a special guide word generation algorithm, and the configured multiple test case design methods are sequentially input into the special guide word generation algorithm. The special guide word generation algorithm generates a group of special guide words based on the input product requirement information and each test case design method, thereby obtaining multiple groups of special guide words.
[0087] In some other embodiments, multiple test case design methods are configured for product requirement information, the product requirement information is simultaneously input into multiple special guide word generation algorithms, and different test case design methods are simultaneously input into different special guide word generation algorithms. Each special guide word generation algorithm can generate a set of special guide words according to the input product requirement information and the corresponding test case design method, thereby obtaining multiple sets of special guide words.
[0088] It should be noted that S401 and S402 can be executed simultaneously to generate common guide words and special guide words at the same time, which can reduce the time required for generating test cases, thereby further improving the efficiency of test case generation.
[0089] In the disclosed embodiment, by generating general guide words based on product requirement information and preset prompt information, and generating special guide words based on product requirement information and a configured test case design method, personalized guide words can be generated for different product requirements, so that the test case results are more in line with the product requirements, thereby improving the accuracy of the test case results.
[0090] The present disclosure also provides a test case generation device, Figure 5 A schematic diagram of a test case generation device provided by an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the test case generating device includes:
[0091] The acquisition module 110 is used to acquire product demand information.
[0092] The configuration module 120 is used to configure test case rules according to the product requirement information, and the test case rules include test case algorithms and algorithm auxiliary data.
[0093] A generation module 130 is used to generate a first test case set and a second test case set according to the product requirement information and the configured test case rules, and to generate test case results according to the first test case set and the second test case set; the first test case set includes multiple first test cases, and the second test case set includes multiple second test cases.
[0094] In some embodiments, the generation module 130 is further used to generate the first set of test cases based on the big model, according to the product requirement information and preset prompt information; and to generate the second set of test cases based on the configured test case algorithm and the algorithm auxiliary data.
[0095] In some embodiments, the generation module 130 is further used to generate guide words according to the product requirement information and preset prompt information; based on the large model, the first test case set is generated according to the guide words.
[0096] In some embodiments, the test case rules also include a test case design method, and the guide words include general guide words and special guide words.
[0097] The generating module 130 is further used to generate the general guide words according to the product requirement information and the preset prompt information; and to generate the special guide words according to the product requirement information and the configured test case design method.
[0098] In some embodiments, the generation module 130 is further used to determine all of the first test cases in the first test case set and all of the second test cases in the second test case set as target test cases; and convert the target test cases into readable documents to generate the test case results.
[0099] In some embodiments, the preset prompt information includes roles, capabilities, product requirement input, expectations, professional requirements, sample prompts, output formats, and thought processes.
[0100] In some embodiments, the test case design method includes at least one of an equivalence class partitioning method, a boundary value analysis method, a cause-and-effect diagram method, an error guessing method, a decision table method, an orthogonal table method, an output domain coverage method, a flowchart method, and a state transition method.
[0101] The test case algorithm includes at least one of a boundary value algorithm, a decision table algorithm, an orthogonal table algorithm, a flow chart algorithm, a state transition algorithm and a cause-effect diagram algorithm.
[0102] The device provided in the embodiment of the present disclosure is used to execute the steps provided in any of the above method embodiments, has functional modules corresponding to the method embodiments, and has the beneficial effects of the method embodiments, which will not be repeated here.
[0103] The present disclosure further provides an electronic device, comprising: a processor, wherein the processor is used to execute a computer program stored in a memory, and the computer program implements the steps of the method embodiment of the present disclosure when executed by the processor.
[0104] Figure 6 A schematic diagram of the structure of an electronic device provided by the present disclosure is shown in FIG. Figure 6 A block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure is shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0105] like Figure 6 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors 16, a system memory 28, and a bus 18 connecting various system components (including the system memory 28 and the processor 16).
[0106] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0107] The electronic device 12 typically includes a variety of computer system readable media. These media can be any media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0108] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media (commonly referred to as "hard drives"). A disk drive for reading and writing removable non-volatile disks (such as "floppy disks"), and an optical disk drive for reading and writing removable non-volatile optical disks (such as CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data media interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.
[0109] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described in the embodiments of the present disclosure.
[0110] The processor 16 executes various functional applications and data processing by running at least one program among a plurality of programs stored in the system memory 28 , such as implementing the method embodiment provided in the embodiment of the present disclosure.
[0111] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above method embodiment when executed by a processor.
[0112] Any combination of one or more computer-readable media can be used. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0113] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0114] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0115] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN) domain, or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0116] The present disclosure also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the steps of implementing the above method embodiments.
[0117] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device and method according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, a program segment or an instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0118] Unless the context clearly indicates otherwise, the singular form of the words used herein and in the appended claims includes the plural and vice versa. Thus, when referring to the singular, the plural form of the corresponding term is generally included. Similarly, the words "comprise" and "include" are to be interpreted as inclusive rather than exclusive. Likewise, the terms "include" and "or" should be interpreted as inclusive unless such interpretation is expressly prohibited herein. Where the term "example" is used herein, particularly when it is located after a group of terms, the "example" is merely exemplary and illustrative and should not be considered exclusive or comprehensive.
[0119] Further aspects and scopes of adaptability become apparent from the description provided herein. It should be understood that various aspects of the present disclosure can be implemented individually or in combination with one or more other aspects. It should also be understood that the description and specific embodiments herein are intended for purposes of illustration only and are not intended to limit the scope of the present disclosure.
[0120] Several embodiments of the present disclosure are described in detail above, but it is obvious that those skilled in the art can make various modifications and variations to the embodiments of the present disclosure without departing from the spirit and scope of the present disclosure. The protection scope of the present disclosure is defined by the attached claims.
Claims
1. A test case generation method, characterized in that: include: Obtain product demand information; Configure test case rules according to the product requirement information, wherein the test case rules include a test case algorithm and algorithm auxiliary data; Generate a first test case set and a second test case set according to the product requirement information and the configured test case rules, wherein the first test case set includes a plurality of first test cases and the second test case set includes a plurality of second test cases; Generate test case results according to the first test case set and the second test case set.
2. The method according to claim 1, characterized in that Generating a first test case set and a second test case set according to the product requirement information and the configured test case rules includes: Based on the big model, generating the first test case set according to the product requirement information and preset prompt information; The second test case set is generated according to the configured test case algorithm and the algorithm auxiliary data.
3. The method according to claim 2, characterized in that The generating the first test case set based on the big model and according to the product requirement information and preset prompt information includes: Generate a guide word according to the product demand information and the preset prompt information; Based on the large model, the first test case set is generated according to the guide words.
4. The method according to claim 3, characterized in that The test case rules also include a test case design method, and the guide words include general guide words and special guide words; The generating of the guide words according to the product demand information and the preset prompt information includes: Generate the general guide word according to the product demand information and the preset prompt information; The special guide words are generated according to the product requirement information and the configured test case design method.
5. The method according to any one of claims 1 to 4, characterized in that: Generating test case results according to the first test case set and the second test case set includes: Determine all the first test cases in the first test case set and all the second test cases in the second test case set as target test cases; The target test case is converted into a readable document to generate the test case result.
6. The method according to claim 2, characterized in that The preset prompt information includes roles, capabilities, product requirement input, expectations, professional requirements, sample prompts, output format and thinking process.
7. The method according to claim 4, characterized in that The test case design method includes at least one of an equivalence class partitioning method, a boundary value analysis method, a causal diagram method, an error guessing method, a decision table method, an orthogonal table method, an output domain coverage method, a flow chart method, and a state transition method; The test case algorithm includes at least one of a boundary value algorithm, a decision table algorithm, an orthogonal table algorithm, a flow chart algorithm, a state transition algorithm and a cause-effect diagram algorithm.
8. A test case generating device, characterized in that: include: Acquisition module, used to obtain product demand information; A configuration module, configured to configure test case rules according to the product requirement information, wherein the test case rules include a test case algorithm and algorithm auxiliary data; A generating module, configured to generate a first test case set and a second test case set according to the product requirement information and the configured test case rules, and to generate a test case result according to the first test case set and the second test case set; The first test case set includes a plurality of first test cases, and the second test case set includes a plurality of second test cases.
9. An electronic device, characterized in that: include: A processor, wherein the processor is used to execute a computer program stored in a memory, wherein the computer program, when executed by the processor, implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Test case generation method based on test case library and AI automatic arrangement
CN122547696A
