CN110806977A - Test case set generation method and device based on product requirements and electronic equipment - Google Patents

Test case set generation method and device based on product requirements and electronic equipment Download PDF

Info

Publication number
CN110806977A
CN110806977A CN201911042639.5A CN201911042639A CN110806977A CN 110806977 A CN110806977 A CN 110806977A CN 201911042639 A CN201911042639 A CN 201911042639A CN 110806977 A CN110806977 A CN 110806977A
Authority
CN
China
Prior art keywords
demand
test case
tree
leaf node
fragment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911042639.5A
Other languages
Chinese (zh)
Inventor
孔令静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taikang Insurance Group Co Ltd
Taikang Online Property Insurance Co Ltd
Original Assignee
Taikang Insurance Group Co Ltd
Taikang Online Property Insurance Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Taikang Insurance Group Co Ltd, Taikang Online Property Insurance Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201911042639.5A priority Critical patent/CN110806977A/en
Publication of CN110806977A publication Critical patent/CN110806977A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The invention discloses a test case set generation method and device based on product requirements and electronic equipment. The method comprises the following steps: acquiring a demand file of a product to be tested; analyzing the product requirements in the requirement file to generate a plurality of requirement fragments; determining whether a matching preconfigured demand tree exists for each demand fragment; when the pre-configuration requirement tree matched with the requirement fragment exists, searching leaf nodes matched with the requirement fragment in the pre-configuration requirement tree step by step; when the leaf node is found, acquiring at least one test case corresponding to the leaf node as at least one test case of the required fragment; when the leaf node is not found, creating a new leaf node for the pre-configured demand tree according to the classification level of the demand fragment, and determining at least one test case for the new leaf node as at least one test case of the demand fragment; and generating a test case set for the product to be tested according to at least one test case of each required fragment.

Description

Test case set generation method and device based on product requirements and electronic equipment
Technical Field
The invention relates to the field of Internet product testing, in particular to a test case set generation method and device based on product requirements, electronic equipment and a computer readable storage medium.
Background
At present, when testing internet products, such as online insurance products, test cases are generally stored in an excel file or a test case library for management, and the test cases exist in a form of a set one by one, wherein a plurality of test cases belong to a certain test task or a certain product. When the test case is reused, the original test case is firstly acquired, then the original test case is confirmed or modified according to the new product requirements, and then the automatic test or the manual test is executed.
Under the development trend of short online period, large quantity and high iteration speed (for example, 2-3 days) of products, more and more repetitive work is needed when test cases are reused, and meanwhile, the quality of the test cases is difficult to guarantee. On the premise of ensuring the coverage rate of the test cases, the preparation time of the test cases is shortened as much as possible, and the method has important significance for the rapid online of subsequent internet products.
The above information disclosed in this background section is only for enhancement of understanding of the background of the invention and therefore it may contain information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for generating a test case set based on product requirements, an electronic device, and a computer-readable storage medium.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to an aspect of the present invention, a test case suite generation method based on product requirements is provided, including: acquiring a demand file of a product to be tested; analyzing the requirements of the products to be tested in the requirement file to generate a plurality of requirement fragments; determining, for each of the demand pieces, whether a matching preconfigured demand tree exists; when the fact that a pre-configuration demand tree matched with the demand fragments exists is determined, leaf nodes matched with the demand fragments are searched step by step in the pre-configuration demand tree; when the leaf node is found, acquiring at least one test case corresponding to the leaf node as at least one test case of the required fragment; when the leaf node is not found, creating a new leaf node for the pre-configured demand tree according to the classification level of the demand fragment, and determining at least one test case for the new leaf node as at least one test case of the demand fragment; and generating a test case set for the product to be tested according to at least one test case of each required fragment.
According to an embodiment of the invention, determining whether there is a matching preconfigured demand tree comprises: determining whether a preconfigured demand tree exists that matches the demand shard based on the classification level of the demand shard.
According to an embodiment of the invention, when it is determined that there is no preconfigured demand tree matching the demand shard, the method further comprises: establishing a demand tree matched with the demand fragments according to the classification levels of the demand fragments; and sequentially establishing nodes at all levels of the demand tree in the demand tree according to the classification level of the demand fragments.
According to an embodiment of the present invention, analyzing the demand of the product to be tested in the demand file includes: and analyzing the requirements of the products to be tested in the requirement file according to a preset template.
According to an embodiment of the present invention, creating a new leaf node for the preconfigured demand tree comprises: whether the new leaf node can automatically generate a test case is marked; determining at least one test case for the new leaf node comprises: and when the new leaf node mark can automatically generate the test case, automatically generating at least one test case for the new leaf node.
According to an embodiment of the present invention, each of the test cases includes use case tagging information, where the use case tagging information includes: the leaf node number corresponding to the test case, the number of the test case, whether the test case can carry out automatic test or not and the number of the corresponding automatic test script.
According to an embodiment of the present invention, the leaf nodes and the values in the test cases are parameterized data; after obtaining at least one test case corresponding to the leaf node, the method further includes: and assigning the parameterized data in the at least one test case according to the content of the demand fragments.
According to another aspect of the present invention, there is provided a test case set generating apparatus based on product requirements, including: the file acquisition module is used for acquiring a demand file of a product to be tested; the demand analysis module is used for analyzing the demands of the products to be tested in the demand file to generate a plurality of demand fragments; a fragment matching module for determining, for each of the demand fragments, whether a matching preconfigured demand tree exists; the use case matching module is used for searching leaf nodes matched with the demand fragments step by step in the pre-configuration demand tree when the pre-configuration demand tree matched with the demand fragments is determined to exist; when the leaf node is found, acquiring at least one test case corresponding to the leaf node as at least one test case of the required fragment; when the leaf node is not found, creating a new leaf node for the pre-configured demand tree according to the classification level of the demand fragment, and determining at least one test case for the new leaf node as at least one test case of the demand fragment; and the set generating module is used for generating a test case set for the product to be tested according to at least one test case of each demand fragment.
According to still another aspect of the present invention, there is provided an electronic apparatus including: the test case set generation method comprises a memory, a processor and executable instructions stored in the memory and capable of running in the processor, wherein the processor executes the executable instructions to realize any one of the test case set generation methods based on product requirements.
According to yet another aspect of the present invention, there is provided a computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a processor, implement any one of the above-described methods for generating a test case set based on product requirements.
According to the test case set generation method based on the product requirements, the requirement fragments generated by analyzing the product requirements are sequentially matched with the requirement tree and the leaf nodes of the requirement tree, the test case set of the product to be tested is quickly and accurately generated according to the mapping relation between the requirement fragments and the test cases, the problems of disorder management, difficulty in multiplexing and the like of the test cases are effectively solved, the multiplexing efficiency is improved on the premise that the coverage of the test cases is guaranteed, the subsequent product test efficiency and quality are further improved, and the labor cost is saved.
In addition, according to some embodiments, the method for generating the test case suite based on the product requirement provided by the invention can be used for creating a requirement tree matched with the requirement fragments according to each classification level of the requirement fragments under the condition that the current requirement fragments cannot be matched with the requirement tree, so as to ensure the smooth generation of the test case suite.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
FIG. 1 is a flow diagram illustrating a method for test case set generation based on product requirements, according to an example embodiment.
FIG. 2 is a flow diagram illustrating another method for test case set generation based on product requirements, according to an example embodiment.
FIG. 3 is a block diagram illustrating an apparatus for generating test case suites based on product requirements, according to an example embodiment.
Fig. 4 is a schematic structural diagram of an electronic device according to an exemplary embodiment.
FIG. 5 is a schematic diagram illustrating a computer-readable storage medium according to an example embodiment.
FIG. 6 is a diagram illustrating a structure of a preconfigured requirements tree, according to an exemplary embodiment.
FIG. 7 is a block diagram illustrating a structure of an existing preconfigured demand tree, according to an example embodiment.
FIG. 8 is a block diagram illustrating an updated structure of an existing preconfigured demand tree, according to an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The drawings are merely schematic illustrations of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, apparatus, steps, and so forth. In other instances, well-known structures, methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the invention.
Further, in the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise. The symbol "/" generally indicates that the former and latter associated objects are in an "or" relationship. The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
As described above, before an internet product is on-line, an original test case needs to be obtained, and after the original test case is adaptively adjusted according to a continuously updated product demand, a product test is executed. A Test Case (Test Case) is a set of Test inputs, execution conditions, and expected results tailored for a particular purpose for testing a certain program path or verifying that it meets a certain requirement. The whole process of reusing the test cases accelerates the development trend of product online, the repeated work is more and more, the preparation time of the test cases is seriously delayed, and meanwhile, the quality of the test cases is difficult to ensure.
Therefore, the invention provides a test case set generation method based on product requirements, which can quickly and accurately generate the test case set of a product to be tested according to the mapping relation between the requirement fragments generated by analyzing the product requirements and the test cases, effectively solve the problems of disordered management, difficult multiplexing and the like of the test cases, obviously shorten the preparation time of the test cases, and improve the multiplexing efficiency on the premise of ensuring the coverage and precision of the test cases. Preferably, the method for generating the test case set based on the product requirement according to some embodiments of the present invention can further create a requirement tree matched with the requirement fragments according to each classification level of the requirement fragments under the condition that the requirement fragments cannot be matched with the requirement tree, so as to ensure smooth generation of the test case set.
FIG. 1 is a flow diagram illustrating a method for test case set generation based on product requirements, according to an example embodiment. The test case set generation method based on product requirements as shown in fig. 1 can be applied to a test preparation phase of online insurance products, for example.
Referring to fig. 1, a test case set generation method 10 based on product requirements includes:
in step S102, a requirement file of the product to be tested is obtained.
The embodiments of the present invention are described with respect to internet insurance products to be tested and brought online. The product requirement file may include a product specification or a product requirement document, and the invention is not limited to the specific form and format of the requirement file.
In step S104, the demand of the product to be tested in the demand file is analyzed, and a plurality of demand fragments are generated.
The demand for the products to be tested is typically multi-level nested. And decomposing the product requirement step by step until a requirement fragment which cannot be further decomposed is generated, and forming a requirement fragment set corresponding to the product requirement. Corresponding to product demand multi-level nesting, a demand fragment is subject to multiple classification levels. Each demand fragment corresponds to a unique number, and all demand fragments in the demand fragment set can be classified according to content attributes.
For example, a product demand numbered "T20190622001" is progressively decomposed, and two demand fragments are finally generated: "insured life is child-child relationship with applicant" and "insured life is limited to 30 days full of birth (not including 30 days) to 17 years of age (inclusive)", and the main information of demand shards is shown in table 1 below:
TABLE 1
Figure BDA0002253283670000061
In some embodiments, analyzing the demand for the product to be tested in the demand document may include: and analyzing the requirements of the product to be tested in the requirement file according to a preset template.
The preset template may be, for example, as shown in table 1 above, based on the template, the internet insurance product requirements may be decomposed step by step according to a first-level classification, a second-level classification, a third-level classification, a fourth-level classification, and the like, so as to generate requirement fragments that cannot be further decomposed, and at the same time, the content of the requirement fragments may be acquired, and a unique number may be assigned to the requirement fragments. The template can be set by self-definition according to the complexity of the actual product requirement, and the invention is not limited by the specific format of the template.
It should be noted that the requirement file also conforms to a certain format requirement to be adapted to the preset template, otherwise, the requirement file cannot be automatically parsed according to the preset template.
In step S106, for each demand patch, it is determined whether there is a matching preconfigured demand tree.
The essential information contained in the demand documents of different insurance products is substantially the same in fact, especially for insurance products belonging to the same risk category. Meanwhile, the functional modules involved in the insurance product are also basically the same. The functional modules of the product correspond to the first-level classification to which the demand fragments belong, and mainly comprise the underwriting rules and the insurance information verification, the premium and the premium, the finance, the correction, the claim settlement, the reinsurance, the renewal and the like in the table 1. The preconfigured requirement tree shown in fig. 6 is built according to the characteristic that different insurance products have the same function module, each function module corresponds to one requirement tree, and the requirement tree is consistent with the name of the corresponding function module, so that the name of the requirement tree (root node name) is also consistent with the first class to which the requirement fragments belong.
In some embodiments, determining whether there is a matching preconfigured demand tree may include: and determining whether a pre-configured demand tree is matched with the demand fragments according to the classification level of the demand fragments.
Taking table 1 as an example, refer to fig. 7: as mentioned above, since the name of the demand tree is the first-level classification to which the demand fragment belongs, the matched preconfigured demand tree can be found in the existing demand tree group according to the first-level classification "underwriting rule" to which the demand fragment "00011" belongs, and the name of the root node is also the "underwriting rule". Similarly, the requirement shard "00012" may also be matched to a preconfigured requirement tree as shown in FIG. 7.
In step S108, when it is determined that there is a preconfigured demand tree matching the demand shard, leaf nodes matching the demand shard are searched step by step in the preconfigured demand tree. Wherein:
when the leaf node is found, at least one test case corresponding to the leaf node is obtained as at least one test case of the required fragment (step S1082).
As mentioned above, since the requirement fragments "00011" and "00012" are already matched to the preconfigured requirement tree, the matched child nodes of each level can be searched in the preconfigured requirement tree step by step. Referring again to fig. 6, the child nodes are subordinate to the root node (primary node), and can be divided into two types (secondary and upper nodes) of branch nodes and leaf nodes. The sub-nodes may store tag information such as: node number, node level, corresponding relation between the node and the upper node, etc.
The main information of the nodes is shown in table 2 below, in which the node number is used as a primary key and is a unique identification code of each node:
TABLE 2
Figure BDA0002253283670000081
With continued reference to fig. 7, the requirement shard "00012" may progressively find the branch nodes "insured" (001002), the branch node "age" (001002001), and the leaf nodes "full X days of birth (no X days) to Y years of age (included)" (001002001002) in the preconfigured requirement tree and obtain test cases corresponding to the leaf nodes "full X days of birth (no X days) to Y years of age (included)", for example, from a preconfigured test case repository. The mapping relationship between the leaf node and the test case may be one-to-one, or one-to-many, and the present invention is not limited thereto.
In some embodiments, to enhance data versatility, the values in the leaf nodes are parameterized data, such as the leaf nodes "X-Y Weeks (inclusive)" and "X days of birth full (exclusive) to Y Weeks (inclusive)". For parameterized leaf nodes, the test cases mapped with the parameterized leaf nodes are also parameterized, that is, the numerical values in the test cases are also parameterized data.
Correspondingly, after obtaining at least one test case corresponding to a leaf node, step S1082 may further include: and assigning the parameterized data in at least one test case according to the content of the demand fragments. For example, according to the contents of the demand shard numbered "00012" insured age: the test cases corresponding to the leaf nodes "full of life X day (no X day) to Y year (inclusive)" were assigned an X value of 30 and an Y value of 17.
As described above, when the leaf node is not found, a new leaf node is created for the pre-configured demand tree according to the classification level to which the demand fragment belongs, and at least one test case is determined for the new leaf node as at least one test case of the demand fragment (step S1084).
For example, assuming that the requirement shard "00011" is a new requirement generated along with the insurance product iteration process, only the existing branch node "insured-to-applicant relationship" can be found in the preconfigured requirement tree (001003), but no leaf node "child" can be found that should match. At this time, a new leaf node "child" needs to be created at the next level of the relationship between the insured life and the applicant "branch node" with node number "001003", and the marker node number "001003004". The updated demand tree is shown in FIG. 8.
According to the actual situation of the existing test cases of the product, after creating a new leaf node for the pre-configured demand tree, determining at least one test case for the new leaf node comprises: (1) directly acquiring at least one existing test case from a pre-configured test case library for example; (2) at least one new test case is generated for the new leaf node.
In some embodiments, creating a new leaf node for the preconfigured demand tree may include: and marking whether the new leaf node can automatically generate the test case. Correspondingly, determining at least one test case for the new leaf node may include: and when the new leaf node mark can automatically generate the test case, automatically generating at least one test case for the new leaf node. In other embodiments, to ensure coverage and accuracy of test cases, the process of generating test cases for new leaf nodes requires manual involvement.
In some embodiments, in addition to general information of the test cases (e.g., test case name, operation steps, test data, expected results, actual results, pass or fail, BUG number, executor, etc.), each test case may contain case marking information. The use case tagging information may include: the leaf node number corresponding to the test case, the test case number, whether the test case can perform the automatic test, and the corresponding automatic test script number are shown in the following table 3, for example, where the test case number corresponds to the leaf node number:
TABLE 3
Leaf node numbering Test case numbering Whether to perform automated testing Automated test script numbering
001003004 001003004001 Can be used for 0001
001003004 001003004002 Can be used for 0001
001002001002 001002001002001 Whether or not ——
001002001002 001002001002002 Whether or not ——
In step S110, a test case set is generated for the product to be tested according to at least one test case of each required fragment.
In the above, until all the demand fragments of the product demand "T20190622001" have completed the test case matching, a test case set of the product to be tested is generated. One test case set can be a complete test case set of a certain product, or can be a test case set of one or more functional modules in a certain product, for example, a test case set of multiple sets of medical insurance product underwriting rules combined according to different sales channels.
Naming, storing and marking each test case set of the product to be tested, wherein the marking information comprises the following steps: product name, demand number, etc. for subsequent product regression testing. To this end, summarizing tables 1-3 above, some of the correspondences between product requirements "T20190622001" and test case numbers are shown in table 4 below, for example:
TABLE 4
Demand numbering Demand fragment numbering Test case numbering
T20190622001 00011 001003004001
T20190622001 00011 001003004002
T20190622001 00012 001002001002001
T20190622001 00012 001002001002002
According to the test case set generation method based on the product requirements, provided by the embodiment of the invention, the requirement fragments generated by analyzing the product requirements are sequentially matched with the requirement tree and the leaf nodes thereof, and the test case set of the product to be tested is quickly and accurately generated according to the mapping relation between the requirement fragments and the test cases, so that the problems of disorder management, difficult multiplexing and the like of the test cases are effectively solved, the multiplexing efficiency is improved on the premise of ensuring the coverage of the test cases, the subsequent product test efficiency and quality are further improved, and the labor cost is saved.
It should be clearly understood that the present disclosure describes how to make and use particular examples, but the principles of the present disclosure are not limited to any details of these examples. Rather, these principles can be applied to many other embodiments based on the teachings of the present disclosure.
FIG. 2 is a flow diagram illustrating another method for test case set generation based on product requirements, according to an example embodiment. The difference from the method 10 of FIG. 1 is that the method 20 of FIG. 2 further provides a method of creating a demand tree when a pre-configured demand tree matching a demand shard does not exist, an embodiment of the method 10 described above. Similarly, the test case set generation method based on product requirements as shown in fig. 2 can also be applied to the test preparation phase of online insurance products, for example.
As described above, new product requirements are continually emerging as the products to be tested are iteratively updated and expanded. Thus, for a demand fragment generated by breaking up a new demand, there may not be a leaf node or even a pre-configured demand tree matching it.
When it is determined that there is no pre-configured requirement tree matching the requirement shard, referring to fig. 2, the method 10 for generating a test case set based on product requirements further includes:
in step S202, a demand tree matching the demand pieces is built according to the classification levels of the demand pieces.
As described above, the root node name of the demand tree should be consistent with the first class classification to which the demand fragments belong, so that the demand tree matched with the demand fragments can be established according to the first class classification to which the demand fragments belong, and the first class classification is determined as the root node name of the demand tree.
In step S204, nodes at each level of the demand tree are sequentially established in the demand tree according to the classification level of the demand pieces.
As described above, the node level of the demand tree corresponds to the classification level to which the demand fragment belongs, and the node names of each level of the demand tree correspond to the two or more classifications to which the demand fragment belongs. Therefore, according to the second-level … -level classification and the third-level classification to which the demand fragments belong, sub-nodes at all levels are sequentially established in the newly established demand tree, and the sub-node matched with the maximum-level classification to which the demand fragments belong is determined as the leaf node in the newly established demand tree.
It should be noted that, after the leaf nodes are established in the newly-created demand tree, at least one test case is determined (directly obtained or generated) for the leaf nodes, and the method for determining (directly obtaining or generating) at least one test case as the demand fragment is the same as that in step S1084 in the method 10, and specific details may refer to the method 10 described above, which is not described herein again.
According to some embodiments, the method for generating the test case suite based on the product requirement provided by the embodiment of the invention can be used for building a requirement tree matched with the requirement fragments according to each classification level of the requirement fragments under the condition that the current requirement fragments cannot be matched with the requirement tree, so as to ensure the smooth generation of the test case suite.
In summary, the method for generating a test case set based on product requirements according to the embodiments of the present invention not only can analyze the product requirements as a starting point, and sequentially match the requirement fragments with the preconfigured requirement tree and leaf nodes to obtain the mapped test cases to form a set, but also can sequentially establish the requirement tree and each level of child nodes on the requirement tree by targeted configuration or free configuration facing the product requirement update, with the requirement tree management as a starting point, so as to implement cross-level combination and management of the requirement tree and flexible configuration of the test cases, and prepare for regression testing of subsequent complete products or product function modules.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. The computer program, when executed by the CPU, performs the functions defined by the method provided by the present invention. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the method according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the embodiments of the method of the present invention.
FIG. 3 is a block diagram illustrating an apparatus for generating test case suites based on product requirements, according to an example embodiment.
Referring to fig. 3, the test case set generation apparatus 30 based on product requirements includes: a file acquisition module 302, a requirement analysis module 304, a fragment matching module 306, a use case matching module 308, and a collection generation module 312.
The file obtaining module 302 is configured to obtain a requirement file of a product to be tested.
The requirement analysis module 304 is configured to analyze requirements of the products to be tested in the requirement file to generate a plurality of requirement fragments.
In some embodiments, the requirement resolution module 304 may further include: and the demand analysis unit is used for analyzing the demand of the product to be tested in the demand file according to a preset template.
The patch matching module 306 is used to determine, for each demand patch, whether there is a matching preconfigured demand tree.
In some embodiments, the fragment matching module 306 may further comprise: and the fragment matching unit is used for determining whether a pre-configured requirement tree is matched with the requirement fragments or not according to the classification level of the requirement fragments.
The use case matching module 308 is configured to, when it is determined that there is a preconfigured requirement tree matching the requirement fragments, gradually search leaf nodes matching the requirement fragments in the preconfigured requirement tree.
The use case matching module 308 further comprises: a first matching unit and a second matching unit.
The first matching unit is used for acquiring at least one test case corresponding to the leaf node as at least one test case of the required fragment when the leaf node is found.
In some embodiments, the leaf nodes and the values in the test cases may be parameterized data, and the case matching module 308 may further include: and the parameter assignment unit is used for assigning the parameterized data in at least one test case according to the content of the demand fragments.
And the second matching unit is used for creating a new leaf node for the pre-configured demand tree according to the classification level of the demand fragment when the leaf node is not found, and determining at least one test case for the new leaf node as the at least one test case of the demand fragment.
In some embodiments, the second matching unit may further include: a node marking subunit and a use case generating subunit. The node marking subunit is used for marking whether the new leaf node can automatically generate a test case or not; the case generation subunit is used for automatically generating at least one test case for the new leaf node when the new leaf node mark can automatically generate the test case.
The set generating module 312 is configured to generate a test case set for the product to be tested according to at least one test case of each required fragment.
In some embodiments, the test case set generating apparatus 30 based on product requirements may further include: a match creation module 310. The match establishing module 310 further comprises: a first establishing unit and a second establishing unit.
The first establishing unit is used for establishing a demand tree matched with the demand fragments according to the classification levels of the demand fragments.
The second establishing unit is used for sequentially establishing nodes of each level of the demand tree in the demand tree according to the classification level of the demand fragments.
In some embodiments, each test case may contain case tagging information, and the case tagging information may further include, but is not limited to: the leaf node number corresponding to the test case, the test case number, whether the test case can carry out automatic test and the corresponding automatic test script number.
According to the test case set generating device based on the product requirements, provided by the embodiment of the invention, the requirement fragments generated by analyzing the product requirements are sequentially matched with the requirement tree and the leaf nodes thereof, and the test case set of the product to be tested is quickly and accurately generated according to the mapping relation between the requirement fragments and the test cases, so that the problems of disorder management, difficult multiplexing and the like of the test cases are effectively solved, the multiplexing efficiency is improved on the premise of ensuring the coverage of the test cases, the subsequent product testing efficiency and quality are further improved, and the labor cost is saved.
In addition, according to some embodiments, the test case set generating device based on product requirements provided by the embodiments of the present invention can create a requirement tree matched with a requirement fragment according to each classification level of the requirement fragment under the condition that the current requirement fragment cannot be matched with the requirement tree, so as to ensure smooth generation of the test case set.
In summary, the test case set generating device based on product requirements provided by the embodiments of the present invention not only can analyze the product requirements as a starting point, sequentially match the requirement fragments with the preconfigured requirement tree and leaf nodes to obtain the mapped test cases to form a set, but also can sequentially establish the requirement tree and each level of child nodes on the requirement tree by targeted configuration or free configuration facing the product requirements update, using the requirement tree management as a starting point, thereby implementing cross-level combination and management of the requirement tree and flexible configuration of the test cases, so as to prepare for regression testing of subsequent complete products or product function modules.
It is noted that the block diagrams shown in the above figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
Fig. 4 is a schematic structural diagram of an electronic device according to an exemplary embodiment. It should be noted that the electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 4, the electronic device 700 is embodied in the form of a general-purpose computer device. The components of the electronic device 700 include: at least one Central Processing Unit (CPU)701, which may perform various appropriate actions and processes according to program code stored in a Read Only Memory (ROM)702 or loaded from at least one storage unit 708 into a Random Access Memory (RAM) 703.
In particular, according to an embodiment of the present invention, the program code may be executed by the central processing unit 701, such that the central processing unit 701 performs the steps according to various exemplary embodiments of the present invention described in the above-mentioned method embodiment section of the present specification. For example, the central processing unit 701 may perform the steps as shown in fig. 1, 2.
In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The CPU 701, the ROM702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input unit 706 including a keyboard, a mouse, and the like; an output unit 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage unit 708 including a hard disk and the like; and a communication unit 709 including a network interface card such as a LAN card, a modem, or the like. The communication unit 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, a semiconductor memory, or the like, is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage unit 708 as necessary.
FIG. 5 is a schematic diagram illustrating a computer-readable storage medium according to an example embodiment.
Referring to fig. 5, a program product 800 configured to implement the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable medium carries one or more programs which, when executed by the apparatus, cause the computer readable medium to implement the functions as shown in fig. 1 and 2.
Exemplary embodiments of the present invention are specifically illustrated and described above. It is to be understood that the invention is not limited to the precise construction, arrangements, or instrumentalities described herein; on the contrary, the invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. A test case set generation method based on product requirements is characterized by comprising the following steps:
acquiring a demand file of a product to be tested;
analyzing the requirements of the products to be tested in the requirement file to generate a plurality of requirement fragments;
determining, for each of the demand pieces, whether a matching preconfigured demand tree exists;
when the fact that a pre-configuration demand tree matched with the demand fragments exists is determined, leaf nodes matched with the demand fragments are searched step by step in the pre-configuration demand tree; when the leaf node is found, acquiring at least one test case corresponding to the leaf node as at least one test case of the required fragment; when the leaf node is not found, creating a new leaf node for the pre-configured demand tree according to the classification level of the demand fragment, and determining at least one test case for the new leaf node as at least one test case of the demand fragment; and
and generating a test case set for the product to be tested according to at least one test case of each demand fragment.
2. The method of claim 1, wherein determining whether there is a matching preconfigured demand tree comprises: determining whether a preconfigured demand tree exists that matches the demand shard based on the classification level of the demand shard.
3. The method of claim 1, wherein when it is determined that there is no preconfigured demand tree matching the demand shard, the method further comprises:
establishing a demand tree matched with the demand fragments according to the classification levels of the demand fragments; and
and sequentially establishing nodes at all levels of the demand tree in the demand tree according to the classification level of the demand fragment.
4. The method of claim 1, wherein analyzing the demand for the product under test in the demand file comprises: and analyzing the requirements of the products to be tested in the requirement file according to a preset template.
5. The method of claim 1, wherein creating a new leaf node for the preconfigured demand tree comprises: whether the new leaf node can automatically generate a test case is marked;
determining at least one test case for the new leaf node comprises: and when the new leaf node mark can automatically generate the test case, automatically generating at least one test case for the new leaf node.
6. The method according to claim 1, wherein each of the test cases contains use case tagging information, and the use case tagging information includes: the leaf node number corresponding to the test case, the number of the test case, whether the test case can carry out automatic test or not and the number of the corresponding automatic test script.
7. The method of any of claims 1-6, wherein the leaf nodes and values in the test cases are parameterized data;
after obtaining at least one test case corresponding to the leaf node, the method further includes: and assigning the parameterized data in the at least one test case according to the content of the demand fragments.
8. A test case set generation device based on product requirements is characterized by comprising:
the file acquisition module is used for acquiring a demand file of a product to be tested;
the demand analysis module is used for analyzing the demands of the products to be tested in the demand file to generate a plurality of demand fragments;
a fragment matching module for determining, for each of the demand fragments, whether a matching preconfigured demand tree exists;
the use case matching module is used for searching leaf nodes matched with the demand fragments step by step in the pre-configuration demand tree when the pre-configuration demand tree matched with the demand fragments is determined to exist; when the leaf node is found, acquiring at least one test case corresponding to the leaf node as at least one test case of the required fragment; when the leaf node is not found, creating a new leaf node for the pre-configured demand tree according to the classification level of the demand fragment, and determining at least one test case for the new leaf node as at least one test case of the demand fragment; and
and the set generating module is used for generating a test case set for the product to be tested according to at least one test case of each required fragment.
9. An electronic device, comprising: memory, processor and executable instructions stored in the memory and executable in the processor, characterized in that the processor implements the method according to any of claims 1-7 when executing the executable instructions.
10. A computer-readable storage medium having stored thereon computer-executable instructions, which when executed by a processor, implement the method of any one of claims 1-7.
CN201911042639.5A 2019-10-30 2019-10-30 Test case set generation method and device based on product requirements and electronic equipment Pending CN110806977A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911042639.5A CN110806977A (en) 2019-10-30 2019-10-30 Test case set generation method and device based on product requirements and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911042639.5A CN110806977A (en) 2019-10-30 2019-10-30 Test case set generation method and device based on product requirements and electronic equipment

Publications (1)

Publication Number Publication Date
CN110806977A true CN110806977A (en) 2020-02-18

Family

ID=69489620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911042639.5A Pending CN110806977A (en) 2019-10-30 2019-10-30 Test case set generation method and device based on product requirements and electronic equipment

Country Status (1)

Country Link
CN (1) CN110806977A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111290962A (en) * 2020-02-29 2020-06-16 苏州浪潮智能科技有限公司 Test case management method, system, terminal and storage medium
CN113282498A (en) * 2021-05-31 2021-08-20 平安国际智慧城市科技股份有限公司 Test case generation method, device, equipment and storage medium
WO2023206523A1 (en) * 2022-04-29 2023-11-02 西门子股份公司 Workflow recommendation method and device, and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101689111A (en) * 2007-04-03 2010-03-31 Ldra技术公司 The automatic management of software requirements verification
CN107844417A (en) * 2017-10-20 2018-03-27 东软集团股份有限公司 Method for generating test case and device
CN108038054A (en) * 2017-12-01 2018-05-15 大唐微电子技术有限公司 A kind of automated testing method and device, computer-readable recording medium
CN109408360A (en) * 2018-08-03 2019-03-01 中国人民解放军63928部队 A kind of software reliability estimation method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101689111A (en) * 2007-04-03 2010-03-31 Ldra技术公司 The automatic management of software requirements verification
CN107844417A (en) * 2017-10-20 2018-03-27 东软集团股份有限公司 Method for generating test case and device
CN108038054A (en) * 2017-12-01 2018-05-15 大唐微电子技术有限公司 A kind of automated testing method and device, computer-readable recording medium
CN109408360A (en) * 2018-08-03 2019-03-01 中国人民解放军63928部队 A kind of software reliability estimation method and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
刘新生: "测试需求", 《软件测试理论》 *
蔡娟: "测试管理工具TestCenter", 《软件测试技术》 *
陈平: "面向需求的嵌入式软件测试复用技术的研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111290962A (en) * 2020-02-29 2020-06-16 苏州浪潮智能科技有限公司 Test case management method, system, terminal and storage medium
CN113282498A (en) * 2021-05-31 2021-08-20 平安国际智慧城市科技股份有限公司 Test case generation method, device, equipment and storage medium
CN113282498B (en) * 2021-05-31 2024-04-05 深圳赛安特技术服务有限公司 Method, device, equipment and storage medium for generating test cases
WO2023206523A1 (en) * 2022-04-29 2023-11-02 西门子股份公司 Workflow recommendation method and device, and storage medium

Similar Documents

Publication Publication Date Title
CN108256074B (en) Verification processing method and device, electronic equipment and storage medium
CN110806977A (en) Test case set generation method and device based on product requirements and electronic equipment
CN110737689B (en) Data standard compliance detection method, device, system and storage medium
CN111291024A (en) Data processing method and device, electronic equipment and storage medium
CN111127068B (en) Automatic pricing method and device for engineering quantity list
CN106649557B (en) Semantic association mining method for defect report and mail list
CN112416778A (en) Test case recommendation method and device and electronic equipment
CN113495902A (en) Data processing method and data standard management system
CN103955429B (en) Determine the method and device of regression test scope
CN111598535B (en) Basic material importing method, system and computer equipment
US10360208B2 (en) Method and system of process reconstruction
CN110633084B (en) Transcoding derivation method and device based on single sample
CN111061733B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN113220588A (en) Automatic testing method, device and equipment for data processing and storage medium
CN112668314A (en) Data standard conformance detection method, device, system and storage medium
CN113806647A (en) Method for identifying development framework and related equipment
CN109800147B (en) Test case generation method and terminal equipment
CN115455091A (en) Data generation method and device, electronic equipment and storage medium
CN112925874B (en) Similar code searching method and system based on case marks
CN111143356B (en) Report retrieval method and device
CN113901075A (en) Method and device for generating SQL (structured query language) statement, computer equipment and storage medium
Nguyen et al. Using topic model to suggest fine-grained source code changes
CN113254612A (en) Knowledge question-answering processing method, device, equipment and storage medium
CN103761247B (en) A kind of processing method and processing device of error file
CN112632247A (en) Method and device for detecting man-hour report, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200218

RJ01 Rejection of invention patent application after publication