Method, electronic device and computer program product for generating test case

CN120803897APending Publication Date: 2025-10-17DELL PROD LP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410404767.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-03
Publication Date
2025-10-17

Smart Images

  • Figure CN120803897A_ABST
    Figure CN120803897A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a method for generating a test case, electronic equipment and a computer program product. The method includes determining update knowledge corresponding to a target function in a knowledge base for the system in response to the target function of the system being developed. The method further includes identifying, in the knowledge base, at least one test path from the updated knowledge based on a predetermined test range for the target function. The method further includes generating a test case for the target function by extracting a test object from each of the at least one test path. In this way, automatic generation of the test case based on the ontology can be achieved, when a product is iteratively updated, incremental knowledge serves as a test target, comprehensive coverage of a test strategy can be ensured, missing of any test point is avoided, and meanwhile the generation efficiency is improved on the premise that the quality of the case is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure generally relate to the field of computers, and more particularly, to methods, electronic devices, and computer program products for generating test cases. Background Art

[0002] Testing is a retrospective and verification process for development, aiming to comprehensively detect potential defects, errors, and any unexpected behavior within the product (e.g., a single or multiple functions, or an entire system). This type of testing typically includes multiple steps, including use case design, test environment setup, test execution, result analysis, and defect tracking.

[0003] Product testing enables in-depth analysis of various aspects of a product, such as its performance, stability, security, and compatibility. Furthermore, test engineers can examine the product's usability, interaction logic, and other aspects from a user's perspective to determine if there are any issues. Product testing feedback is then provided to the development team, enabling them to further improve the product. Summary of the Invention

[0004] The embodiments of the present disclosure provide a solution for generating test cases. Through such automatic generation of test cases, the test strategy can comprehensively cover the test points and improve the generation efficiency while ensuring the quality of the test cases.

[0005] In a first aspect of the present disclosure, a method for generating test cases is provided. The method includes determining, in response to a target function of a system being developed, updated knowledge corresponding to the target function in a knowledge base for the system. The method also includes identifying at least one test path from the updated knowledge in the knowledge base based on a predetermined test scope for the target function. The method also includes generating a test case for the target function by extracting a test object from each test path of the at least one test path.

[0006] In another aspect of the present disclosure, an electronic device for generating test cases is provided. The electronic device includes a processor and a memory, the memory being coupled to the processor and having instructions stored thereon. When executed by the processor, the instructions cause the electronic device to perform actions, including determining, in response to a target function of the system being developed, updated knowledge corresponding to the target function in a knowledge base for the system. The actions also include identifying at least one test path from the updated knowledge in the knowledge base based on a predetermined test scope for the target function. The actions also include generating a test case for the target function by extracting a test object from each test path of the at least one test path.

[0007] In yet another aspect of the disclosure, a computer program product is provided. The computer program product is tangibly stored in a non-transitory computer readable storage medium and comprises computer executable instructions that, when executed by a processor of a computer, cause the computer to perform a method or process according to an embodiment of the disclosure.

[0008] The scheme for generating test cases according to the embodiments of the disclosure can realize ontology-based automatic generation of test cases, can ensure comprehensive coverage of test strategies and avoid missing any test points when a product is iteratively updated with incremental knowledge as a test target, and can improve the generation efficiency of test cases while ensuring the quality of the test cases.

[0009] Note that the summary is provided to introduce a series of concepts in a simplified form, which will be further described in the detailed description below. The summary is not intended to identify key or essential features of the disclosure, nor is it intended to limit the scope of the disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0010] The above and other objects, features and advantages of the disclosure will become more clearly understood from the following detailed description taken in conjunction with the accompanying drawings, in which:

[0011] Figure 1 a schematic diagram illustrating an example environment in which methods and / or processes according to embodiments of the disclosure can be implemented;

[0012] Figure 2 a flowchart illustrating a method for generating test cases according to embodiments of the disclosure;

[0013] Figure 3 a schematic diagram illustrating a test case generation process according to embodiments of the disclosure;

[0014] Figure 4A is a diagram illustrating knowledge entries in a knowledge base under a graphical presentation model according to embodiments of the disclosure;

[0015] Figure 4B is a diagram illustrating updated knowledge entries corresponding to a developed target function according to embodiments of the disclosure;

[0016] Figure 5 is a diagram illustrating an identified test path according to embodiments of the disclosure;

[0017] Figure 6 is a diagram illustrating an algorithm for forming structured data corresponding to an extracted test object according to embodiments of the disclosure;

[0018] Figure 7 is a diagram illustrating an algorithm for generating a descriptive sentence according to an embodiment of the present disclosure;

[0019] Figure 8 is a diagram illustrating an example of a generated descriptive sentence according to an embodiment of the present disclosure; and

[0020] Figure 9 illustrates a schematic block diagram of an example device that can be used to implement some embodiments according to the present disclosure.

[0021] In all the drawings, like or similar reference numerals generally designate identical or similar elements throughout the drawings. DETAILED DESCRIPTION

[0022] Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be embodied in various forms without being limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly and completely understood. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of the present disclosure.

[0023] In the description of embodiments of the present disclosure, the term "comprising" and variations thereof should be understood to encompass the terms "consisting of" and "consisting essentially of" to the extent not in conflict with the meaning of those terms as used in the specification. The term "based on" should be understood as "based at least in part on." The term "one embodiment" or "an embodiment" should be understood as "at least one embodiment." The terms "a first," "a second," etc. can refer to different or identical objects, unless expressly stated otherwise.

[0024] As described above, test jobs facilitate the development of products. The test process can include, but is not limited to, use case design, test environment setup, test execution, result analysis, and defect tracking, among other things. Generally, the test process begins with use case design. For example, a test engineer analyzes the developer's documentation, extracts all test points, and then writes down steps to cover all the test points. After the test case is written, the next step is to execute the use case and script coding.

[0025] However, the related scheme of use case design faces several challenges. On one hand, the coverage of test points is difficult to guarantee. This is crucial for product quality. If some test points are missing, it can lead to failure to find some defects of the product, and when customers encounter these defects, it can cost more to fix them. Therefore, experienced test engineers are always needed to analyze the test points. On the other hand, the process of converting test points into test cases can consume a lot of time and manpower. Test inputs, execution conditions and expected results are crucial for use case execution and script coding. They must be clearly presented in the use case description through a simple but professional form, which always leads to a lot of time spent by test engineers.

[0026] To this end, embodiments of the present disclosure propose a scheme for generating test cases. The scheme includes determining updated knowledge in a knowledge base for a system corresponding to a target function of the system in response to the target function being developed. The scheme also includes identifying at least one test path in the knowledge base from the updated knowledge based on a predetermined test scope for the target function. The scheme further includes generating test cases for the target function by extracting test objects from each of the at least one test path. In this way, ontology-based automatic generation of test cases can be achieved, and whenever a product is iteratively updated, incremental knowledge can be taken as a test target to ensure comprehensive coverage of the test strategy without missing any test points, while improving the generation efficiency of the use cases on the premise of ensuring the quality of the use cases.

[0027] The basic principles and several example implementations of the present disclosure will be explained below with reference to Figures 1 to 9 It should be understood that these example embodiments are given only for the purpose of better illustrating and enabling a person skilled in the art to understand and implement embodiments of the present disclosure, and do not limit the scope of the present disclosure in any way.

[0028] Figure 1 A schematic diagram of an example environment 100 in which methods and / or procedures according to embodiments of the present disclosure can be implemented is shown. The example environment 100 exemplarily shows an environment in which test cases are automatically generated. As shown in Figure 1 The example environment 100 can include a development document 110, a computing device 120, a knowledge base 130 and a storage device 140, and these components can be coupled to each other for interaction, as shown in Figure 1 It should be understood that only limited components are shown in the example environment 100 for implementing embodiments of the present disclosure for the purpose of facilitating understanding and ease of illustration, and embodiments of the present disclosure are not limited thereto. For example, the example environment 100 can also include a display (not shown) configured to display the development document 110, or present the generated test cases, etc.

[0029] According to embodiments of the present disclosure, the development document 100 generally follows certain writing specifications to indicate the developed product in, for example, clear language, accurate terminology, suitable diagrams, and the like. Meanwhile, the development document 100 also needs to be updated and maintained periodically to reflect the iterative updates of the product. Examples of the development document 110 can include, but are not limited to, a requirement analysis document, a summary design document, a detailed design document, a database design document, a test document, a user manual, and the like.

[0030] The development document 110 can elaborate the core elements of the developed product, such as its internal logic, module interaction, data structure, and other key information. The development document 110 can provide clear guidance for developers and facilitate communication and collaboration among team members. Furthermore, due to the important information included in the development document 110, it can provide indispensable technical support and decision basis for the subsequent maintenance, upgrade, and expansion of the product, and the like.

[0031] According to embodiments of the present disclosure, the computing device 120 can analyze the development document 110 of the product and generate the knowledge base 130 for the product based thereon. By utilizing techniques such as natural language processing and image recognition, the computing device 120 can parse, extract, and summarize the development document 110, and thus can accurately identify the key information (e.g., from text and / or diagrams) in the document, facilitate understanding of the underlying logic and association, and the like. Through this process, the computing device 120 organizes the relatively scattered information in the development document 110 into structured data, simplifying the understanding of the product.

[0032] The computing device 120 can have computing capabilities suitable for the test case generation according to embodiments of the present disclosure. During the execution of the test case generation, the computing device 120 can process the development document 110 and perform corresponding calculations, generate the knowledge base 130 for the product, and store it in the storage device 140. It should be understood that the computing device 120 is shown as one computing device in Figure 1 The computing device 120 is shown as one computing device in the example environment 100, but this is merely illustrative and non-limiting, and there can be more number of computing devices to form a cluster in the example environment 100. In the following, the corresponding operations of the computing device 120 will be described in further detail.

[0033] By way of example and not limitation, the computing device 120 can include, but is not limited to, a personal computer, a laptop computer, a server computer, a mobile device such as a smartphone, a tablet computer, and the like, a wearable electronic device, a multimedia player, a personal digital assistant (PDA), a smart home device, a consumer electronic product, or a distributed computing environment including any one or more of the above devices, and the like.

[0034] According to embodiments of the present disclosure, the knowledge base 130 for the product can characterize the product. In some embodiments, the knowledge base 130 can include one or more knowledge entries for describing various aspects of the product, each of which can correspond to a single or multiple functions of the system, or the entire system, for indicating its behaviors and states, etc. The knowledge entries included in the knowledge base 130 can be generated based on the development documents 110 of the product. For ease of understanding and use, the knowledge entries in the knowledge base 130 can be in a graphical presentation mode, a textual presentation mode, or a combination of both. The graphical presentation mode can intuitively demonstrate the associations and hierarchy among the knowledge entries, helping to quickly grasp the overall framework, while the textual presentation mode provides detailed textual descriptions and explanations, facilitating in-depth understanding of the knowledge content. In the following, the knowledge base 130 according to embodiments of the present disclosure will be described in further detail.

[0035] According to embodiments of the present disclosure, the storage device 140 has a storage space adapted to the test case generation according to embodiments of the present disclosure. The storage device 140 can be configured to store the knowledge base 130 for the product, and the generated test cases, etc. In addition, the model and its parameters, test environment configurations, etc. involved in the test process can also be stored in the storage device 140. It should be understood that the storage device 140 is shown as one storage device in the example environment 100, but this is only illustrative and non-limiting, and there can be more numbers of storage devices in the example environment 100. Figure 1 The storage device 140 can be configured to store the knowledge base 130 for the product, and the generated test cases, etc. In addition, the model and its parameters, test environment configurations, etc. involved in the test process can also be stored in the storage device 140. It should be understood that the storage device 140 is shown as one storage device in the example environment 100, but this is only illustrative and non-limiting, and there can be more numbers of storage devices in the example environment 100.

[0036] By way of example and not limitation, the storage device 140 can include, but is not limited to, a local storage device, a remote storage device, and a combination thereof. In some embodiments, the multiple storage devices in the storage device 140 can include, but are not limited to, a hard disk drive (HDD), a solid state drive (SSD), a hybrid hard drive (SSHD), etc., and some of the multiple storage devices can be arranged locally, while others can be arranged remotely, e.g., coupled together via a line or a network, etc.

[0037] The method and / or process according to embodiments of the present disclosure described above in connection with Figure 1 The example environment 100 in which the method and / or process according to embodiments of the present disclosure can be implemented is described above. The flowchart of the method 200 for generating test cases according to embodiments of the present disclosure will be described below in connection with Figure 2 By way of example and not limitation, the storage device 140 can include, but is not limited to, a local storage device, a remote storage device, and a combination thereof. In some embodiments, the multiple storage devices in the storage device 140 can include, but are not limited to, a hard disk drive (HDD), a solid state drive (SSD), a hybrid hard drive (SSHD), etc., and some of the multiple storage devices can be arranged locally, while others can be arranged remotely, e.g., coupled together via a line or a network, etc.

[0038] At block 210, in response to the target function of the system being developed, updated knowledge corresponding to the target function in the knowledge base 130 for the system is determined. In response to a new function being developed, or a previous function being upgraded, the knowledge base 130 will synchronize the system such changes, e.g., by representing updated knowledge of the new function or the upgraded function. Such updated knowledge corresponds to the new function or the upgraded function, and is stored for reflecting the latest behavior and actions of the system. In the following, the updated knowledge determination process according to embodiments of the present disclosure will be further detailed.

[0039] At block 220, based on a predetermined test scope for the target function, at least one test path is identified in the knowledge base from the updated knowledge. In some embodiments, the predetermined test scope can be defined by a test engineer before the test, or dynamically determined by the computing device 120 during the test based on detected change factors such as the test environment. As mentioned above, the system is iteratively updated due to its new function or upgraded function being developed, and the updated knowledge newly generated and stored in the knowledge base 130 for the system embodies such iterative updates. In the knowledge base 130, starting from the updated knowledge in the knowledge for the system, one or more updated knowledge entries and their associated knowledge entries around are identified. By sorting out these knowledge entries, one or more use case main lines, i.e., test paths, can be determined. In the following, the test path identification according to embodiments of the present disclosure will be further detailed.

[0040] At block 230, a test case for the target function is generated by extracting test objects from each of the at least one test path. Each of the one or more test paths identified at block 220 involves updated knowledge (at least including some updated knowledge entries), and each test path includes its respective test objects, e.g., actions to be performed, states to be verified, etc. By extracting test objects in the test path and determining the context associated therewith, a test case for the target function is generated. In the following, the test object extraction and test case generation according to embodiments of the present disclosure will be further detailed.

[0041] The method 200 for generating test cases according to embodiments of the present disclosure enables ontology-based automatic generation of test cases, whenever a product is iteratively updated, with incremental knowledge as the test target, to ensure comprehensive coverage of the test strategy while avoiding missing any test points, while improving the generation efficiency of the test cases under the premise of ensuring the quality of the test cases.

[0042] Figure 3 FIG. 3 illustrates a schematic diagram of a test case generation process 300 according to embodiments of the present disclosure. As shown in FIG. 3, the test case generation process 300 includes the following steps: Figure 3As shown in FIG. 3, the test case generation process 300 can include a knowledge base establishment sub-process 310, a knowledge base updating sub-process 320, a test path identification sub-process 330, and a test case generation sub-process 340. The test case generation process 300 and its corresponding sub-processes 310-340 can be abstracted as a test case generation unit and corresponding sub-units for each sub-process (e.g., a knowledge base establishment sub-unit, a knowledge base updating sub-unit, etc.). The unit and corresponding sub-units can be software-implemented components or systems for generating test cases and can be run on a computing device (such as the computing device 120) having computing capabilities.

[0043] According to embodiments of the present disclosure, the knowledge base establishment sub-process 310 can generate knowledge items for a system based on the development document 110 of the system. By way of example, techniques such as natural language processing and image recognition can be utilized to extract important information and key content from the development document 110. The extracted portions are converted into knowledge items in a predetermined format via, for example, a suitable editor. It should be understood that embodiments of the present disclosure do not limit such extraction and conversion processes, and suitable implementations can be selected as needed for specific uses.

[0044] In some embodiments, the knowledge base includes one or more knowledge items about the system, and each of the knowledge items can include an identification number, a name, a label, an attribute, a description, or a note. By way of example, a knowledge item corresponding to the storage device A can include an identification number "PSO0001004", a name "storage device A", a label "storage device A", an attribute "resource", a description "indicates physical hardware", and a note "'PSO00000001' instance", where the note can indicate that the instance knowledge item "PSO0001004" is an instance of the entity knowledge item "PSO00000001". In a textual presentation of the knowledge items in the knowledge base, the knowledge items can be arranged based on the order of the identification numbers. In the following, the storage system will be used as an example of a product to be tested for ease of understanding. It should be understood that this is not limiting, and test case generation according to embodiments of the present disclosure can also be performed for other different systems, such as a network system.

[0045] In some embodiments, the knowledge items can include, but are not limited to, entity knowledge items, instance knowledge items, session knowledge items, action knowledge items, condition knowledge items, or state knowledge items, and there can be an association relationship between the knowledge items. The various types of knowledge items in the knowledge base and their association relationships will be introduced below. Figure 4A The various types of knowledge items in the knowledge base and their association relationships will be introduced below.

[0046] Figure 4Ais a diagram illustrating knowledge entries in a knowledge base under a graphical presentation model according to an embodiment of the present disclosure. As shown in Figure 4A As shown in the middle, the knowledge base for a storage system can include a plurality of knowledge entries, where knowledge entries 401 and 402 can be entity knowledge entries, corresponding to a storage device and a volume respectively, while knowledge entries 403 and 404 can be instance knowledge entries corresponding to the entity knowledge entry 402, for example, instance knowledge entry 403 indicates a storage device B (also referred to as cluster B) as a data backup end, while instance knowledge entry 404 indicates a storage device A (also referred to as storage device A) as a data production end. Knowledge entries 405 and 406 can be session knowledge entries, for example, a synchronization session knowledge entry 406 is configured to perform data synchronization from instance knowledge entry 403 to instance knowledge entry 404, while a monitoring session knowledge entry 405 is configured to monitor the synchronization process. Knowledge entries 409 and 410 can be action knowledge entries corresponding to the monitoring session knowledge entry 405, for example, a remove monitoring server action knowledge entry 409 and an add monitoring server action knowledge entry 410, which have execution conditions respectively, such as Figure 4A As shown in the middle. Knowledge entries 407 and 408 can be condition knowledge entries corresponding to the action knowledge entries 409 and 410 respectively, for example, a have monitoring session condition knowledge entry 407 and a do not have monitoring session condition knowledge entry 408. The subsequent action can only be executed in the case that the corresponding condition is satisfied. In addition, knowledge entries 411-416 are state knowledge entries, indicating the state of the corresponding knowledge entries.

[0047] There can be an association relationship between various knowledge entries. In some embodiments, the association relationship can include but is not limited to a sequential relationship, a conditional relationship, a causal relationship, etc. By way of example but not limitation, based on the sequential relationship between the monitoring session knowledge entry 405 and the synchronization session knowledge entry 406, the monitoring session knowledge entry 405 is arranged before the synchronization session knowledge entry 406. Based on the conditional relationship between the add monitoring server action knowledge entry 410 (also referred to as the monitoring action knowledge entry) and the do not have monitoring session condition knowledge entry 408 (also referred to as the not yet monitored condition knowledge entry), the monitoring action knowledge entry is arranged after the not yet monitored condition knowledge entry. In addition, based on the causal relationship between the monitoring session knowledge entry 405 and the session good state knowledge entry 412, the monitoring session knowledge entry 405 is arranged before the session good state knowledge entry 412. Again, only by way of example and not exhaustive of all association relationships, for example, it can also include an exclusive relationship between the monitoring enabled state knowledge entry 413 and the monitoring disabled state knowledge entry 414, a parallel relationship between the storage device instance knowledge entry 403 and the storage device instance knowledge entry 404, etc.

[0048] Return Figure 3 According to embodiments of the present disclosure, at the knowledge base updating sub-process 320, the updating knowledge corresponding to the developed target function can be determined in the knowledge base. In response to the target function being developed, the knowledge base will synchronize the change of the system and store the updating knowledge corresponding to the change. For example, the updating knowledge entry indicating the updating knowledge can be generated based on the newly added part in the development document.

[0049] In order to determine which part of the current knowledge in the knowledge base for the system is the updating knowledge, in some embodiments, the current knowledge entry for the system can be compared with the historical knowledge entry before the target function is developed, and the difference between the current knowledge entry and the historical knowledge entry is determined as the updating knowledge entry. The knowledge entries in the knowledge base can be recorded at a predetermined period.

[0050] Figure 4B FIG. 7 illustrates a diagram of the updating knowledge entries corresponding to the developed target function according to embodiments of the present disclosure. The updating knowledge entries can be identified based on the difference of the knowledge entries before and after the target function is developed. As shown in FIG. 7, a subset 710 and 720 of the knowledge entries for the system are identified as the updating knowledge entries corresponding to the developed target function, which means that the knowledge entries in the subset 710 and 720 do not exist in the knowledge base for the system before the target function is developed. Figure 4B

[0051] Return Figure 3 According to embodiments of the present disclosure, at the test path identification sub-process 330, one or more test paths are identified in the knowledge base for the system from the updating knowledge entries. In some embodiments, a predetermined number of knowledge entries associated with the updating knowledge entries can be identified upstream and downstream of the updating knowledge entries in the current knowledge entries for the system, for example, another knowledge entry that will be performed inevitably after a certain updating knowledge entry is identified, or another knowledge entry that is relatively highly associated with some updating knowledge entries. Here, the predetermined number is indicated by a predetermined test range. In other words, according to the need, several knowledge entries upstream and downstream of a certain updating knowledge entry can be selected, or it can be traced back to its starting point and ending point. In addition, based on the association relationship (for example, the sequential relationship, the conditional relationship, the causal relationship, etc.) between the identified updating knowledge entries and their associated knowledge entries, these knowledge entries can be adjusted to form the corresponding test paths, for example, to clarify the order between them, etc.

[0052] Figure 5 FIG. 8 is a diagram illustrating the identified test paths according to embodiments of the present disclosure. As shown in FIG. 8, the test paths 810 and 820 are identified in the knowledge base for the system from the updating knowledge entries, which means that the test paths 810 and 820 do not exist in the knowledge base for the system before the target function is developed. Figure 5 ​As shown in , an example test path may include knowledge items 505, 506, 502, 503, and 504, where knowledge items 505 and 506 are identified as updated knowledge items. It should be understood that the length of the test path can be increased or decreased depending on the test requirements. For example, when higher test accuracy is required, knowledge items 408, 410, and 513 can also be incorporated into the above test path as a new test path.

[0053] return Figure 3 According to an embodiment of the present disclosure, in the test case generation sub-process 340, test objects are extracted from the identified one or more test paths, and test cases for target functions are generated based on the extracted test objects. In some embodiments, the test objects include action objects, and upstream knowledge items of action knowledge items corresponding to the action objects can be tracked in the corresponding test paths as inputs, and downstream knowledge items of action knowledge items can be tracked in the corresponding test paths as outputs. The action knowledge items, inputs, and outputs can then be reorganized into structured data in a portable syntax format, such as action (input, output).

[0054] In some other embodiments, the test object includes a state object, and the verification action knowledge entry preceding the state knowledge entry corresponding to the state object can be tracked in the corresponding test path, and the upstream knowledge entry of the verification action knowledge entry can be tracked in the corresponding test path as a resource. Then, the verification action knowledge entry, resource, and state knowledge entry are organized into structured data in a portable syntax format, such as verification (resource, resource). Figure 6 Further explain the formation of structured data.

[0055] Figure 6 FIG is a diagram illustrating an algorithm for forming structured data corresponding to an extracted test object according to an embodiment of the present disclosure. For ease of reference and citation, the algorithm is referred to as Algorithm 1. Figure 6 As shown in , scenario 1 refers to the case where the test object is an action object, while scenario 2 refers to the case where the test object is a state object. Using Algorithm 1, one or more structured data actions (input, output) (or verification (resource, resource)) can be determined for each test path. The algorithm's final output can be a file in a portable syntax format containing the structured data for all test paths.

[0056] After obtaining structured data through Algorithm 1, descriptive statements can be generated based on the obtained structured data, and finally test cases can be generated. Figure 7is a diagram illustrating an algorithm for generating descriptive sentences according to an embodiment of the present disclosure. For ease of reference and citation, the algorithm is referred to as Algorithm 2. Algorithm 2 exemplarily but non- limitatively illustrates four kinds of syntax (or, also referred to as patterns) as shown in Figure 7 By Algorithm 2, a descriptive sentence of a desired syntax can be generated based on the structured data from each test path. It should be understood that embodiments of the present disclosure are not limited thereto, and other different natural language processing means and other syntaxes different from the exemplified syntaxes can also be employed according to specific usage requirements (e.g., language requirements (Chinese, English, etc.).

[0057] After the generation of the descriptive sentence, the entry name can be utilized to annotate at a suitable position of the sentence. Figure 8 is a diagram illustrating an example of the generated descriptive sentence according to an embodiment of the present disclosure. As shown in Figure 8 the entry name is annotated at a suitable position in the generated descriptive sentence, for example, in square brackets. It should be understood that embodiments of the present disclosure are not limited thereto, and other desired information can also be annotated, or the annotation can be omitted. By performing predetermined post-processing on the generated descriptive sentence, a test case for the target function of the system can be generated, such post-processing including but not limited to punctuation processing, word segmentation processing, text vectorization, etc.

[0058] Figure 9 is a schematic block diagram illustrating an example device 900 that can be used to implement some embodiments according to the present disclosure. As shown in Figure 9 the device 900 includes a central processing unit (CPU) 901 that can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 902 or loaded from a storage unit 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the device 900 can also be stored in the RAM 903. The CPU 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0059] A plurality of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, a speaker, etc.; the storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0060] The various processes and processes described above, such as the method 200, can be performed by the processing unit 901. For example, in some embodiments, the method 200 can be implemented as a computer software program tangibly embodied in a machine readable medium, such as the storage unit 908. In some embodiments, portions of or the entire computer program can be loaded and / or installed onto the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded onto the RAM 903 and executed by the CPU 901, one or more acts of the method 200 described above can be performed.

[0061] The present disclosure can be a method, apparatus, system, and / or computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for performing various aspects of the present disclosure.

[0062] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched tape, a

[0063] The computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.

[0064] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

[0065] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0066] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other data storage device. When the computer readable program instructions are loaded into the computer and other programmable data processing apparatus, a series of operational steps are implemented that provide processes such that the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0067] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps or processes to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0068] The flow diagrams and the block diagrams in the drawings are presented to illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logic functions. In some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and

[0069] Various embodiments of the present disclosure have been described above, and the description is intended to be illustrative of the various embodiments of the present disclosure and not exhaustive. Numerous modifications and alterations will occur to those skilled in the art, without departing from the scope and spirit of the various embodiments described. The scope of the various embodiments is limited only by the claims. The use of the terms "preferably," "more preferably," "most preferably" and other terms containing "preferably" indicates a description of an embodiment that is preferred, but not necessarily the only embodiment. The use of the term "preferred" or "preferably" does not mean that the described embodiment is the only embodiment or the only embodiment that is preferred. The use of the terms "first," "second," "third," etc. does not necessarily mean that the components are in any order. The use of the terms "first," "second," "third," etc. is used to distinguish between different components. The use of the terms "first," "second," "third," etc. does not necessarily mean that the components are in any order. The use of the terms "first," "second," "third," etc. is used to distinguish between different components. The use of the terms "first," "second," "third," etc. does not necessarily mean that the components are in any order. The use of the terms "first," "second," "third," etc. is used to distinguish between different components. The use of the terms "first," "second," "third," etc. does not necessarily mean that the components are in any order. The use of the terms "first," "second," "third," etc. is used to distinguish between different components. The use of the terms "first," "second," "third," etc. does not necessarily mean that the components are in any order. The use of the terms "first," "second," "third," etc. is used to distinguish between different components. The use of the terms "first," "second," "third," etc. does not necessarily mean that the components are in any order. The use of the terms "first," "second," "third," etc. is used to distinguish between different components.

Claims

1. A method for generating a test case, comprising: In response to a target function of a system being developed, determining updated knowledge corresponding to the target function in a knowledge base of the system; identifying at least one test path from the updated knowledge in the knowledge base based on a predetermined test scope for the target function; as well as A test case for the target function is generated by extracting a test object from each test path of the at least one test path.

2. A method according to claim 1, wherein the knowledge base includes at least one knowledge entry about the system, the at least one knowledge entry includes at least one of the following: an entity knowledge entry, an instance knowledge entry, a session knowledge entry, an action knowledge entry, a condition knowledge entry, or a state knowledge entry, and each knowledge entry in the at least one knowledge entry includes at least one of the following: an identification number, a name, a label, an attribute, a description, or an annotation.

3. The method of claim 1 , wherein determining the updated knowledge comprises: comparing current knowledge items for the system with historical knowledge items before the target functionality was developed; as well as The difference between the current knowledge item and the historical knowledge item is determined as an updated knowledge item.

4. The method of claim 3 , wherein identifying at least one test path from the updated knowledge comprises: identifying a predetermined number of knowledge items associated with the updated knowledge item upstream and downstream of the updated knowledge item in the current knowledge item, the predetermined number being indicated by the predetermined test range; as well as Based on the association relationships between the identified knowledge items, the identified knowledge items are adjusted to form corresponding test paths, where the association relationships include: sequential relationships, conditional relationships, and causal relationships.

5. The method of claim 4, wherein the system comprises a storage system, and adjusting the identified knowledge item comprises: Based on the order relationship between the monitoring session knowledge item and the synchronization session knowledge item, arranging the monitoring session knowledge item before the synchronization session knowledge item; Based on the conditional relationship between the monitoring action knowledge item and the not-yet-monitored condition knowledge item, arranging the monitoring action knowledge item after the not-yet-monitored condition knowledge item; as well as Based on the causal relationship between the monitoring session knowledge item and the session well-being knowledge item, the monitoring session knowledge item is arranged before the session well-being knowledge item.

6. The method according to claim 1, wherein the test object comprises an action object, the method further comprising: Tracing the upstream knowledge entry of the action knowledge entry corresponding to the action object in the corresponding test path as input, Tracing downstream knowledge items of the action knowledge items in the corresponding test path as output; as well as The action knowledge items, the inputs, and the outputs are formatted into structured data in a portable syntax format.

7. The method of claim 1 , wherein the test object comprises a state object, the method further comprising: Tracing the verification action knowledge entry preceding the state knowledge entry corresponding to the state object in the corresponding test path; Tracking an upstream knowledge entry of the verification action knowledge entry as a resource in the corresponding test path; as well as The verification action knowledge items, the resources and the state knowledge items are formatted into structured data in a portable syntax format.

8. The method according to claim 1, further comprising: generating a descriptive statement based on the structured data in the portable syntax format corresponding to the test object; as well as A comment is added to the generated descriptive statement.

9. The method according to claim 1, wherein The knowledge items included in the knowledge base are generated based on the development documentation of the system, and The knowledge items included in the knowledge base are presented in at least one of the following presentation modes: a graphical presentation mode, or a textual presentation mode.

10. An electronic device comprising: processor; as well as a memory coupled to the processor and storing instructions, which, when executed by the processor, cause the electronic device to perform actions, the actions comprising: In response to a target function of a system being developed, determining updated knowledge corresponding to the target function in a knowledge base of the system; identifying at least one test path from the updated knowledge in the knowledge base based on a predetermined test scope for the target function; and A test case for the target function is generated by extracting a test object from each test path of the at least one test path.

11. An electronic device according to claim 10, wherein the knowledge base includes at least one knowledge entry about the system, the at least one knowledge entry includes at least one of the following: an entity knowledge entry, an instance knowledge entry, a session knowledge entry, an action knowledge entry, a condition knowledge entry, or a state knowledge entry, and each knowledge entry in the at least one knowledge entry includes at least one of the following: an identification number, a name, a label, an attribute, a description, or an annotation.

12. The electronic device of claim 10, wherein determining the updated knowledge comprises: comparing current knowledge items for the system with historical knowledge items before the target functionality was developed; as well as The difference between the current knowledge item and the historical knowledge item is determined as an updated knowledge item.

13. The electronic device of claim 12, wherein identifying at least one test path from the updated knowledge comprises: identifying a predetermined number of knowledge items associated with the updated knowledge item upstream and downstream of the updated knowledge item in the current knowledge item, the predetermined number being indicated by the predetermined test range; as well as Based on the association relationships between the identified knowledge items, the identified knowledge items are adjusted to form corresponding test paths, where the association relationships include: sequential relationships, conditional relationships, and causal relationships.

14. The electronic device of claim 13, wherein the system comprises a storage system, and adjusting the identified knowledge item comprises: Based on the order relationship between the monitoring session knowledge item and the synchronization session knowledge item, arranging the monitoring session knowledge item before the synchronization session knowledge item; Based on the conditional relationship between the monitoring action knowledge item and the not-yet-monitored condition knowledge item, arranging the monitoring action knowledge item after the not-yet-monitored condition knowledge item; as well as Based on the causal relationship between the monitoring session knowledge item and the session well-being knowledge item, the monitoring session knowledge item is arranged before the session well-being knowledge item.

15. The electronic device according to claim 10, wherein the test object comprises an action object, and the action further comprises: Tracing the upstream knowledge entry of the action knowledge entry corresponding to the action object in the corresponding test path as input, Tracing downstream knowledge items of the action knowledge items in the corresponding test path as output; as well as The action knowledge items, the inputs, and the outputs are formatted into structured data in a portable syntax format.

16. The electronic device according to claim 10, wherein the test object comprises a state object, and the action further comprises: Tracing the verification action knowledge entry preceding the state knowledge entry corresponding to the state object in the corresponding test path; Tracking an upstream knowledge entry of the verification action knowledge entry as a resource in the corresponding test path; as well as The verification action knowledge items, the resources and the state knowledge items are formatted into structured data in a portable syntax format.

17. The electronic device according to claim 10, wherein the actions further comprise: generating a descriptive statement based on the structured data in the portable syntax format corresponding to the test object; as well as A comment is added to the generated descriptive statement.

18. The electronic device according to claim 10, wherein The knowledge items included in the knowledge base are generated based on the development documentation of the system, and The knowledge items included in the knowledge base are presented in at least one of the following presentation modes: a graphical presentation mode, or a textual presentation mode.

19. A computer program product tangibly stored on a non-transitory computer-readable medium and comprising computer-executable instructions that, when executed by a processor of a computer, cause the computer to: In response to a target function of a system being developed, determining updated knowledge corresponding to the target function in a knowledge base of the system; identifying at least one test path from the updated knowledge in the knowledge base based on a predetermined test scope for the target function; as well as A test case for the target function is generated by extracting a test object from each test path of the at least one test path.

20. The computer program product of claim 19, wherein the test object comprises an action object, the computer-executable instructions further causing the computer to: Tracing the upstream knowledge entry of the action knowledge entry corresponding to the action object in the corresponding test path as input, Tracing downstream knowledge items of the action knowledge item in the corresponding test path as output; and The action knowledge items, the inputs, and the outputs are formatted into structured data in a portable syntax format.