A test case management method and device
By unifying test cases into use case normalized model, the problem of high maintenance costs of storage resources and code in the existing technology is solved, and efficient test case management and simplified statistical process are realized.
Patent Information
- Application Number
- CN202111582876.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-12-22
AI Technical Summary
Existing test case management methods require abstracting data models for each type of test cases, resulting in high maintenance costs for storage resources and code, and complex number of statistical test cases.
Unify various types of test cases into a use case normalized model. By comparing the use case elements and the use case fields, find the same and differential elements, and structure the differential elements, select the storage location, and store the same elements and structured information in the corresponding fields of the use case normalized model.
Reduces storage resource requirements, reduces code writing and maintenance costs, improves the storage efficiency and scalability of test cases, and simplifies the statistical process.
Smart Images

Figure CN116340128B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a test case management method and device. Background Art
[0002] A test case is a set of test inputs, execution conditions, and expected results compiled for a specific objective, used to verify whether a specific software requirement is met. Conventional test case management methods categorize test cases into different types based on the test objectives and design their storage structure. Specifically, when storing test cases, a corresponding data model is abstracted based on the test case elements of each type of test case. A data table is then created to store the test case elements, and the corresponding add, delete, modify, and query code is written.
[0003] In the process of implementing the present invention, there are at least the following problems in the prior art:
[0004] In the existing test case management method, a data model is abstracted for each type of test case, which requires the maintenance of a large amount of storage resources and a large amount of add, delete, modify and query code, resulting in relatively high development and maintenance costs. At the same time, each time a new type of test case is added, the table structure must be redesigned and the corresponding add, delete, modify and query code must be written. In addition, when counting the number of test cases, it is necessary to count and sum the test cases for each type, which is relatively complicated. Summary of the Invention
[0005] In view of this, an embodiment of the present invention provides a test case management method and device, which unifies test cases of various use case types into a use case normalization model. When storing test cases, the use case elements of the test cases are compared with the use case fields of the use case normalization model to find the same elements and different elements, and the different elements are structured and the storage location is selected, and then the structured information and the same elements are stored in the corresponding fields of the use case normalization model, which reduces the requirements for storage resources and reduces the cost of code writing and maintenance.
[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a test case management method is provided.
[0007] A test case management method according to an embodiment of the present invention includes: comparing multiple use case elements of a test case with use case fields in a preset use case normalization model, finding use case elements that match the use case fields as identical elements, and use case elements that do not match the use case fields as different elements; structuring the different elements to obtain structured information, judging whether the multiple use case elements include execution steps, and selecting a storage location for the structured information in the use case field of the use case normalization model according to the judgment result; storing the identical elements in the matching use case field in the use case normalization model, and storing the structured information in the use case field corresponding to the storage location.
[0008] Optionally, the multiple use case elements include a use case type; the structuring of the difference elements to obtain structured information includes: adding the use case type and the difference elements between a set pair of identifiers; wherein the difference elements are arranged in rows and are located between the use case type and one of the identifiers.
[0009] Optionally, the method further includes: counting the number of occurrences of multiple use case elements of multiple types of test cases; selecting use case elements that meet the filtering conditions based on the number of occurrences and set filtering conditions; and using the filtered use case elements as the use case fields of the use case normalization model to complete the construction of the use case normalization model.
[0010] Optionally, the use case field of the use case normalization model includes a use case title, priority, execution steps and expected results; and selecting the storage location of the structured information in the use case field of the use case normalization model based on the judgment result includes: when the multiple use case elements include an execution step, using the execution step field of the use case normalization model as the storage location of the structured information; when the multiple use case elements do not include an execution step, using a designated field of the use case normalization model as the storage location of the structured information.
[0011] Optionally, the use case field of the use case normalization model includes a use case type; the method further includes: searching for a corresponding alienation processor according to the use case type; wherein the alienation processor is used to convert the use case normalization model into an original use case model for interface display; and calling the alienation method of the alienation processor to convert the use case normalization model into the original use case model.
[0012] Optionally, converting the use case normalization model into the original use case model includes: acquiring structured information in the use case normalization model, converting the structured information into an original format corresponding to the use case type, and obtaining the original use case model.
[0013] Optionally, the use case normalization model is implemented by at least one data table, which includes the use case field. The method also includes: executing a set query statement on the data table to count the number of test cases; wherein the query statement is used to return the number of records that meet the set conditions.
[0014] To achieve the above object, according to another aspect of an embodiment of the present invention, a test case management device is provided.
[0015] A test case management device according to an embodiment of the present invention includes: a comparison module for comparing multiple use case elements of a test case with the use case fields in a preset use case normalization model, finding out the use case elements that match the use case fields as identical elements, and finding out the use case elements that do not match the use case fields as different elements; a processing module for performing structured processing on the different elements to obtain structured information, judging whether the multiple use case elements include execution steps, and selecting a storage location for the structured information in the use case field of the use case normalization model according to the judgment result; a storage module for storing the identical elements in the matching use case fields in the use case normalization model, and storing the structured information in the use case field corresponding to the storage location.
[0016] Optionally, the multiple use case elements include a use case type; the processing module is further used to add the use case type and the difference element between a set pair of identifiers; wherein the difference element is arranged in rows and is located between the use case type and one of the identifiers.
[0017] Optionally, the device also includes: a construction module, which is used to count the number of occurrences of multiple use case elements based on multiple types of test case use case elements; select the use case elements that meet the filtering conditions based on the number of occurrences and the set filtering conditions; and use the filtered use case elements as the use case fields of the use case normalization model to complete the construction of the use case normalization model.
[0018] Optionally, the use case field of the use case normalization model includes a use case title, priority, execution steps and expected results; the processing module is further used to, when the multiple use case elements include an execution step, use the execution step field of the use case normalization model as the storage location of the structured information; when the multiple use case elements do not include an execution step, use the designated field of the use case normalization model as the storage location of the structured information.
[0019] Optionally, the use case field of the use case normalization model includes a use case type; the device also includes: an alienation module, used to search for a corresponding alienation processor according to the use case type; wherein the alienation processor is used to convert the use case normalization model into an original use case model for interface display; and call the alienation method of the alienation processor to convert the use case normalization model into the original use case model.
[0020] Optionally, the alienation module is further configured to obtain structured information in the use case normalization model, convert the structured information into an original format corresponding to the use case type, and obtain the original use case model.
[0021] Optionally, the use case normalization model is implemented by at least one data table, the data table includes the use case field, and the device also includes: a statistical module, used to execute a set query statement on the data table to count the number of test cases; wherein the query statement is used to return the number of records that meet the set conditions.
[0022] To achieve the above objective, according to another aspect of the embodiments of the present invention, an electronic device is provided.
[0023] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a test case management method according to an embodiment of the present invention.
[0024] To achieve the above objective, according to another aspect of the embodiments of the present invention, a computer-readable medium is provided.
[0025] A computer-readable medium according to an embodiment of the present invention stores a computer program, which, when executed by a processor, implements a test case management method according to an embodiment of the present invention.
[0026] One embodiment of the above invention has the following advantages or beneficial effects: test cases of various use case types are unified into a use case normalization model. When storing test cases, the use case elements of the test cases are compared with the use case fields of the use case normalization model to find the same elements and different elements, and the different elements are structured and the storage location is selected, and then the structured information and the same elements are stored in the corresponding fields of the use case normalization model, which reduces the requirements for storage resources and reduces the cost of code writing and maintenance.
[0027] By adding use case types and differentiating elements between a pair of identifiers, we achieve structured processing, requiring fewer characters, reducing storage space, and facilitating understanding. Based on the essential use case elements for each use case type, we abstract a use case normalization model applicable to various test case types. This allows for efficient storage of different test case types, reducing storage requirements, code writing, and maintenance costs. Furthermore, adding new use case types eliminates the need to modify the model, ensuring excellent scalability.
[0028] Determine the storage location of structured information based on whether the use case elements contain execution steps to ensure correct test case execution. Based on the use case type, convert the use case normalization model into the original use case model to facilitate interface display and enhance the user experience. By executing a single query statement, the number of test cases can be counted, improving the efficiency of test case statistics.
[0029] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings are provided for a better understanding of the present invention and are not intended to limit the present invention.
[0031] Figure 1 is a schematic diagram of the main steps of the test case management method according to an embodiment of the present invention;
[0032] Figure 2 is a schematic diagram of the main flow of the test case management method according to an embodiment of the present invention;
[0033] Figure 3 1 is a schematic diagram of the implementation process of model alienation in the test case management method according to an embodiment of the present invention;
[0034] Figure 4 is a schematic diagram of the execution logic of the alienation processor according to an embodiment of the present invention;
[0035] Figure 5 is a schematic diagram of main modules of a test case management device according to an embodiment of the present invention;
[0036] Figure 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
[0037] Figure 7 It is a schematic structural diagram of a computer device suitable for implementing an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following description of exemplary embodiments of the present invention is made in conjunction with the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0039] Figure 1 FIG. 1 is a schematic diagram of the main steps of the test case management method according to an embodiment of the present invention. Figure 1 As shown, the test case management method of the embodiment of the present invention mainly includes the following steps:
[0040] Step S101: Multiple use case elements of a test case are compared with the use case fields in a preset use case normalization model. Use case elements that match the use case fields are identified as identical elements, and use case elements that do not match the use case fields are identified as different elements. The use case normalization model is abstracted from the use case elements of multiple types of test cases and is suitable for storing a unified model of multiple types of test cases, including multiple use case fields.
[0041] A use case element includes an element name and an element value, and a use case field includes a field name and a field value. In an embodiment, multiple use case elements of a test case are respectively compared with the use case fields in the use case normalization model, that is, multiple element names of the use case element are respectively matched with the field names in the use case normalization model. If there is a field name that matches the current element name, it is considered that the use case field corresponding to the field name matches the use case element corresponding to the current element name; if all field names do not match the current element name, it is considered that there is no use case field in the use case normalization model that matches the use case element corresponding to the current element name.
[0042] Step S102: Structural processing is performed on the difference elements to obtain structured information, and it is determined whether the multiple use case elements contain execution steps. Based on the determination result, the storage location of the structured information is selected in the use case field of the use case normalization model. Structural processing is to convert the difference elements into a specified format, such as XML format, JSON format, etc. The information obtained through structured processing as a whole needs to be consistent during storage, reading and writing. Among them, XML is a markup language used to mark electronic files to make them structured, and JSON is a lightweight data exchange format.
[0043] Typically, the use case elements of a test case include a title, priority, preconditions, execution steps, and expected results. However, in some special business scenarios, a test case may not have execution steps. The title describes the purpose of the test case; the priority classifies the test case by importance; the preconditions describe the conditions that must be met for the test case to execute; the execution steps are the actual execution instructions for the test case; and the expected results are a description of the expected results produced by the execution steps, indicating whether the execution steps meet expectations.
[0044] In practical applications, test cases can include manual test cases and automated test cases. Manual test cases are test cases that require manual execution, while automated test cases are test cases that utilize automated execution to achieve the expected results. To ensure the universality of this embodiment, and because automated test cases primarily focus on automated execution, the execution steps are used to describe the execution in the test case. Therefore, the storage location of the structured information can be determined based on whether the use case element contains execution steps.
[0045] Step S103: Storing the identical elements in the matching use case fields in the use case normalization model and storing the structured information in the use case fields corresponding to the storage location. By storing identical elements in the matching use case fields in the use case normalization model and storing the structured information in the selected storage location in the use case normalization model, test cases can be stored in a unified use case normalization model, reducing storage resource requirements and code writing and maintenance costs.
[0046] Figure 2 FIG. 1 is a schematic diagram of the main flow of the test case management method according to an embodiment of the present invention. Figure 2 As shown, the test case management method of the embodiment of the present invention mainly includes the following steps:
[0047] Step S201: Construct a use case normalization model based on the use case elements possessed by various types of test cases. This implementation unifies the data models of different types of test cases into a use case normalization model. In this embodiment, the number of occurrences of multiple use case elements can be counted based on the use case elements of various types of test cases. Then, based on the number of occurrences and the set filtering conditions, the use case elements that meet the filtering conditions are selected. The selected use case elements are then used as the use case fields of the use case normalization model, thereby completing the construction of the use case normalization model.
[0048] Exemplarily, the use case elements of a manual use case may include a use case title, priority, preconditions, execution steps, and expected results. The use case elements of an HTTP interface use case in an automated use case may include a use case title, priority, interface access address, interface request method, request input parameters, and expected results. Count the number of occurrences of each use case element, and use the top N use case elements with the most occurrences, or use case elements with a number of occurrences greater than a set threshold, as the use case fields of the use case normalization model. Where N is an integer. In the above example, the screening condition is the top N use case elements with the most occurrences, or the number of occurrences of a use case element is greater than a set threshold.
[0049] In an optional embodiment, a relational database can be used to store use case elements. Specifically, the use case normalization model can be implemented by at least one data table, which includes a use case field. To distinguish different types of test cases, a use case type field can be added to the use case normalization model. The use case normalization model can then be shown in Tables 1 and 2:
[0050] Table 1: Use case table
[0051]
[0052] Table 2: Use case steps
[0053]
[0054] It should be understood that Tables 1 and 2 above are only examples. In actual applications, Tables 1 and 2 can be combined into a single data table. Furthermore, the use case fields in the use case normalization model are not limited to those shown in Tables 1 and 2 above; use case fields can be increased or decreased based on actual needs. However, in general, a use case normalization model includes at least three fields: use case title, execution steps, and expected results. Furthermore, in addition to field name, field type, and field description, field items in Tables 1 and 2 can also include field length.
[0055] Step S202: Compare the multiple use case elements of the current test case with the use case fields in the use case normalization model respectively, find out the use case elements that match the use case fields as the same elements, and find out the use case elements that do not match the use case fields as the difference elements. Compare the multiple use case elements of the current test case (i.e., a certain type of test case) with the use case fields in the use case normalization model respectively, that is, match the multiple element names of the current use case elements with the field names in the use case normalization model respectively. In the embodiment, the existing mature string matching and similarity calculation methods can be used to determine whether the element name and the field name match.
[0056] If a field name in the use case normalization model matches the current feature name, the use case field corresponding to that field name is considered to match the use case feature corresponding to the current feature name. If all field names in the use case normalization model do not match the current feature name, it is considered that no use case field in the use case normalization model matches the use case feature corresponding to the current feature name. Use case features with matching use case fields (i.e., use case features that match the use case fields) are considered identical features, and use case features without matching use case fields (i.e., use case features that do not match the use case fields) are considered different features.
[0057] Step S203: Structural processing is performed on the difference elements to obtain structured information. The difference elements can be structured in the following manner: the use case type and the difference element are added between a set pair of identifiers. The identifier is used to identify that this part is a structured difference element structure, which facilitates program parsing. The difference elements are arranged in rows and located between the use case type and an identifier. Compared with XML format and JSON format, this processing method requires fewer characters and does not require learning other knowledge. It takes up less storage space and has a low understanding cost.
[0058] In the embodiment, the identifier may be a special character "```" and is structured as follows:
[0059] ```Use case type
[0060] The difference elements are arranged in rows, with one difference element per row
[0061] ```
[0062] Structured data as a whole must be consistent during storage, reading, and writing. This means that all different elements of the structured data must be read or written during storage, reading, and writing.
[0063] Step S204: Determine whether the multiple use case elements contain execution steps. If so, proceed to step S205; otherwise, proceed to step S206. In most business scenarios, test cases contain execution steps; in a few, they do not. Therefore, the storage location of the structured information is determined based on whether the multiple use case elements of the current test case contain execution steps.
[0064] Step S205: Use the execution step field of the use case normalization model as the storage location for the structured information, and execute step S207. If the test case contains execution steps, the structured information is stored in the execution step field of the use case normalization model (ie, the step field in Table 2).
[0065] In an optional embodiment, under the premise of maintaining consistency of structured data, the step field may also contain other content, such as adding additional description to the step field. In this case, the field value of the step field may be:
[0066] Additional explanation for the step field
[0067] ```Use case type
[0068] The difference elements are arranged in rows, with one difference element per row
[0069] ```
[0070] Additional information for the step field
[0071] Step S206: Use the designated field of the use case normalization model as the storage location for the structured information, and proceed to step S207. If the test case does not contain an execution step, the structured information is stored in the designated field of the use case normalization model. The designated field is a field other than the execution step field, such as the expected result, precondition, or use case title.
[0072] Step S207: Storing identical elements in the matching use case fields in the use case normalization model and storing structured information in the use case fields corresponding to the storage location. By storing identical elements in the matching use case fields in the use case normalization model and storing structured information in the selected storage location in the use case normalization model, the current test case is stored in the use case normalization model.
[0073] In an optional embodiment, if the total number of test cases needs to be counted, a set query statement can be executed on the data table of the use case normalization model to complete the test case count. The query statement is used to return the number of records that meet the set conditions. For example, it can be the following SQL (Structured Query Language) statement: SELECT COUNT(1) FROM [table]. In this embodiment, only one SQL statement needs to be executed to complete the test case count, thereby improving statistical efficiency.
[0074] The following will take the HTTP interface use case in the automation use case as the current test case to further explain the management method of the above test case.
[0075] The use case type of an HTTP interface use case is HTTP, and the use case elements include the use case number, use case title, priority, interface access address (url), interface request method (method), request input parameters (params), and expected result. By executing step S202, the different elements found are the interface access address (url), interface request method (method), and request input parameters (params), and the identical elements are the use case number, use case title, priority, and expected result.
[0076] Then, step S203 is executed to obtain the structured information:
[0077] HTTP
[0078] url
[0079] method
[0080] params
[0081] ```
[0082] Then, step S204 to step S206 are executed. Since the use case element includes execution steps, the storage location of the difference element is determined to be the step field. Finally, step S207 is executed to obtain the storage result of the HTTP interface use case as shown in Table 3.
[0083] Table 3
[0084]
[0085]
[0086] When designing interactions for some systems, in order to enhance user experience, different user interfaces need to be designed based on the use case type. In this case, the use case normalization model needs to be transformed into the original data model to facilitate page display. The specific implementation is as follows: Figure 3 shown.
[0087] Figure 3 This is a schematic diagram of the implementation process of model alienation in the test case management method of the embodiment of the present invention. Figure 3 As shown, the model alienation process of the embodiment of the present invention is executed after step S207 and mainly includes the following steps:
[0088] Step S301: Search for the corresponding alienation processor based on the use case type. Search for the corresponding alienation processor based on the case_type field in the use case table. The alienation processor is used to convert the use case normalization model into the original use case model for interface display, which is the reverse operation of use case normalization. In this embodiment, the execution logic of the alienation processor can be as follows:
[0089] Obtain the structured information of the normalized use case model, identify the use case type, read the use case elements row by row, and convert the use case elements into the original format corresponding to the use case type to obtain the original use case model. Identifying the use case type involves reading the string between the first identifier and the first use case element from the structured information.
[0090] Figure 4 FIG. 1 is a schematic diagram of the execution logic of the alienation processor according to an embodiment of the present invention. Figure 4 As shown in the figure, using the HTTP interface use case as an example, identifying the use case type involves reading the string "HTTP" between the first identifier "```" and the first use case element "url" from the structured information. This string is the use case type. Next, the use case elements "url", "method", and "params" are read line by line and converted to the format corresponding to the HTTP use case.
[0091] Step S302: Invoke the alienation method of the alienation processor to convert the normalized use case model into the original use case model. The alienation method performs the reverse operation according to the logic of model normalization, ultimately obtaining the original use case model. Still using the HTTP interface use case as an example, Table 4 shows the table structure of the original use case model (i.e., the original data model) obtained by the conversion.
[0092] Table 4
[0093]
[0094] From the above description, it can be seen that this embodiment is based on an abstract use case normalization model, which enables test cases of different use case types to be effectively stored. At the same time, there is no need to design table structures separately for test cases of different use case types, and to write add, delete, modify and query codes separately for the table structures, thereby reducing the workload of code writing and maintenance. The table structure of the use case normalization model has not changed compared to the table structure of the original data model, which reduces storage resource requirements and has good scalability.
[0095] Figure 5 FIG. 1 is a schematic diagram of the main modules of the test case management device according to an embodiment of the present invention. Figure 5 As shown, the test case management device 500 of the embodiment of the present invention mainly includes:
[0096] Comparison module 501 is configured to compare multiple use case elements of a test case with the use case fields in a preset use case normalization model, identifying use case elements that match the use case fields as identical elements and identifying use case elements that do not match the use case fields as different elements. The use case normalization model is abstracted from use case elements of multiple types of test cases and is suitable for storing a unified model of multiple types of test cases, including multiple use case fields.
[0097] A use case element includes an element name and an element value, and a use case field includes a field name and a field value. In an embodiment, multiple use case elements of a test case are respectively compared with the use case fields in the use case normalization model, that is, multiple element names of the use case element are respectively matched with the field names in the use case normalization model. If there is a field name that matches the current element name, it is considered that the use case field corresponding to the field name matches the use case element corresponding to the current element name; if all field names do not match the current element name, it is considered that there is no use case field in the use case normalization model that matches the use case element corresponding to the current element name.
[0098] Processing module 502 is configured to perform structured processing on the difference elements to obtain structured information, determine whether the multiple use case elements contain execution steps, and select a storage location for the structured information within the use case field of the use case normalization model based on the determination result. Structural processing involves converting the difference elements into a specified format, such as XML or JSON. The information obtained through structured processing, as a whole, must be consistent during storage, reading, and writing.
[0099] In practical applications, test cases can include manual test cases and automated test cases. To ensure the universality of this embodiment, and because automated test cases focus primarily on automated execution, test cases describe execution steps. Therefore, the storage location of structured information can be determined based on whether the use case elements contain execution steps.
[0100] Storage module 503 is configured to store the identical elements in the matching use case fields in the use case normalization model and the structured information in the use case fields corresponding to the storage locations. By storing identical elements in the matching use case fields in the use case normalization model and the structured information in the selected storage locations within the use case normalization model, test cases can be stored in a unified use case normalization model, reducing storage resource requirements and code writing and maintenance costs.
[0101] In addition, the test case management device 500 of the embodiment of the present invention may further include: a construction module, an alienation module and a statistics module ( Figure 5 (not shown in the figure). The construction module is configured to count the number of occurrences of multiple use case elements of multiple types of test cases; select use case elements that meet the screening conditions based on the number of occurrences and the set screening conditions; and use the screened use case elements as use case fields of the use case normalization model to complete the construction of the use case normalization model.
[0102] The alienation module is configured to search for a corresponding alienation processor based on the use case type; the alienation processor is configured to convert the use case normalization model into an original use case model for interface display; and the alienation method of the alienation processor is invoked to convert the use case normalization model into the original use case model. The statistics module is configured to execute a set query statement on the data table to count the number of test cases; the query statement is configured to return the number of records that meet the set conditions.
[0103] From the above description, it can be seen that the test cases of various use case types are unified into a use case normalization model. When storing the test cases, the use case elements of the test cases are compared with the use case fields of the use case normalization model to find the same elements and different elements. The different elements are structured and the storage location is selected. Then, the structured information and the same elements are stored in the corresponding fields of the use case normalization model, which reduces the requirements for storage resources and reduces the cost of code writing and maintenance.
[0104] Figure 6 An exemplary system architecture 600 is shown to which the test case management method or the test case management apparatus according to the embodiment of the present invention can be applied.
[0105] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0106] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Terminal devices 601, 602, and 603 can be various electronic devices with display screens and support web browsing, including but not limited to smartphones, tablet computers, laptop computers, and desktop computers, etc.
[0107] Server 605 can be a server that provides various services, such as a background management server that processes test case management requests sent by administrators using terminal devices 601, 602, and 603. The background management server can compare the use case elements in the management request with the use case fields in the use case normalization model, identify the different elements and the same elements, structure the different elements, determine the storage location of the structured information, store the same elements and structured information in the corresponding fields of the use case normalization model, and feedback the processing results (e.g., storage results) to the terminal device.
[0108] It should be noted that the test case management method provided in the embodiment of the present application is generally executed by the server 605 , and accordingly, the test case management device is generally set in the server 605 .
[0109] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0110] According to an embodiment of the present invention, the present invention further provides an electronic device and a computer-readable medium.
[0111] The electronic device of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a test case management method of an embodiment of the present invention.
[0112] The computer-readable medium of the present invention stores a computer program thereon, and when the program is executed by a processor, a test case management method of an embodiment of the present invention is implemented.
[0113] Reference below Figure 7 , which shows a schematic structural diagram of a computer system 700 suitable for implementing an electronic device according to an embodiment of the present invention. Figure 7 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0114] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the computer system 700 are also stored in the RAM 703. The CPU 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0115] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 708 including a hard disk; and a communication section 709 including a network interface card such as a LAN card or a modem. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 710 as needed, so that computer programs read therefrom can be installed into the storage section 708 as needed.
[0116] In particular, according to the embodiments disclosed herein, the processes described in the main step diagrams above can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the methods shown in the main step diagrams. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from a removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0117] It should be noted that the computer-readable medium described in the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.
[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two 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 box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0119] The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The modules described may also be provided in a processor. For example, they may be described as: a processor including a comparison module, a processing module, and a storage module. The names of these modules do not, in some cases, constitute a limitation on the modules themselves. For example, the comparison module may also be described as "a module that compares the multiple use case elements of a test case with the use case fields in a preset use case normalization model, and finds the use case elements that match the use case fields as identical elements, and the use case elements that do not match the use case fields as different elements."
[0120] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: comparing multiple use case elements of the test case with the use case fields in a preset use case normalization model, finding the use case elements that match the use case fields as identical elements, and the use case elements that do not match the use case fields as different elements; structuring the different elements to obtain structured information, judging whether the multiple use case elements contain execution steps, and selecting a storage location for the structured information in the use case field of the use case normalization model according to the judgment result; storing the identical elements in the matching use case fields in the use case normalization model, and storing the structured information in the use case field corresponding to the storage location.
[0121] According to the technical solution of an embodiment of the present invention, test cases of various use case types are unified into a use case normalization model. When storing test cases, the use case elements of the test cases are compared with the use case fields of the use case normalization model to find the same elements and different elements. The different elements are structured and the storage location is selected, and then the structured information and the same elements are stored in the corresponding fields of the use case normalization model, which reduces the requirements for storage resources and reduces the cost of code writing and maintenance.
[0122] The above-mentioned product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0123] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A test case management method, characterized in that: include: Comparing the multiple use case elements of the test case with the use case fields in the preset use case normalization model, finding the use case elements that match the use case fields as identical elements, and finding the use case elements that do not match the use case fields as different elements; wherein the use case fields in the use case normalization model are the use case elements that meet the screening conditions; Structuring the difference elements to obtain structured information, determining whether the multiple use case elements include execution steps, and selecting a storage location for the structured information in the use case field of the use case normalization model based on the determination result; Storing the same elements in the matching use case fields in the use case normalization model, and storing the structured information in the use case fields corresponding to the storage locations; The use case field of the use case normalization model includes a use case type; and the method further includes: Searching for a corresponding alienation processor according to the use case type; wherein the alienation processor is used to convert the use case normalization model into an original use case model for interface display; The alienation method of the alienation processor is called to transform the use case normalization model into the original use case model.
2. The method according to claim 1, characterized in that The plurality of use case elements include a use case type; The structural processing of the difference elements to obtain structured information includes: The use case type and the difference element are added between a set pair of identifiers; wherein the difference element is arranged in sequence in rows and is located between the use case type and one of the identifiers.
3. The method according to claim 1, characterized in that The method further comprises: According to the use case elements of multiple types of test cases, counting the number of occurrences of multiple use case elements; Selecting use case elements that meet the filtering conditions based on the number of occurrences and the set filtering conditions; The filtered use case elements are used as the use case fields of the use case normalization model to complete the construction of the use case normalization model.
4. The method according to claim 1, wherein The use case fields of the use case normalization model include use case title, priority, execution steps and expected results; The selecting a storage location of the structured information in the use case field of the use case normalization model according to the judgment result includes: In the case where the multiple use case elements include execution steps, the execution step field of the use case normalization model is used as the storage location of the structured information; In a case where the multiple use case elements do not include an execution step, a designated field of the use case normalization model is used as a storage location for the structured information.
5. The method according to claim 1, wherein The converting the use case normalization model into the original use case model includes: The structured information in the use case normalization model is obtained, and the structured information is converted into an original format corresponding to the use case type to obtain the original use case model.
6. The method according to claim 1, characterized in that The use case normalization model is implemented by at least one data table, wherein the data table includes the use case field. The method further includes: Execute a set query statement on the data table to count the number of test cases; wherein the query statement is used to return the number of records that meet the set conditions.
7. A test case management device, characterized in that: include: a comparison module, configured to compare the multiple use case elements of the test case with the use case fields in a preset use case normalization model, and identify the use case elements that match the use case fields as identical elements and the use case elements that do not match the use case fields as different elements; wherein the use case fields in the use case normalization model are the use case elements that meet the screening conditions; a processing module configured to perform structured processing on the difference elements to obtain structured information, determine whether the multiple use case elements include execution steps, and select a storage location for the structured information in the use case field of the use case normalization model based on the determination result; A storage module, configured to store the identical elements in a matching use case field in the use case normalization model, and store the structured information in a use case field corresponding to the storage location; The use case field of the use case normalization model includes a use case type; the device also includes an alienation module, which is used to search for a corresponding alienation processor according to the use case type; wherein the alienation processor is used to convert the use case normalization model into an original use case model for interface display; and the alienation method of the alienation processor is called to convert the use case normalization model into the original use case model.
8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Interface automation test processing method, device and storage medium
CN112416751A
Method and device for converting test case file data
CN113760698A