CN113342692B - Automatic test case generation method and device, electronic equipment and storage medium - Google Patents

Automatic test case generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113342692B
CN113342692B CN202110756055.5A CN202110756055A CN113342692B CN 113342692 B CN113342692 B CN 113342692B CN 202110756055 A CN202110756055 A CN 202110756055A CN 113342692 B CN113342692 B CN 113342692B
Authority
CN
China
Prior art keywords
test
demand
analysis
requirement
steps
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.)
Active
Application number
CN202110756055.5A
Other languages
Chinese (zh)
Other versions
CN113342692A (en
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.)
Winning Health Technology Group Co Ltd
Original Assignee
Winning Health Technology Group 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 Winning Health Technology Group Co Ltd filed Critical Winning Health Technology Group Co Ltd
Priority to CN202110756055.5A priority Critical patent/CN113342692B/en
Publication of CN113342692A publication Critical patent/CN113342692A/en
Application granted granted Critical
Publication of CN113342692B publication Critical patent/CN113342692B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • 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/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a method and a device for automatically generating test cases, electronic equipment and a storage medium, and relates to the technical field of testing. The method comprises the following steps: determining a target demand analysis type of an input test demand, determining an analysis template corresponding to the target analysis type of the test demand as a demand analysis template, acquiring demand analysis content input aiming at the target analysis template, wherein the demand analysis content comprises a plurality of demand details, determining an application case generation rule table corresponding to the demand analysis template as a test case generation rule table, generating a test case table corresponding to the test demand according to the demand analysis content and the test case generation rule table, wherein the test case table comprises a plurality of test steps and test expected results corresponding to the test steps, and each test step is a test step corresponding to one demand detail. The application can improve the quality and writing efficiency of the test case.

Description

Automatic test case generation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of testing technologies, and in particular, to a method and apparatus for automatically generating test cases, an electronic device, and a storage medium.
Background
With the rapid development of automation technology, the development and application of software programs have been greatly developed.
The existing test of the product business function usually adopts two test modes of manual test and automatic test, in the manual test and the automatic test, a test designer performs demand analysis, decomposes the demand analysis to manually write test cases, and then manually or automatically executes the test cases.
In the above process, the writing of the test cases is generally performed manually by the test designer, the quality of the test cases mainly depends on the level of the test designer, and the efficiency of manual writing is low.
Disclosure of Invention
The invention aims to provide an automatic test case generating method, device, electronic equipment and storage medium for overcoming the defects in the prior art so as to improve the quality and writing efficiency of test cases.
In order to achieve the above purpose, the technical scheme adopted by the embodiment of the application is as follows:
in a first aspect, an embodiment of the present application provides a method for automatically generating a test case, including:
Determining a target demand analysis type of the input test demand;
Determining an analysis template corresponding to the target demand analysis type of the test demand as a demand analysis template;
Acquiring demand analysis content input for the demand analysis template; the demand analysis content includes: a plurality of demand details;
Determining an application case generation rule table corresponding to the requirement analysis template to generate a rule table for a test case, wherein the test case generation rule table comprises: rules of a plurality of test steps and test expected result rules corresponding to each test step;
Generating a test case table corresponding to the test requirement according to the requirement analysis template, the requirement analysis content and the test case generation rule table, wherein the test case table comprises a plurality of test steps and test expected results corresponding to the test steps, and each test step is a test step corresponding to a requirement detail.
Optionally, the determining the target requirement analysis type of the input test requirement includes:
Displaying a plurality of requirement analysis types on a requirement analysis maintenance interface;
And responding to the selection operation input for the plurality of requirement analysis types, and determining the requirement analysis type corresponding to the selection operation as the target requirement analysis type.
Optionally, the obtaining the requirement analysis content input for the requirement analysis template includes:
displaying the requirement analysis template, wherein the requirement analysis template is displayed with: a plurality of demand details;
And responding to the parameter input operation aiming at each demand detail item, and determining the parameters input by the parameter input operation as the demand detail corresponding to each demand detail item.
Optionally, after the obtaining the requirement analysis content input for the requirement analysis template, the method further includes:
Displaying a demand analysis master table, wherein the demand analysis master table is displayed with: identification of the target demand analysis type and information of the test demand;
In response to a viewing operation of the demand analysis master table, displaying a demand analysis list comprising: the identification of the plurality of demand details, the plurality of demand details and the demand detail items corresponding to the demand details in the demand analysis template.
Optionally, the determining the rule table for generating the application case corresponding to the requirement analysis template includes:
And determining an application case generation rule table corresponding to the identification information from a database according to the identification information of the requirement analysis template to generate a rule table for the test application case.
Optionally, the generating a rule table according to the requirement analysis template, the requirement analysis content and the test case, and generating a test case table includes:
Generating test steps corresponding to the demand details items and test expected results corresponding to the test steps according to the identifications of the demand details items in the demand analysis template, the demand details corresponding to the demand details items in the demand analysis content, the rules of the plurality of test steps and the test expected result rules corresponding to the test steps;
and generating a test case table according to the test steps corresponding to the requirement detail items and the test expected results corresponding to the test steps.
Optionally, the method further comprises:
displaying the test case table;
Receiving input configuration parameters for each test step;
and generating a test script according to the test case table and the configuration parameters.
In a second aspect, an embodiment of the present application further provides an apparatus for automatically generating test cases, including:
the analysis type determining module is used for determining a target demand analysis type of the input test demand;
The analysis template determining module is used for determining an analysis template corresponding to the target requirement analysis type of the test requirement as a requirement analysis template;
The analysis content acquisition module is used for acquiring the requirement analysis content input by aiming at the requirement analysis template; the demand analysis content includes: a plurality of demand details;
the generating rule determining module is configured to determine that an application case generating rule table corresponding to the requirement analysis template is a test case generating rule table, where the test case generating rule table includes: rules of a plurality of test steps and test expected result rules corresponding to each test step;
the test case table generation module is used for generating a test case table corresponding to the test requirement according to the requirement analysis template, the requirement analysis content and the test case generation rule table, wherein the test case table comprises a plurality of test steps and test expected results corresponding to the test steps, and each test step is a test step corresponding to a requirement detail.
Optionally, the analysis type determining module includes:
An analysis type display unit for displaying a plurality of requirement analysis types on a requirement analysis maintenance interface;
And the analysis type selection unit is used for responding to the selection operation input for the plurality of requirement analysis types and determining the requirement analysis type corresponding to the selection operation as the target requirement analysis type.
Optionally, the analysis content acquisition module includes:
The analysis template display unit is used for displaying the requirement analysis template, and the requirement analysis template is displayed with the following components: a plurality of demand details;
The demand detail input unit is used for responding to the parameter input operation aiming at each demand detail item and determining the parameter input by the parameter input operation as the demand detail corresponding to each demand detail item.
Optionally, after the analyzing content obtaining module, the apparatus further includes:
the analysis main table display unit is used for displaying a demand analysis main table, and the demand analysis main table is displayed with the following components: identification of the target demand analysis type and information of the test demand;
An analysis list display unit configured to display a demand analysis list in response to a viewing operation for the demand analysis master list, the demand analysis list including: the identification of the plurality of demand details, the plurality of demand details and the demand detail items corresponding to the demand details in the demand analysis template.
Optionally, the generating rule determining module is specifically configured to determine, from a database, an application generating rule table corresponding to the identification information according to the identification information of the requirement analysis template, and generate the rule table for the test application.
Optionally, the test case table generating module includes:
A test step generating unit, configured to generate a test step corresponding to each requirement detail item and a test expected result corresponding to each test step according to the identifier of each requirement detail item in the requirement analysis template, the requirement detail corresponding to each requirement detail item in the requirement analysis content, the rules of the plurality of test steps, and the test expected result rule corresponding to each test step;
and the test case table generating unit is used for generating a test case table according to the test steps corresponding to the requirement detail items and the test expected results corresponding to the test steps.
Optionally, the apparatus further includes:
the test case table display module is used for displaying the test case table;
The configuration parameter input module is used for receiving input configuration parameters for each test step;
And the test script generating unit is used for generating a test script according to the test case table and the configuration parameters.
In a third aspect, an embodiment of the present application further provides an electronic device, including: the system comprises a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, when the electronic device runs, the processor and the storage medium are communicated through the bus, and the processor executes the program instructions to execute the steps of the automatic test case generating method according to any one of the embodiments.
In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program is executed by a processor to perform the steps of the test case automatic generation method according to any one of the foregoing embodiments.
The beneficial effects of the application are as follows:
The application provides a test case automatic generation method, a device, electronic equipment and a storage medium, wherein an analysis template corresponding to the target analysis type of an input test requirement is determined to be a requirement analysis template by determining the target requirement analysis type of the input test requirement, the requirement analysis content input by aiming at the target analysis template is obtained, the requirement analysis content comprises a plurality of requirement details, a case generation rule table corresponding to the requirement analysis template is determined to be a test case generation rule table, a test case table corresponding to the test requirement is generated according to the requirement analysis content and the test case generation rule table, the test case table comprises a plurality of test steps and test expected results corresponding to the test steps, and each test step is a test step corresponding to one requirement detail. According to the scheme provided by the application, the requirement analysis template and the test case generation rule table can be determined according to the requirement analysis type of the test requirement, the requirement analysis content is determined by filling the requirement analysis template, and the test case table is generated according to the requirement analysis content and the test case generation rule table, so that the requirement analysis content can be directly and normally filled according to the requirement analysis template, the test case table can be automatically generated based on the test case generation rule table, the requirement analysis content and the test case table can be normalized and automatically generated, the level of a test designer is not relied, and the generation quality and efficiency of the test case table are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a first test case automatic generation method according to an embodiment of the present application;
FIG. 2 is a flowchart of a second test case automatic generation method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a third test case automatic generation method according to an embodiment of the present application;
FIG. 4 is a schematic diagram showing a demand analysis template according to an embodiment of the present application;
FIG. 5 is a flowchart of a fourth test case automatic generation method according to an embodiment of the present application;
FIG. 6 is a flowchart of a fifth method for automatically generating test cases according to an embodiment of the present application;
FIG. 7 is a flowchart of a sixth method for automatically generating test cases according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of an automatic test case generating device according to an embodiment of the present application;
fig. 9 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention.
Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the description of the present application, it should be noted that, if the terms "upper", "lower", and the like indicate an azimuth or a positional relationship based on the azimuth or the positional relationship shown in the drawings, or an azimuth or the positional relationship conventionally put in use of the product of the application, it is merely for convenience of describing the present application and simplifying the description, and it is not indicated or implied that the apparatus or element referred to must have a specific azimuth, be configured and operated in a specific azimuth, and thus should not be construed as limiting the present application.
Furthermore, the terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the features of the embodiments of the present application may be combined with each other without conflict.
The automatic test case generating method provided by the embodiment of the application is applied to the electronic equipment with the automatic test case generating function, the automatic test case generating software runs on the electronic equipment, and the automatic test case generating software executes the automatic test case generating method based on the operation of a test designer so as to automatically generate the test case table. The electronic device includes, but is not limited to, a desktop computer, a notebook computer.
FIG. 1 is a flowchart of a first test case automatic generation method according to an embodiment of the present application; as shown in fig. 1, the method includes:
s10: a target demand analysis type of the entered test demand is determined.
Specifically, a test designer determines a target requirement analysis type of the test requirement according to the test requirement of the software function to be tested, and the target requirement analysis type of the test requirement is input into the test case automatic generation software, wherein the target requirement analysis type is judged by the test designer. The target demand analysis types are identification information indicating the types of the software functions to be tested, and each target demand analysis type corresponds to one type of the software functions to be tested. For example, the target requirement analysis type is 1, and the newly added personalized configuration of the corresponding type of the software function to be tested represents the personalized configuration function added in the software to be tested, and the personalized configuration is that a pointer can select and configure a certain function by itself.
S20: and determining an analysis template corresponding to the target requirement analysis type of the test requirement as a requirement analysis template.
Specifically, the memory of the electronic device where the test case automatic generation software is located includes a requirement analysis template library, and the requirement analysis template library includes a plurality of requirement analysis types and corresponding analysis templates. And selecting an analysis template corresponding to the target demand analysis type from the demand analysis template library as a demand analysis template according to the target demand analysis type of the test demand. The requirement analysis template is an empty template for filling test requirements for a test designer, the requirement analysis template comprises a plurality of pieces of description information for filling contents of the test designer, and the analysis template can be designed according to the requirement analysis type and stored in a memory of the electronic equipment.
For example, table 1 is a requirement analysis template provided in an embodiment of the present application.
Table 1 demand analysis template
S30: and obtaining the demand analysis content input by aiming at the demand analysis template.
Specifically, the test designer fills in a plurality of contents to be filled in by the test designer in the requirement analysis template to obtain requirement analysis contents, wherein the requirement analysis contents comprise: and the demand analysis content values are content values filled in the demand analysis templates by test designers.
S40: and determining an application case generation rule table corresponding to the requirement analysis template to generate a rule table for the test case.
Specifically, the memory of the electronic device where the test case automatic generation software is located includes a case generation rule table library, and the case generation rule table library includes a plurality of case generation rule tables, and the correspondence between the case generation rule tables and the requirement analysis template. After the requirement analysis template is determined according to the target requirement analysis type in S20, determining the corresponding relation between the case generation rule table and the requirement analysis template from the case generation rule table library, and then determining the case generation rule table corresponding to the requirement analysis template as the test case generation rule table. The test case generation rule table prescribes rules of a plurality of test steps in the test process and expected result rules corresponding to the rules of each test step.
In an alternative implementation manner, according to the identification information of the requirement analysis template, determining an application case generation rule table corresponding to the identification information from the database to generate the rule table for the test case.
For example, table 2 is a rule table generated by a test case provided in an embodiment of the present application.
Table 2 test case generation rule table
S50: and generating a rule table according to the requirement analysis template, the requirement analysis content and the test case, and generating a test case table corresponding to the test requirement.
Specifically, a rule of a plurality of test steps in a rule table is generated according to a demand analysis template, test analysis content and test cases, a plurality of test steps are generated, an expected result corresponding to each test step is generated according to the demand analysis content and an expected result rule corresponding to each test step rule, and a test case table is generated based on the plurality of test steps and the expected result corresponding to each test step. The test case table comprises a plurality of test steps and test expected results corresponding to the test steps, and each test step is a test step corresponding to a requirement detail.
The embodiment of the application provides an automatic test case generation method, which comprises the steps of determining an analysis template corresponding to a target analysis type of an input test requirement as a requirement analysis template by determining the target requirement analysis type of the input test requirement, acquiring requirement analysis content input aiming at the target analysis template, wherein the requirement analysis content comprises a plurality of requirement details, determining an application case generation rule table corresponding to the requirement analysis template as a test case generation rule table, generating a test case table corresponding to the test requirement according to the requirement analysis content and the test case generation rule table, wherein the test case table comprises a plurality of test steps and test expected results corresponding to the test steps, and each test step is a test step corresponding to the requirement details. According to the method provided by the embodiment of the application, the requirement analysis template and the test case generation rule table can be determined according to the requirement analysis type of the test requirement, the requirement analysis content is determined by filling the requirement analysis template, and the test case table is generated according to the requirement analysis content and the test case generation rule table, so that the requirement analysis content can be directly and normally filled according to the requirement analysis template, the test case table can be automatically generated based on the test case generation rule table, the requirement analysis content and the test case table can be normalized and automatically generated, the level of a test designer is not relied, and the generation quality and efficiency of the test case table are improved.
On the basis of the foregoing embodiment, the embodiment of the present application further provides a test case automatic generation method, and fig. 2 is a schematic flow chart of a second test case automatic generation method provided by the embodiment of the present application, as shown in fig. 2, where the S10 includes:
s11: a plurality of demand analysis types are displayed on a demand analysis maintenance interface.
Specifically, the test case automatic generation software displays a requirement analysis maintenance interface on a display screen of the electronic device, a plurality of requirement analysis types are displayed in the requirement analysis maintenance interface, and the plurality of requirement analysis types can be obtained by classifying according to the type reservation of the software functions to be tested and are configured in the requirement analysis maintenance interface of the test case automatic generation software for selection by test designers.
S12: and responding to the selection operation input aiming at a plurality of requirement analysis types, and determining the requirement analysis type corresponding to the selection operation as a target requirement analysis type.
Specifically, according to the type of the software function to be tested, the test designer performs selection operation according to a plurality of requirement analysis types displayed on the requirement analysis maintenance interface, and the requirement analysis type selected by the selection operation is used as a target requirement analysis type. The selection operation may be a single click or a double click operation, for example.
According to the test case automatic generation method provided by the embodiment of the application, a plurality of requirement analysis types are displayed on a requirement analysis maintenance interface, and a requirement analysis type corresponding to a selection operation is determined as a target requirement analysis type in response to the selection operation input aiming at the plurality of requirement analysis types. The method provided by the embodiment of the application can provide various alternative demand analysis types for test designers, so that the target demand analysis type is determined, and the types of the software functions to be tested are classified and summarized through the demand analysis type, thereby avoiding inaccurate summarization or diversity of summarization types caused by the fact that the test designers self-summarize the target demand analysis type at will, ensuring the unification of the demand analysis types, facilitating the realization of automatic generation of test cases and improving the writing efficiency of the test cases.
On the basis of the foregoing embodiment, the embodiment of the present application further provides a test case automatic generation method, and fig. 3 is a schematic flow chart of a third test case automatic generation method provided by the embodiment of the present application, as shown in fig. 3, where S30 includes:
S31: and displaying the demand analysis template.
Specifically, in S20, after the demand analysis template is obtained from the analysis template library according to the target demand analysis type, the demand analysis template is displayed in the display area of the test case automatic generation software, where the demand analysis template is displayed with: the system comprises a plurality of requirement details, wherein the requirement details are descriptive information for filling contents of a required test designer.
In an alternative embodiment, the demand analysis templates are displayed in a demand analysis maintenance interface. For example, fig. 4 is a schematic diagram showing a requirement analysis template according to an embodiment of the present application, and as shown in fig. 4, a text portion is a plurality of requirement details in the requirement analysis template, and an underlined portion is a content to be filled out by a test designer.
S32: and responding to the parameter input operation aiming at each demand detail item, and determining the parameters input by the parameter input operation as the demand detail corresponding to each demand detail item.
Specifically, the test designer performs a parameter input operation in each demand detail item of the demand analysis template, where the parameter input operation is an operation of the test designer to input a demand detail for each demand detail item, and the demand detail is a test content corresponding to the demand detail item. By way of example, the parameter input operation may be a keyboard input operation.
For example, as shown in fig. 4, the relevant business process items included in the requirement analysis template are used to indicate that the test on the configuration values during the test needs to be performed after the corresponding process.
According to the test case automatic generation method provided by the embodiment of the application, the demand analysis template is displayed, the parameter input operation aiming at each demand detail item is responded, and the parameter input by the parameter input operation is determined to be the demand detail corresponding to each demand detail item. By the method provided by the embodiment of the application, the requirement analysis template can be visualized, so that a test designer can conveniently input requirement details, the format unification of the input requirement details is ensured, the automatic generation of test cases is conveniently realized, and the writing efficiency of the test cases is improved.
On the basis of the foregoing embodiment, the embodiment of the present application further provides a test case automatic generation method, and fig. 5 is a schematic flow diagram of a fourth test case automatic generation method provided by the embodiment of the present application, as shown in fig. 5, and after S30, the method further includes:
s33: and displaying a main table of demand analysis.
Specifically, after a test designer inputs a demand detail aiming at a demand analysis template, a demand analysis main table and a demand analysis detail table are generated by storing the demand detail, and a plurality of demand analysis main tables are displayed in a display area of test case automatic generation software. The main table of demand analysis shows: the method comprises the steps of identifying a target requirement analysis type and information of a test requirement, wherein the information of the test requirement is descriptive information input by a test designer aiming at the test requirement so as to generally describe the test requirement.
For example, table 3 is a main table for demand analysis provided in an embodiment of the present application.
TABLE 3 Master Table for demand analysis
Demand analysis master table ID Demand ID Demand analysis name
1 98569 Patient finishes visiting and adds appointment reminding function
The requirement analysis main table ID corresponds to an identification of a requirement analysis type, the requirement ID is a number provided by a test designer for the current test requirement, and the requirement analysis name is information of the test requirement.
S34: in response to a viewing operation of the demand analysis master table, a demand analysis list is displayed.
Specifically, in order to facilitate management of demand analysis, only a plurality of demand analysis master tables are displayed in a display area of the test case automatic generation software, and if the detailed content of the demand analysis needs to be checked, checking operation can be performed on the demand analysis master tables so as to display the demand analysis detailed table in the display area of the test case automatic generation software. The demand analysis detail table includes: the system comprises a plurality of requirement details, a plurality of requirement details and a requirement detail item corresponding to each requirement detail in a requirement analysis template.
By way of example, table 4 is a demand analysis statement provided by an embodiment of the present application.
TABLE 4 demand analysis statement
/>
According to the test case automatic generation method provided by the embodiment of the application, the demand analysis main table is displayed, and the demand analysis detail table is displayed in response to the checking operation aiming at the demand analysis main table. By the method provided by the embodiment of the application, the test requirements proposed by the test designer can be uniformly managed.
On the basis of the foregoing embodiment, the embodiment of the present application further provides a test case automatic generation method, and fig. 6 is a schematic flow chart of a fifth test case automatic generation method provided by the embodiment of the present application, as shown in fig. 6, where the step S50 includes:
S51: generating test steps corresponding to the demand detail items and test expected results corresponding to the test steps according to the identification of the demand detail items in the demand analysis template, the demand detail corresponding to the demand detail items in the demand analysis content, the rules of the plurality of test steps and the test expected result rules corresponding to the test steps.
Specifically, the rules of the multiple test steps generate the identifications in the rule table in the test case, have one-to-one correspondence with the identifications of all the requirement details in the requirement analysis template, generate the rules of the corresponding test steps in the rule table from the test case according to the identifications of all the requirement details in the requirement analysis template, determine the corresponding requirement details from the requirement analysis content according to the identifications of the requirement details as the requirement keywords in the rules of the test steps, and generate the corresponding test steps.
And determining corresponding demand details from the demand analysis content as demand keywords in the test expected result rules according to the test expected result rules corresponding to the test steps, and generating corresponding test expected results.
S52: and generating a test case table according to the test steps corresponding to the requirement detail items and the test expected results corresponding to the test steps.
Specifically, the test steps corresponding to the requirement detail items and the test expected results corresponding to the test steps are in one-to-one correspondence, and a test case table is generated.
In an alternative embodiment, the demand details further include a demand analysis precondition, the test case generation rule table includes a precondition rule, the test precondition is generated according to the precondition rule and the demand analysis precondition, the test case table further includes a test precondition corresponding to the current test step, the test precondition is associated with the precondition test step, and the test precondition is determined by a test expected result corresponding to the precondition test step. After the precondition test step is executed, executing the current test step corresponding to the corresponding test precondition according to the test expected result corresponding to the precondition test step.
For example, table 5 is a test case table provided in an embodiment of the present application.
TABLE 5 test case Table
/>
/>
The content in the double quotation marks is the content determined from the demand analysis detail table according to the demand analysis template ID, and XX is the content which needs to be filled in the test process according to the test case table.
According to the automatic test case generation method provided by the embodiment of the application, according to the identification of each demand detail item in the demand analysis template, the demand detail corresponding to each demand detail item in the demand analysis content, the rules of a plurality of test steps and the test expected result rules corresponding to each test step, the test steps corresponding to each demand detail item and the test expected results corresponding to each test step are generated, and according to the test steps corresponding to each demand detail item and the test expected results corresponding to each test step, the test case table is generated. By the method provided by the embodiment of the application, the test case table can be automatically generated, the automatic generation of the test case table is realized, and the writing efficiency of the test case table is improved.
On the basis of the foregoing embodiment, the embodiment of the present application further provides a test case automatic generation method, and fig. 7 is a schematic flow diagram of a sixth test case automatic generation method provided by the embodiment of the present application, as shown in fig. 7, where the method further includes:
s61: and displaying the test case table.
Specifically, the test case table is displayed in a display interface of the test case automatic generation software, so that a tester can check the test case table and test the function of the software to be tested according to the test case table.
In an alternative embodiment, a tester performs a manual test on the software function to be tested, and during the test, each step of the software function to be tested is tested according to the test steps in the test case table, wherein "XX" in the test case table represents the content that needs to be manually input during the test, and the test result and the test prediction result of each step are compared to determine that the software function to be tested is tested.
S62: input configuration parameters for each test step are received.
Specifically, before an automated test is performed, configuration parameters of each test step are input, and the configuration parameters correspond to actual contents of XX in a test case table.
In an alternative embodiment, an automated keyword rule report is generated according to the test case table, where the automated keyword rule report includes a process keyword of each step of the automated test process and a check keyword corresponding to each step of the process.
Exemplary, table 6 is an automated keyword rule report provided by an embodiment of the present application
Table 6 automated keyword rule report
S63: and generating a test script according to the test case table and the configuration parameters.
Specifically, in the automatic test framework, a test script is generated according to the test case table and the configuration parameters, and the automatic test of the software function to be tested is completed by executing the test script.
The test case automatic generation method provided by the embodiment of the application displays the test case table, receives the input configuration parameters for each test step, and generates the test script according to the test case table and the configuration parameters. By the method provided by the embodiment of the application, the automatic test of the software function to be tested can be realized, and the writing efficiency of the test script is improved.
On the basis of the foregoing embodiment, the embodiment of the present application further provides an automatic test case generating device, and fig. 8 is a schematic structural diagram of the automatic test case generating device provided by the embodiment of the present application, as shown in fig. 8, where the device includes:
An analysis type determination module 10 for determining a target demand analysis type of the input test demand;
The analysis template determining module 20 is configured to determine an analysis template corresponding to a target requirement analysis type of the test requirement as a requirement analysis template;
An analysis content acquisition module 30 for acquiring a demand analysis content input for the demand analysis template; the demand analysis content includes: a plurality of demand details;
The generating rule determining module 40 is configured to determine that an application case generating rule table corresponding to the requirement analysis template is a test case generating rule table, where the test case generating rule table includes: rules of a plurality of test steps and test expected result rules corresponding to each test step;
The test case table generating module 50 is configured to generate a rule table according to a requirement analysis template, a requirement analysis content and a test case, and generate a test case table corresponding to a test requirement, where the test case table includes a plurality of test steps and test expected results corresponding to the test steps, and each test step is a test step corresponding to a requirement detail.
Optionally, the analysis type determining module 10 includes:
An analysis type display unit for displaying a plurality of requirement analysis types on a requirement analysis maintenance interface;
and the analysis type selection unit is used for responding to the selection operation input for the plurality of requirement analysis types and determining the requirement analysis type corresponding to the selection operation as the target requirement analysis type.
Optionally, the analysis content acquisition module 30 includes:
The analysis template display unit is used for displaying a requirement analysis template, wherein the requirement analysis template is displayed with the following components: a plurality of demand details;
The demand detail input unit is used for responding to the parameter input operation aiming at each demand detail item and determining that the parameter input by the parameter input operation is the demand detail corresponding to each demand detail item.
Optionally, after analyzing the content acquisition module 30, the apparatus further comprises:
The analysis main table display unit is used for displaying a demand analysis main table, wherein the demand analysis main table is provided with the following components: identification of the target demand analysis type and information of the test demand;
an analysis list display unit for displaying a demand analysis list in response to a viewing operation for the demand analysis master list, the demand analysis list including: the system comprises a plurality of requirement details, a plurality of requirement details and a requirement detail item corresponding to each requirement detail in a requirement analysis template.
Optionally, the generating rule determining module 40 is specifically configured to analyze the identification information of the template according to the requirement, determine, from the database, an application generating rule table corresponding to the identification information, and generate the rule table for the test case.
Optionally, the test case table generating module 50 includes:
The test step generating unit is used for generating test steps corresponding to each demand detail item and test expected results corresponding to each test step according to the identification of each demand detail item in the demand analysis template, the demand detail corresponding to each demand detail item in the demand analysis content, the rules of a plurality of test steps and the test expected result rules corresponding to each test step;
And the test case table generating unit is used for generating a test case table according to the test steps corresponding to the requirement detail items and the test expected results corresponding to the test steps.
Optionally, the apparatus further comprises:
the test case table display module is used for displaying the test case table;
the configuration parameter input module is used for receiving input configuration parameters for each test step;
and the test script generating unit is used for generating a test script according to the test case table and the configuration parameters. The foregoing apparatus is used for executing the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
The above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more Application SPECIFIC INTEGRATED Circuits (ASIC), or one or more microprocessors, or one or more field programmable gate arrays (Field Programmable GATE ARRAY FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 9 is a schematic diagram of an electronic device according to an embodiment of the present application, where the electronic device 100 includes: processor 101, storage medium 102, and bus
The storage medium 102 stores program instructions executable by the processor 101, and when the electronic device 100 is running, the processor 101 communicates with the storage medium 102 through a bus, and the processor 101 executes the program instructions to perform the above-described method embodiments. The specific implementation manner and the technical effect are similar, and are not repeated here.
Optionally, the present invention also provides a program product, such as a computer readable storage medium, comprising a program for performing the above-described method embodiments when being executed by a processor.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform some of the steps of the methods according to the embodiments of the invention. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
The foregoing is merely illustrative of embodiments of the present invention, and the present invention is not limited thereto, and any changes or substitutions can be easily made by those skilled in the art within the technical scope of the present invention, and the present invention is intended to be covered by the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. The automatic test case generation method is characterized by comprising the following steps:
determining a target demand analysis type of an input test demand, wherein the test demand is a demand for a software function to be tested;
Determining an analysis template corresponding to the target demand analysis type of the test demand as a demand analysis template;
Acquiring demand analysis content input for the demand analysis template, wherein the demand analysis content comprises: a plurality of demand details, the demand details including demand analysis preconditions;
determining an application case generation rule table corresponding to the requirement analysis template to generate a rule table for a test case, wherein the test case generation rule table comprises: rules of a plurality of test steps, test expected result rules and precondition rules corresponding to each test step;
Generating a test case table corresponding to the test requirement according to the requirement analysis template, the requirement analysis content and the test case generation rule table, wherein the test case table comprises a plurality of test steps, test expected results corresponding to the test steps and test preconditions corresponding to the test steps, each test step is a test step corresponding to a requirement detail, the test preconditions are determined according to the requirement analysis preconditions and the precondition rule, the test preconditions are associated with the precondition test steps, and the test preconditions are used for executing the current test step corresponding to the test preconditions corresponding to the test expected results according to the test expected results corresponding to the test expected results after the execution of the precondition test steps is completed.
2. The method of claim 1, wherein the determining the target demand analysis type of the input test demand comprises:
Displaying a plurality of requirement analysis types on a requirement analysis maintenance interface;
And responding to the selection operation input for the plurality of requirement analysis types, and determining the requirement analysis type corresponding to the selection operation as the target requirement analysis type.
3. The method of claim 1, wherein the obtaining the demand analysis content entered for the demand analysis template comprises:
displaying the requirement analysis template, wherein the requirement analysis template is displayed with: a plurality of demand details;
And responding to the parameter input operation aiming at each demand detail item, and determining the parameters input by the parameter input operation as the demand detail corresponding to each demand detail item.
4. The method of claim 1, wherein after the obtaining the demand analysis content input for the demand analysis template, the method further comprises:
Displaying a demand analysis master table, wherein the demand analysis master table is displayed with: identification of the target demand analysis type and information of the test demand;
In response to a viewing operation of the demand analysis master table, displaying a demand analysis list comprising: the identification of the plurality of demand details, the plurality of demand details and the demand detail items corresponding to the demand details in the demand analysis template.
5. The method of claim 1, wherein determining the application generation rule table corresponding to the requirement analysis template generates a rule table for a test case, comprises:
And determining an application case generation rule table corresponding to the identification information from a database according to the identification information of the requirement analysis template to generate a rule table for the test application case.
6. The method of claim 1, wherein the demand analysis template, the content according to the demand analysis, and the test case generation rule table, comprise:
Generating test steps corresponding to the demand details items and test expected results corresponding to the test steps according to the identifications of the demand details items in the demand analysis template, the demand details corresponding to the demand details items in the demand analysis content, the rules of the plurality of test steps and the test expected result rules corresponding to the test steps;
and generating a test case table according to the test steps corresponding to the requirement detail items and the test expected results corresponding to the test steps.
7. The method of any one of claims 1-6, wherein the method further comprises:
displaying the test case table;
Receiving input configuration parameters for each test step;
and generating a test script according to the test case table and the configuration parameters.
8. An automatic test case generating device, comprising:
The analysis type determining module is used for determining a target demand analysis type of an input test demand, wherein the test demand is a demand for a software function to be tested;
The analysis template determining module is used for determining an analysis template corresponding to the target requirement analysis type of the test requirement as a requirement analysis template;
the analysis content acquisition module is used for acquiring the requirement analysis content input by aiming at the requirement analysis template; the demand analysis content includes: a plurality of demand details, the demand details including demand analysis preconditions;
The generating rule determining module is configured to determine that an application case generating rule table corresponding to the requirement analysis template is a test case generating rule table, where the test case generating rule table includes: rules of a plurality of test steps, test expected result rules and precondition rules corresponding to each test step;
The test case table generation module is used for generating a test case table corresponding to the test requirement according to the requirement analysis template, the requirement analysis content and the test case generation rule table, wherein the test case table comprises a plurality of test steps, test expected results corresponding to the test steps and test preconditions corresponding to the test steps, each test step is a test step corresponding to a requirement detail, the test preconditions are determined according to the requirement analysis preconditions and the precondition rule, the test preconditions are associated with the precondition test steps, and the test preconditions are used for executing the current test step corresponding to the test precondition corresponding to the test expected results according to the test expected results corresponding to the precondition test steps after the execution of the precondition test steps is completed.
9. An electronic device, comprising: a processor, a storage medium, and a bus, the storage medium storing program instructions executable by the processor, the processor and the storage medium communicating through the bus when the electronic device is running, the processor executing the program instructions to perform the steps of the test case automatic generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the test case automatic generation method according to any one of claims 1 to 7.
CN202110756055.5A 2021-07-05 2021-07-05 Automatic test case generation method and device, electronic equipment and storage medium Active CN113342692B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110756055.5A CN113342692B (en) 2021-07-05 2021-07-05 Automatic test case generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110756055.5A CN113342692B (en) 2021-07-05 2021-07-05 Automatic test case generation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113342692A CN113342692A (en) 2021-09-03
CN113342692B true CN113342692B (en) 2024-05-03

Family

ID=77482416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110756055.5A Active CN113342692B (en) 2021-07-05 2021-07-05 Automatic test case generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113342692B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113791982A (en) * 2021-09-18 2021-12-14 中国农业银行股份有限公司 Test scheme generation method and system
CN115437336A (en) * 2021-12-09 2022-12-06 北京罗克维尔斯科技有限公司 Test method and device for test case, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5490249A (en) * 1992-12-23 1996-02-06 Taligent, Inc. Automated testing system
CN103176896A (en) * 2011-12-23 2013-06-26 阿里巴巴集团控股有限公司 Generating method and generating device of test cases
CN103365777A (en) * 2013-07-04 2013-10-23 卫生部统计信息中心 Test case generation system and system
CN103617119A (en) * 2013-12-03 2014-03-05 南通大学 Method for selecting regression test cases based on statement interactive coverage
CN111026670A (en) * 2019-12-11 2020-04-17 广州品唯软件有限公司 Test case generation method, test case generation device, and storage medium
CN111881022A (en) * 2020-07-07 2020-11-03 上海中通吉网络技术有限公司 Method, device and equipment for generating test case based on test scene
CN112328489A (en) * 2020-11-11 2021-02-05 南京领行科技股份有限公司 Test case generation method and device, terminal equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100547562C (en) * 2006-10-18 2009-10-07 国际商业机器公司 The method and system of the unit testing use-case of problem when generation can be reproduced operation automatically
CN102622294B (en) * 2011-01-28 2014-12-10 国际商业机器公司 Method and method for generating test cases for different test types
US9715592B2 (en) * 2015-10-16 2017-07-25 Sap Se Dynamic analysis security testing of multi-party web applications via attack patterns

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5490249A (en) * 1992-12-23 1996-02-06 Taligent, Inc. Automated testing system
CN103176896A (en) * 2011-12-23 2013-06-26 阿里巴巴集团控股有限公司 Generating method and generating device of test cases
CN103365777A (en) * 2013-07-04 2013-10-23 卫生部统计信息中心 Test case generation system and system
CN103617119A (en) * 2013-12-03 2014-03-05 南通大学 Method for selecting regression test cases based on statement interactive coverage
CN111026670A (en) * 2019-12-11 2020-04-17 广州品唯软件有限公司 Test case generation method, test case generation device, and storage medium
CN111881022A (en) * 2020-07-07 2020-11-03 上海中通吉网络技术有限公司 Method, device and equipment for generating test case based on test scene
CN112328489A (en) * 2020-11-11 2021-02-05 南京领行科技股份有限公司 Test case generation method and device, terminal equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Property-Based Testing with External Test-Case Generators;Bernhard K. Aichernig等;《2017 IEEE International Conference on Software Testing, Verification and Validation Workshops (ICSTW)》;20170417;第337-346页 *
测试案例标准化管理系统的设计与实现;李运涛;《中国优秀硕士学位论文全文数据库 信息科技辑》;20170315;第I138-2827页 *

Also Published As

Publication number Publication date
CN113342692A (en) 2021-09-03

Similar Documents

Publication Publication Date Title
EP3563243B1 (en) Determining application test results using screenshot metadata
CN107665171B (en) Automatic regression testing method and device
CN111722839B (en) Code generation method and device, electronic equipment and storage medium
CN111858371A (en) Software testing method, system, storage medium and computer equipment
CN113342692B (en) Automatic test case generation method and device, electronic equipment and storage medium
CN110908890A (en) Automatic test method and device for interface
CN110990053A (en) Method for creating and using machine learning scheme template and device
US11055208B1 (en) Systems and methods for automatically assessing and conforming software development modules to accessibility guidelines in real-time
CN110837356B (en) Data processing method and device
CN109840192B (en) Method and device for automatic testing
CN111427577A (en) Code processing method and device and server
CN112783762A (en) Software quality evaluation method and device and server
CN114168565B (en) Backtracking test method, device and system of business rule model and decision engine
CN115576828A (en) Test case generation method, device, equipment and storage medium
CN114880238A (en) Mobile terminal interface testing method, device, equipment and storage medium
CN110826306B (en) Data acquisition method and device, computer readable storage medium and electronic equipment
CN112988578A (en) Automatic testing method and device
JP5787404B2 (en) Apparatus and program for generating test specifications for a computer program
CN109558315B (en) Method, device and equipment for determining test range
US10372849B2 (en) Performing and communicating sheet metal simulations employing a combination of factors
CN113377648A (en) Software system diagnosis method and device, electronic equipment and computer readable medium
CN111832254B (en) Drawing annotation display processing method and device
CN111737784B (en) Board card type selection configuration method and equipment based on digital three-dimensional ZXMP S385 subframe
CN111309623B (en) Coordinate class data classification test method and device
CN109697141B (en) Method and device for visual testing

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
GR01 Patent grant
GR01 Patent grant