Test case generation method and device, equipment and storage medium

By identifying the elements in the visual draft and matching them with the development interface documents, the final rule table is generated, and the problem of low efficiency in generating test cases in the existing technology is solved, and the generation of test cases with strong coverage is achieved, which improves the efficiency of the test team and Project progress.

CN119003351APending Publication Date: 2024-11-22CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411085011.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

Generating test cases in the prior art requires a lot of testing labor to write manual cases, which is relatively inefficient.

Method used

By obtaining requirements documents and development interface documents, identifying elements in the visual draft, matching them with the development interface documents, generating a final rule table, and generating a test case table based on the final rule table.

Benefits of technology

Ensure that all design and development requirements are covered, and the production of highly-covered test cases are generated, and the efficiency of the test team and overall project progress is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003351A_ABST
    Figure CN119003351A_ABST
Patent Text Reader

Abstract

The invention discloses a test case generation method and device, equipment and a storage medium, and relates to the technical field of tests.The method comprises the steps that a demand document and a development interface document are obtained; identifying a visual draft in the demand document to obtain elements in the visual draft; matching elements in the visual manuscript with the development interface document to generate a final rule table; and generating a test case table based on the final rule table. According to the method and the device, the test case generation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a test case generation method, apparatus, device and storage medium. Background Art

[0002] When designing test cases, for functions with many interface fields (there may be hundreds of interface elements), design analysis is mainly carried out from the aspects of UI check, field rule check, business rule check, scenario cases, compatibility cases, etc. Except for the design of scenario cases, the design ideas of other cases are relatively fixed and similar.

[0003] Currently, generating test cases requires a large amount of testing manpower to write manual cases, which is relatively inefficient.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a test case generation method, device, equipment and storage medium, aiming to solve the technical problem that the current generation of test cases requires a large amount of testing manpower to write manual cases, which is relatively inefficient.

[0006] To achieve the above objectives, the present application proposes a test case generation method, the method comprising:

[0007] Obtain requirement documents and development interface documents;

[0008] Identify the visual draft in the requirement document to obtain elements in the visual draft;

[0009] Matching the elements in the visual draft with the development interface document to generate a final rule table;

[0010] A test case table is generated based on the final rule table.

[0011] In one embodiment, the step of generating a test case table based on the final rule table includes:

[0012] A target case is obtained by screening from a pre-established basic case library, and the target case is merged into the test case table.

[0013] In one embodiment, the step of selecting a target case from a pre-established basic case library includes:

[0014] Obtaining case labels based on element recognition in the visual draft;

[0015] The target case is obtained by screening from the pre-established basic case library through the case label.

[0016] In one embodiment, the step of obtaining a target case by screening from a pre-established basic case library and merging the target case into the test case table includes:

[0017] Establishing the basic case library and storing the common cases in the basic case library;

[0018] The general case is labeled with the case tag.

[0019] In one embodiment, the step of obtaining a target case from a pre-established basic case library and merging the target case into the test case table includes:

[0020] According to the characteristics of different clients, common cases are generated, and the common cases include at least one of compatibility authentication, page jump, and page return.

[0021] In one embodiment, the step of obtaining a target case by screening from a pre-established basic case library and merging the target case into the test case table further includes:

[0022] Accumulate and / or optimize design ideas for generating test cases based on specific requirements and / or specific scenarios that arise in the project.

[0023] In one embodiment, the step of identifying the visual draft in the requirement document to obtain elements in the visual draft includes:

[0024] Recognize the visual draft by using OCR recognition technology to obtain elements in the visual draft, wherein the elements in the visual draft include at least one of field name, input requirement, space type, inputtable state, default value, enumeration value, and prompt information;

[0025] Storing the elements in the visual draft into an initial rule table;

[0026] The step of matching the elements in the visual draft with the development interface document to generate a final rule table includes:

[0027] The elements in the initial rule table are traversed in sequence to match the field type and / or field length in the development interface document to generate the final rule table.

[0028] In addition, to achieve the above purpose, the present application also proposes a test case generation device, the test case generation device comprising:

[0029] Data acquisition module, used to obtain requirement documents and development interface documents;

[0030] A recognition module, used to recognize the visual draft in the demand document and obtain the elements in the visual draft;

[0031] A matching module, used to match the elements in the visual draft with the development interface document to generate a final rule table;

[0032] A case generation module is used to generate a test case table based on the final rule table.

[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a test case generation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the test case generation method described above.

[0034] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the test case generation method described above are implemented.

[0035] One or more technical solutions proposed in this application have at least the following technical effects:

[0036] This application obtains the elements in the visual draft by identifying the visual draft in the requirement document; matches the elements in the visual draft with the development interface document to generate a final rule table, which can ensure that all design and development requirements are covered, and generates a test case table based on the final rule table to generate test cases with strong coverage, which helps to improve the efficiency of the test team and the overall project progress. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] Figure 1 A flowchart of the first embodiment of the test case generation method of the present application is provided;

[0040] Figure 2 A schematic diagram of a visual graph in a test case generation method of the present application;

[0041] Figure 3A schematic diagram of the interface document developed in the test case generation method of this application;

[0042] Figure 4 A schematic diagram of the final rule table in the test case generation method of this application;

[0043] Figure 5 A schematic diagram of a test case table in the test case generation method of the present application;

[0044] Figure 6 A schematic diagram of a test case table after merging in the test case generation method of the present application;

[0045] Figure 7 A schematic diagram of a basic case library in the test case generation method of this application;

[0046] Figure 8 This is a schematic diagram of the module structure of the test case generation device according to an embodiment of the present application;

[0047] Fig. 9 Schematic diagram of the device structure of the hardware operating environment involved in the test case generation method in the embodiment of the present application.

[0048] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0051] The main solution of the embodiment of the present application is: obtain the requirement document and the development interface document; identify the visual draft in the requirement document to obtain the elements in the visual draft; match the elements in the visual draft with the development interface document to generate a final rule table; generate a test case table based on the final rule table.

[0052] In this embodiment, for ease of description, the following description is made with the test case generating device as the execution subject.

[0053] Currently, generating test cases requires a large amount of testing manpower to write manual cases, which is inefficient.

[0054] The present application provides a solution, which obtains the elements in the visual draft by identifying the visual draft in the requirement document; matches the elements in the visual draft with the development interface document to generate a final rule table, which can ensure that all design and development requirements are covered, and generates a test case table based on the final rule table, which can generate test cases with strong coverage, which helps to improve the efficiency of the test team and the overall project progress.

[0055] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a test case generation device, etc. The following takes the test case generation device as an example to illustrate this embodiment and the following embodiments.

[0056] Based on this, the present application embodiment provides a test case generation method, referring to Figure 1 , Figure 1 A flowchart of the first embodiment of the test case generation method of the present application is provided.

[0057] In this embodiment, the test case generation method includes steps S10 to S40:

[0058] Step S10, obtaining requirement documents and development interface documents;

[0059] It should be noted that the document formats of the requirement documents and development interface documents need to be agreed upon in advance to improve the standardization of the requirement documents and development interface documents.

[0060] Step S20, identifying the visual draft in the demand document to obtain elements in the visual draft;

[0061] Among them, the requirement document includes a visual draft, the interface elements of which are clear and fixed in position, making it easy to identify different fields.

[0062] Reference Figure 2 , Figure 2 A schematic diagram of a visual graph in a test case generation method of the present application;

[0063] Figure 2 The visual diagram in contains the following:

[0064] (1) Required fields: Mark with an asterisk on the left.

[0065] (2) Whether input is allowed: If the input box is recognized as gray, it means that input is not allowed; otherwise, input is allowed.

[0066] (3) Default value: The input box is recognized without a colon but with a value, indicating the default value.

[0067] (4) Enumeration value: If a colon is recognized in the input box, it means that the field is an enumeration value.

[0068] (5) Prompt information: The input box is recognized to have brackets, which represent prompts.

[0069] (6) Button: If the input box recognizes a blue button, it means it is a function button.

[0070] Step S30, matching the elements in the visual draft with the development interface document to generate a final rule table;

[0071] Among them, refer to Figure 3 , Figure 3 A schematic diagram of the interface document developed in the test case generation method of this application;

[0072] The development interface document may include but is not limited to interface request package, response package, field length, field type, enumeration value, whether it is a required item, etc.

[0073] Among them, the elements in the visual draft can be matched with the development interface document, and a final rule table can be generated based on the elements in the visual draft and several items in the development interface document.

[0074] Reference Figure 4 , Figure 4 A schematic diagram of the final rule table in the test case generation method of this application.

[0075] The final rule table includes field name item, button item, field type item, field length item, required item, input allowed item, default value, enumeration value, and prompt information item.

[0076] As an implementation method, a background function can be provided to match the items in the visual draft and the interface document one by one. Click the "Automatically Generate Case" button. The background uses OCR scanning technology to first identify the elements in the visual draft, including field name, whether it is required, buttons, etc., and store them in the initial rule table SURF after identification. Then, each field of SURF is traversed in turn, matching the corresponding fields of the interface document, obtaining the field type and field length, and obtaining the final rule table.

[0077] Step S40: generating a test case table based on the final rule table.

[0078] Among them, the final rule table is read, test cases are gradually generated, and the generated test cases are recorded in the test case table.

[0079] Reference Figure 5 , Figure 5 A schematic diagram of a test case table in the test case generation method of the present application.

[0080] Among them, as an implementation method, you can first determine whether the field allows input, then determine whether it is required, then determine whether there is a default value, then consider the enumeration value, then process the prompt information, then determine the field type, and finally confirm the field length, and generate test cases related to each field in this order.

[0081] This embodiment provides a test case generation method, which obtains the elements in the visual draft by identifying the visual draft in the requirement document; matches the elements in the visual draft with the development interface document to generate a final rule table, which can ensure that all design and development requirements are covered, and generates a test case table based on the final rule table, which can generate test cases with strong coverage, which helps to improve the efficiency of the test team and the overall project progress.

[0082] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be repeated in the following. On this basis, in step S40, after generating a test case table based on the final rule table, the test case generation method further includes step S70:

[0083] Step S70, screen and obtain target cases from a pre-established basic case library, and merge the target cases into the test case table.

[0084] Among them, in order to ensure that the functional integrity and stability of the system under various conditions are fully verified, and common cases can be reused in different stages and versions to save testing resources and time, a basic case library was established.

[0085] Reference Figure 6 , Figure 6 A schematic diagram of a merged test case table in the test case generation method of the present application.

[0086] The merged test case table includes automatically generated cases and common cases (target cases) in the basic case library.

[0087] For the basic case library, please refer to Figure 7 , Figure 7 Schematic diagram of the basic case library in the test case generation method of this application.

[0088] The common cases in the basic case library include at least one of the test name, description, precondition, step description, expected result, priority, use case type, and use case attribute.

[0089] As an implementation method, the common cases in the basic case library may be divided according to function, scenario, risk, priority, etc., so that target cases may be subsequently screened by at least one of the function, scenario, risk, priority.

[0090] As another implementation, the background may provide a function for filtering common cases. By selecting one or more tags according to functional characteristics, the cases in the basic case library may be automatically filtered out and merged into the test case table.

[0091] The embodiment of the present application can utilize existing test cases and experience to avoid duplication of work by screening target cases from a pre-established basic case library. Common cases and automatically generated cases are merged to generate a test case table, which can improve test coverage.

[0092] Based on the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the second embodiment can be referred to the above description, and will not be described in detail later. On this basis, step S70, screening the target case from the pre-established basic case library, and merging the target case into the test case table includes steps S71 to S72:

[0093] Step S71, obtaining a case label based on element recognition in the visual draft;

[0094] It should be noted that natural language processing (NLP) technology can be used to analyze the elements in the visual draft and obtain case labels.

[0095] Step S72: Filter the target case from the pre-established basic case library using the case label.

[0096] It should be noted that one or more case tags, such as UI, accounting, notification, etc., can be added to the common cases in the pre-established basic case library to facilitate subsequent screening to obtain target cases based on the case tags.

[0097] The embodiment of the present application can better organize and manage cases by labeling common cases in the basic case library with multiple case labels, such as UI, accounting, notification, etc. This label management makes it more efficient and reliable to filter target cases by case labels later.

[0098] Based on the third embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the third embodiment can be referred to the above description, and will not be described in detail later. On this basis, step S70, before screening the target case from the pre-established basic case library and merging the target case into the test case table, also includes steps S50 to S60:

[0099] Step S50, establishing the basic case library and storing the common cases in the basic case library;

[0100] Step S60: label the general case with the case label.

[0101] Furthermore, case labels may include but are not limited to function labels and type labels:

[0102] (1) Functional label: Label the case according to the functions or modules involved, such as login, search, payment, etc.

[0103] (2) Type label: Mark the case type, such as functional testing, performance testing, security testing, etc., for subsequent classification and execution.

[0104] In addition, common cases can be associated with relevant requirements and known defects to ensure that the test covers all functions and problem points.

[0105] The embodiment of the present application can better organize and manage cases by labeling common cases in the basic case library with multiple case labels, such as UI, accounting, notification, etc. This label management makes it more efficient and reliable to filter target cases by case labels later.

[0106] Based on the second embodiment of the present application, in the fifth embodiment of the present application, the same or similar contents as those in the second embodiment can be referred to the above description, and will not be described in detail later. On this basis, step S70, after filtering out the target case from the pre-established basic case library and merging the target case into the test case table, further includes step S90:

[0107] Step S90, generating common cases, wherein the common cases include at least one of compatibility authentication, page jump, and page return.

[0108] As an implementation method, a requirement document and a development interface document can be obtained; the visual draft in the requirement document is identified to obtain the elements in the visual draft; the elements in the visual draft are matched with the development interface document to generate a final rule table; and then a test case table is generated based on the final rule table according to the characteristics of different clients, wherein the test case table includes common cases.

[0109] Compatibility certification ensures the normal operation and consistent performance of the application on various clients (such as different browsers, operating systems or device types). To this end, the following three aspects need to be considered:

[0110] (1) Cross-browser testing: Test the compatibility of the application in common browsers (such as Chrome, Firefox, Safari, Edge, etc.) to ensure the consistency of the interface and functions in various browsers.

[0111] (2) Cross-operating system testing: Verify the performance of the application on different operating systems (such as Windows, MacOS, Linux, etc.), including interface rendering, functional operation and performance.

[0112] (3) Cross-device type testing: Testing the application's compatibility with different device types (such as PCs, tablets, and mobile phones) and their different resolutions to ensure the responsiveness and usability of the interface.

[0113] Among them, page jump is the basic behavior of users when navigating and operating in the application, including the process and impact of going from one page to another. The relevant test cases can include the following three:

[0114] (1) Normal page jump: Test whether the page jump and loading are smooth and fast when the user clicks the link, button or navigation menu in the application.

[0115] (2) Abnormal page jump: Test the stability and rollback processing capability of page jump when the network condition is poor or the user performs other operations during the loading process.

[0116] (3) Deep link testing: Testing the correct loading of the page and the user experience when jumping from an external link or bookmark to a specific page within the application.

[0117] The page return function involves the operation and function of users returning from one page to the previous page. The relevant test cases can include the following three:

[0118] (1) Browser back button test: Test whether the application correctly returns to the last visited page and the status remains consistent when the user clicks the browser back button.

[0119] (2) In-application back button test: Test whether the back button or link provided in the application correctly returns to the previous page and maintains the data or operation status entered by the user.

[0120] (3) Return navigation bar function test: Test the return function provided in the page's navigation bar or other menu to ensure their reliability and consistency under various conditions.

[0121] By generating common cases, the embodiments of the present application can ensure that the product can exhibit consistency and high quality in different clients and usage scenarios, thereby improving the overall software quality and user experience.

[0122] Based on the second embodiment of the present application, in the sixth embodiment of the present application, the same or similar contents as those in the second embodiment can be referred to the above description, and will not be described in detail later. On this basis, step S70, after filtering out the target case from the pre-established basic case library and merging the target case into the test case table, further includes step S80:

[0123] Step S80, accumulating and / or optimizing design ideas for generating test cases according to specific requirements and / or specific scenarios arising in the project.

[0124] Among them, first obtain the requirement document and the development interface document; identify the visual draft in the requirement document to obtain the elements in the visual draft; match the elements in the visual draft with the development interface document to generate a final rule table; generate a test case table based on the final rule table, and then when summarizing and optimizing the test case table, accumulate and / or optimize the design ideas for generating test cases according to the specific requirements and / or specific scenarios that appear in the project.

[0125] As an implementation method, the final rule table may be optimized through accumulated and / or optimized design ideas.

[0126] The embodiments of the present application accumulate and / or optimize the design ideas for generating test cases according to the specific needs and / or specific scenarios that arise in the project, and can precipitate personalized case design ideas and continuously expand the breadth and depth of test cases.

[0127] Based on the first embodiment of the present application, in the seventh embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be repeated in the following. On this basis, step S20, identifying the visual draft in the demand document, and obtaining the elements in the visual draft also includes steps S21 to S22:

[0128] Step S21, recognizing the visual draft by OCR recognition technology to obtain elements in the visual draft, where the elements in the visual draft include at least one of field name, input requirement, space type, inputtable state, default value, enumeration value, and prompt information;

[0129] As an implementation method, a special visual draft parsing tool may be used to extract information elements in the visual draft through image analysis and pattern recognition.

[0130] Step S22, storing the elements in the visual draft into an initial rule table;

[0131] The step S30, matching the elements in the visual draft with the development interface document, and generating a final rule table includes step S31:

[0132] Step S31, traversing the elements in the initial rule table in sequence to match the field type and / or field length in the development interface document, and generating the final rule table.

[0133] Among them, each element of the initial rule table is traversed in turn, the corresponding field of the interface document is matched, the field type and field length are obtained, and the final rule table is generated.

[0134] The embodiment of the present application uses OCR recognition technology to recognize the visual draft, which can accurately extract key information elements, match the elements in the visual draft with the development interface document, and generate a final rule table. This ensures the consistency between the visual design and the actual development interface; by traversing the elements in the initial rule table and generating the final rule table based on the development interface document, the accuracy and consistency of the rules are guaranteed.

[0135] For example, in order to help understand the above embodiment, the implementation process of the test case generation method of the present application is listed below:

[0136] (1) Establish a basic case library, which mainly stores common cases. Common cases include different client compatibility, visuals, page jumps, etc., and give common cases different labels, such as web, mobile, etc.

[0137] (2) Obtain standard visual drafts (for example, required fields are marked with a red *) and development interface documents from the business side.

[0138] (3) Scan the visual graph, identify each element on the page, match the corresponding field in the interface document, read the field type and field length, and generate the final rule table.

[0139] (4) Automatically generate a test case table based on the final rule table.

[0140] (5) According to the functional characteristics, general cases are filtered from the basic case library by tags, and the filtered general cases (target cases) are merged into the test case table.

[0141] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the test case generation method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0142] This application also provides a test case generation device, please refer to Figure 8 , the test case generating device comprises:

[0143] Data acquisition module 10, used to acquire requirement documents and development interface documents;

[0144] The recognition module 20 is used to recognize the visual draft in the demand document and obtain the elements in the visual draft;

[0145] A matching module 30, for matching the elements in the visual draft with the development interface document to generate a final rule table;

[0146] The case generation module 40 is used to generate a test case table based on the final rule table.

[0147] The test case generation device provided by the present application adopts the test case generation method in the above embodiment, which can solve the technical problem that the generation of test cases requires a large amount of test manpower to write manual cases, which is inefficient. Compared with the prior art, the beneficial effects of the test case generation device provided by the present application are the same as the beneficial effects of the test case generation method provided by the above embodiment, and the other technical features in the test case generation device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0148] The present application provides a test case generation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the test case generation method in the above-mentioned embodiment 1.

[0149] Reference below Fig. 9 , which shows a schematic diagram of the structure of a test case generation device suitable for implementing the embodiment of the present application. The test case generation device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The test case generation device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0150] like Fig. 9As shown, the test case generation device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the test case generation device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the test case generation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a test case generation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0151] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0152] The test case generation device provided by the present application adopts the test case generation method in the above embodiment, which can solve the technical problem that the generation of test cases requires a large amount of test manpower to write manual cases, which is inefficient. Compared with the prior art, the beneficial effects of the test case generation device provided by the present application are the same as the beneficial effects of the test case generation method provided by the above embodiment, and the other technical features in the test case generation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0153] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0154] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0155] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the test case generation method in the above-mentioned embodiment.

[0156] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0157] The computer-readable storage medium may be included in the test case generating device; or may exist independently without being assembled into the test case generating device.

[0158] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the test case generation device, the test case generation device is enabled to: obtain a requirement document and a development interface document; identify the visual draft in the requirement document to obtain elements in the visual draft; match the elements in the visual draft with the development interface document to generate a final rule table; and generate a test case table based on the final rule table.

[0159] Computer program code for performing the operations of the present application 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), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0160] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that 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 square boxes represented in succession 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 operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0161] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0162] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned test case generation method, and can solve the technical problem that generating test cases requires a large amount of test manpower to write manual cases, which is inefficient. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the test case generation method provided by the above-mentioned embodiment, and will not be repeated here.

[0163] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A test case generation method, characterized in that: The method comprises: Obtain requirement documents and development interface documents; Identify the visual draft in the requirement document to obtain elements in the visual draft; Matching the elements in the visual draft with the development interface document to generate a final rule table; A test case table is generated based on the final rule table.

2. The method according to claim 1, characterized in that The step of generating a test case table based on the final rule table comprises: A target case is obtained by screening from a pre-established basic case library, and the target case is merged into the test case table.

3. The method according to claim 2, characterized in that The step of screening the target case from the pre-established basic case library comprises: Obtaining case labels based on element recognition in the visual draft; The target case is obtained by screening from the pre-established basic case library through the case label.

4. The method according to claim 3, characterized in that The step of obtaining a target case by screening from a pre-established basic case library and merging the target case into the test case table includes: Establishing the basic case library and storing the common cases in the basic case library; The general case is labeled with the case tag.

5. The method according to claim 2, characterized in that The step of obtaining a target case by screening from a pre-established basic case library and merging the target case into the test case table includes: According to the characteristics of different clients, common cases are generated, and the common cases include at least one of compatibility authentication, page jump, and page return.

6. The method according to claim 2, characterized in that After the step of selecting a target case from a pre-established basic case library and merging the target case into the test case table, the following steps are further included: Accumulate and / or optimize design ideas for generating test cases based on specific requirements and / or specific scenarios that arise in the project.

7. The method according to claim 1, characterized in that The step of identifying the visual draft in the demand document to obtain the elements in the visual draft includes: Recognize the visual draft by using OCR recognition technology to obtain elements in the visual draft, wherein the elements in the visual draft include at least one of field name, input requirement, space type, inputtable state, default value, enumeration value, and prompt information; Storing the elements in the visual draft into an initial rule table; The step of matching the elements in the visual draft with the development interface document to generate a final rule table includes: The elements in the initial rule table are traversed in sequence to match the field type and / or field length in the development interface document to generate the final rule table.

8. A test case generating device, characterized in that: The device comprises: Data acquisition module, used to obtain requirement documents and development interface documents; A recognition module, used to recognize the visual draft in the demand document and obtain the elements in the visual draft; A matching module, used to match the elements in the visual draft with the development interface document to generate a final rule table; A case generation module is used to generate a test case table based on the final rule table.

9. A test case generating device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the test case generation method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the test case generation method according to any one of claims 1 to 7 are implemented.