CA3131079A1 - Test case generation method and device, computer equipment and storage medium - Google Patents

Test case generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CA3131079A1
CA3131079A1 CA3131079A CA3131079A CA3131079A1 CA 3131079 A1 CA3131079 A1 CA 3131079A1 CA 3131079 A CA3131079 A CA 3131079A CA 3131079 A CA3131079 A CA 3131079A CA 3131079 A1 CA3131079 A1 CA 3131079A1
Authority
CA
Canada
Prior art keywords
test
generating
case
test case
configuration table
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
CA3131079A
Other languages
French (fr)
Inventor
Xiaoqiang Hu
Qiang Chen
Qian Sun
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.)
10353744 Canada Ltd
Original Assignee
10353744 Canada 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 10353744 Canada Ltd filed Critical 10353744 Canada Ltd
Publication of CA3131079A1 publication Critical patent/CA3131079A1/en
Pending legal-status Critical Current

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

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 present invention makes public a method of and a device for generating a test case, a computer equipment and a storage medium. The method comprises: receiving a generation request of a test case to be generated, matching out a corresponding case template from a preset case template library according to the generation request, generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table, using the test scenario to test an object to be tested, obtaining a test result, and generating a final test case according to the test scenario and the test result, whereby the problem of leaving out test scenario due to human factors is avoided, and the workload for compiling test cases is greatly reduced.

Description

TEST CASE GENERATION METHOD AND DEVICE, COMPUTER EQUIPMENT
AND STORAGE MEDIUM
BACKGROUND OF THE INVENTION
Technical Field [0001] The present invention relates to the field of information testing technology, and more particularly to a method of and a device for generating a test case, a computer equipment and a storage medium.
Description of Related Art
[0002] At present, when testing personnel compiles test cases, the same operating steps are sometimes encountered, and test results are different due to different input conditions; to deal with such a test scenario, it is usual for the testing personnel to list all possible scenarios with the aid of a form, and thereafter designs the test cases.
[0003] However, employment of such a designing method might engender the following circumstances: partial scenarios are left out during manual division of scenarios; although the division of scenarios is correct, partial scenarios are still left out in actual compilation of the test case, and it is found during check that checking efficiency is low; when there are relatively many combinations, workload for compiling the test case is relatively great.
[0004] Accordingly, there is an urgent need to propose a new method of generating a test case.
SUMMARY OF THE INVENTION
[0005] In order to solve the problems pending in the state of the art, embodiments of the present invention provide a method of and a device for generating a test case, a computer equipment and a storage medium, so as to solve such problems as prevalent in prior-art technology that test scenarios are left out due to human factors in the design of cases and that the workload for compiling test cases is relatively great.

Date Recue/Date Received 2021-11-17
[0006] To address one or more of the aforementioned technical problems, the present invention employs the following technical solutions.
[0007] According to the first aspect, a method of generating a test case is provided, and the method comprises the following steps:
[0008] receiving a generation request of a test case to be generated, and matching out a corresponding case template from a preset case template library according to the generation request;
[0009] generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table;
[0010] using the test scenario to test an object to be tested, and obtaining a test result; and
[0011] generating a final test case according to the test scenario and the test result.
[0012] In some embodiments, the generation request includes user information, and the method further comprises:
[0013] extracting user information from the generation request after the generation request of the test case to be generated has been received, and authenticating a current user according to the user information.
[0014] In some embodiments, the method further comprises:
[0015] in the case authentication is successful, generating the rule configuration table according to test requirement of the test case to be generated and the preconfigured parameter relation table.
[0016] In some embodiments, the method further comprises a process of generating the rule configuration table, including:
[0017] determining a module to be tested according to test requirement of the test case to be Date Recue/Date Received 2021-11-17 generated, determining required parameters according to the module to be tested and the preconfigured parameter relation table, and generating the rule configuration table according to the required parameters.
[0018] In some embodiments, generating the rule configuration table according to the parameter information includes:
[0019] creating an initial rule configuration table according to the required parameter information, inserting combinations of the parameters respectively into the initial rule configuration table, traversing data in the initial rule configuration table, generating a corresponding execution result according to preset execution conditions, writing the execution result in the initial rule configuration table, and generating the final rule configuration table.
[0020] In some embodiments, the step of generating a test scenario according to the case template and a rule configuration table includes:
[0021] analyzing the case template, generating a test case header according to an analysis result, and generating the test scenario according to the test case header and the rule configuration table.
[0022] In some embodiments, the generation request includes test case name and path, and the method further comprises:
[0023] extracting test case name and path from the generation request after the generation request of the test case to be generated has been received, judging whether the test case name and path have already existed, if yes, deleting the existent test case.
[0024] According to the second aspect, a device for generating a test case is provided, and the device comprises:
[0025] a request receiving module, for receiving a generation request of a test case to be generated;

Date Recue/Date Received 2021-11-17
[0026] a template matching module, for matching out a corresponding case template from a preset case template library according to the generation request;
[0027] a scenario generating module, for generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table;
[0028] a result obtaining module, for using the test scenario to test an object to be tested, and obtaining a test result; and
[0029] a case generating module, for generating a final test case according to the test scenario and the test result.
[0030] According to the third aspect, there is provided a computer equipment that comprises a memory, a processor and a computer program stored on the memory and operable on the processor, and the following steps are realized when the processor executes the computer program:
[0031] receiving a generation request of a test case to be generated, and matching out a corresponding case template from a preset case template library according to the generation request;
[0032] generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table;
[0033] using the test scenario to test an object to be tested, and obtaining a test result; and
[0034] generating a final test case according to the test scenario and the test result.
[0035] According to the fourth aspect, there is provided a computer-readable storage medium storing a computer program thereon, and the following steps are realized when the computer program is executed by a processor:
[0036] receiving a generation request of a test case to be generated, and matching out a corresponding case template from a preset case template library according to the generation Date Recue/Date Received 2021-11-17 request;
[0037] generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table;
[0038] using the test scenario to test an object to be tested, and obtaining a test result; and
[0039] generating a final test case according to the test scenario and the test result.
[0040] Advantageous effects brought about by the technical solutions provided by the embodiments of the present invention are as follows.
1. In the method for generating a test case, device, computer equipment and storage medium thereof provided by the embodiments of the present invention, by receiving a generation request of a test case to be generated, matching out a corresponding case template from a preset case template library according to the generation request, generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table, using the test scenario to test an object to be tested, obtaining a test result, and generating a final test case according to the test scenario and the test result, the problem of leaving out test scenario due to human factors is avoided, and the workload for compiling test cases is greatly reduced.
2. In the method of and device for generating a test case, computer equipment and storage medium provided by the embodiments of the present invention, by determining a module to be tested according to test requirement of the test case to be generated, determining required parameters according to the module to be tested and the preconfigured parameter relation table, and generating the rule configuration table according to the required parameters, automated creation of parameters is achieved, and working efficiency is enhanced.
Date Recue/Date Received 2021-11-17
[0041] All products of the present invention are not necessarily required to possess all of the aforementioned effects.
BRIEF DESCRIPTION OF THE DRAWINGS
[0042] To more clearly describe the technical solutions in the embodiments of the present invention, drawings required to illustrate the embodiments are briefly introduced below.
Apparently, the drawings introduced below are merely directed to some embodiments of the present invention, while persons ordinarily skilled in the art may further acquire other drawings on the basis of these drawings without spending creative effort in the process.
[0043] Fig. 1 is a view illustrating the architecture of a system for generating a test case according to an exemplary embodiment;
[0044] Fig. 2 is a flowchart illustrating a method of generating a test case according to an exemplary embodiment;
[0045] Fig. 3 is a flowchart illustrating a method of generating a test case according to an exemplary embodiment;
[0046] Fig. 4 is a flowchart illustrating user authentication according to an exemplary embodiment;
[0047] Fig. 5 is a flowchart illustrating the generation of a rule configuration table according to an exemplary embodiment;
[0048] Fig. 6 is a view schematically illustrating the structure of a device for generating a test case according to an exemplary embodiment; and Date Recue/Date Received 2021-11-17
[0049] Fig. 7 is a view schematically illustrating the internal structure of a computer equipment according to an exemplary embodiment.
DETAILED DESCRIPTION OF THE INVENTION
[0050] To make more lucid and clear the objectives, technical solutions and advantages of the present invention, the technical solutions in the embodiments of the present invention will be clearly and comprehensively described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the embodiments as described are merely partial, rather than the entire, embodiments of the present invention.
Any other embodiments makeable by persons ordinarily skilled in the art on the basis of the embodiments in the present invention without creative effort shall all fall within the protection scope of the present invention.
[0051] As noted in the Description of Related Art, in order to solve the aforementioned problems, a method of generating a test case is creatively proposed in the embodiments of the present invention, and, corresponding to this method, embodiments of the present invention further provide a system for generating a test case; architecture of the software employed by the system is divided into three layers, as shown in Fig. 1, in which Swing is used in the view layer to process various pages inactive with the user, such as user login page and various configuration system pages; in the business layer are such business processing modules containing core functions of the system as modules for user authentication, for rule generation, for case automatic generation, and for rule matching, etc.; a conventional mysql database is used in the storage layer to store corresponding information, such as user information, rule storage information, and case template information, etc. This system makes use of a decision table to automatically design test cases, whereby is made possible to lessen the problem of leaving out test scenarios due to other human factors, and to set up parameters anew according to subsequent change in the Date Recue/Date Received 2021-11-17 test system to automatically create cases.
[0052] Figs. 2 and 3 are each a flowchart illustrating a method of generating a test case according to an exemplary embodiment. With reference to Figs. 2 and 3, the method comprises the following steps.
[0053] Si: receiving a generation request of a test case to be generated, and matching out a corresponding case template from a preset case template library according to the generation request.
[0054] Specifically, in the embodiments of the present invention, preconfigured case templates are used in the process of generating test cases, the case templates can be reused through the system without the need for redesign at each design, so that unity of test cases is guaranteed. During specific implementation, the preconfigured case templates are stored in a case template library, and when it is required to be used, a case template that satisfies the requirement is matched out of the case template library according to the received generation request of the test case to be generated.
[0055] As a preferred embodiment, in the embodiments of the present invention, a system for configuring a case template is provided, the system is mainly employed to configure subsequently generated test case templates, and parameters of such configuration include elements contained in a case, such as case ID, case name, case description, case level, preset condition, test data, step description, predicted output, case label, and so on, the various parameters configured by the user will be unifoimly stored in a database. An administrator user can configure case templates in unison, and the templates can be test case templates generated uniformly for a specific system or for a specific department, so that the problem of inconsistent case templates caused by human factors is exterminated. It is also possible for the user to load already well configured case templates into the system, without further manual configuration by the user herself/himself, so as to achieve the function of case Date Recue/Date Received 2021-11-17 template reuse. After the user has made configuration in the system, all configuration information is stored in the database, in which the table structure can be described for example as follows:
Table 1 Example of Case Template Field Field Name Field Type Description cmodeId Int ID
modeName varchar module pertained to Item varchar case element position Int position in which case element locates:
1 is first bit owner Varchar owner
[0056] S2: generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table.
[0057] Specifically, in the embodiments of the present invention, in order to avoid the problem of leaving out test scenarios due to human factors during design of cases, in generating a test scenario, a test scenario is generated according to the matched case template and a rule configuration table, in which the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table.
[0058] S3: using the test scenario to test an object to be tested, and obtaining a test result.
[0059] S4: generating a final test case according to the test scenario and the test result.

Date Recue/Date Received 2021-11-17
[0060] As a preferred embodiment, in the embodiments of the present invention there is provided a system for generating a test case, the system completes automatic generation of test case, and it suffices for the user to configure case name and output path in the system.
With further reference to Fig. 3, the system completes automatic generation of the test case by the following steps:
1) checking, on the basis of case name and path input by the user, whether the case exists in the path, if yes, prompting to delete it first; if not, creating a test case file;
2) reading case templates in the database, and generating a test case header;
3) configuring system according to test parameters, generating a corresponding test scenario, generating a corresponding output result according to output rules, and automatically generating a corresponding case ID;
4) depositing the aforementioned two types of information uniformly in a case object (that can be realized through codes, for instance), and depositing all objects uniformly in an array;
5) traversing the array of objects, obtaining a case ID corresponding thereto, inputting conditions, outputting a result field, inputting the same to a test case form, and thus ending the generation of the test case.
[0061] As a preferred embodiment, in the embodiments of the present invention, the generation request includes user information, and the method further comprises:
[0062] extracting user information from the generation request after the generation request of the test case to be generated has been received, and authenticating a current user according to the user information.
[0063] Specifically, in the embodiments of the present invention, in order to ensure safety of the data, it is further required to perform an authentication operation on the user that sends the generation request prior to generating the test case, namely to check the legitimacy and validity of the business for which the user makes use of the data (whether the state being activated) .
Date Recue/Date Received 2021-11-17
[0064] As a preferred embodiment, in the embodiments of the present invention, there is further provided a user authenticating system, as shown in Fig. 4, when a user logs in the system, account and password are required for login; when login is clicked, the system obtains the account and password and verifies with username and password stored in a backstage server, if verification succeeds, the system is entered, and different configuration pages are loaded dependent upon whether the user is a new user or not, otherwise a corresponding reminder will be given in the login page. Description of fields of the user information table (UserInfo) stored in the database is as shown below.
Table 2 Description of Fields of User Information Table Stored in the Database Field Name Field Type Description id Int user ID
account varchar user account password varchar user password:
encrypted in database storage
[0065] As a preferred embodiment, in the embodiments of the present invention, the method further comprises:
[0066] in the case authentication is successful, generating the rule configuration table according to test requirement of the test case to be generated and the preconfigured parameter relation table.
[0067] Specifically, when authentication is successful, a parameter configuration page is entered to generate the rule configuration table according to test requirement of the test case to be generated and the preconfigured parameter relation table. With further reference to Fig. 4, in the embodiments of the present invention, it is further possible to so set that Date Recue/Date Received 2021-11-17 the current user is validated as to whether she/he is a new user or an old user according to user information, if the current user is a new user, the parameter configuration page is directly entered; if the current user is an older user, a parameter configuration page of the module previously created by the user is loaded for compilation by the user, it is thus not required to redesign from the start again, whereby efficiency is enhanced.
[0068] As a preferred embodiment, in the embodiments of the present invention, the method further comprises a process of generating the rule configuration table, including:
[0069] determining a module to be tested according to test requirement of the test case to be generated, determining required parameters according to the module to be tested and the preconfigured parameter relation table, and generating the rule configuration table according to the required parameters.
[0070] Specifically, likewise, to avoid the problem of leaving out parameters due to human factors, it is possible, in the process of generating the rule configuration table, to firstly determine a module to be tested according to test requirement of the test case to be generated, subsequently enquire the preset parameter relation table to determine parameters required by the module to be tested, and finally generate the rule configuration table according to the required parameters. With reference to Fig. 5, in the embodiments of the present invention, there is further provided a system for configuring test parameters, whereby test parameters are configured after the user has successfully logged in the system;
if the current user previously operated on the test parameters of a certain module, the test parameters should be amended because the scenario of the system currently under test has changed, then amendment is made through this page; if the user previously did not make such operation, configuration is made directly through the system.
[0071] The parameters required to be configured by the user include, but are not limited to, test modules, input parameters, valuation of input parameters and English abbreviations of modules, etc., in which the valuation of input parameters can be either in fields or digits, Date Recue/Date Received 2021-11-17 and divided by scenarios.
[0072] The parameter configuring system provides system support for subsequent system setup through the determined module to be tested and the valuation of input parameters, and by storing the corresponding information in a test parameter configuration table in the database. As an example, description of fields stored in the test parameter configuration table (modeInfo) is shown below.
Table 3 Description of Fields Stored in Test Parameter Configuration Table Field Name Field Type Description pId Int parameter ID
modelName varchar module name: module to which the parameter pertains paraName varchar parameter name paraValue varchar parameter value ModeEn varchar English abbreviation of module owner varchar account pertained
[0073] An example is taken below for explanation.
[0074] When the module to be tested as determined according to test requirement of the test case to be generated is an enquiring module in user management, namely when it is required to test the enquiring module, the names of the input parameters can be automatically obtained by reading the page elements, and the automatically obtaining method is to check labels of page controls, and to obtain attribute names therein; through the automatic obtainment can be obtained the input parameters, respectively, as user Date Recue/Date Received 2021-11-17 information, user name, starting time and ending time of the creation time, and the role, in which the value of the role is automatically obtained through the page, such as an administrator or a common user. The value of the user information includes, but is not limited to, a null value, a valid work number, a nonexistent work number, a valid mobile phone number, and a nonexistent mobile phone number; the user name includes, but is not limited to, a null value, a valid user name, and a nonexistent name; the creation time includes, but is not limited to, a null value, a valid time, and an invalid time; the role includes, but is not limited to, all, an administrator, and a common user, etc.
[0075] As a preferred embodiment, in the embodiments of the present invention, generating the rule configuration table according to the parameter information includes:
[0076] creating an initial rule configuration table according to the required parameter information, inserting combinations of the parameters respectively into the initial rule configuration table, traversing data in the initial rule configuration table, generating a corresponding execution result according to preset execution conditions, writing the execution result in the initial rule configuration table, and generating the final rule configuration table.
[0077] Specifically, with further reference to Fig. 5, after the module to be tested has been determined, during the specific generation of the rule configuration table, the preset parameter relation table is firstly based on to enquire the parameters required by the module to be tested, the related parameters are stored in an array created in advance, an initial rule configuration table is then created according to the parameters in the array, combinations of the various parameters are respectively inserted into the initial configuration table, data in the initial rule configuration table is thereafter traversed, a corresponding execution result is generated according to preset execution conditions, if the execution conditions are satisfied, this indicates that execution is successful, otherwise the execution fails, and finally the execution result obtained by the above steps is written in a corresponding location (for instance, success information is written in a corresponding row of success Date Recue/Date Received 2021-11-17 field, and failure information is written in a corresponding row of failure field) of the initial rule configuration table, to thereby generate the final rule configuration table.
[0078] As a preferred embodiment, in the embodiments of the present invention, the step of generating a test scenario according to the case template and a rule configuration table includes:
[0079] analyzing the case template, generating a test case header according to an analysis result, and generating the test scenario according to the test case header and the rule configuration table.
[0080] Specifically, with further reference to Fig. 3, in the embodiments of the present invention, when the test scenario is generated according to the case template and the rule configuration table, the case template as obtained is firstly analyzed, a test case header is thereafter generated according to the analysis result, and the test scenario is finally generated according to the test case header and the rule configuration table.
[0081] As a preferred embodiment, in the embodiments of the present invention, the generation request includes test case name and path, and the method further comprises:
[0082] extracting test case name and path from the generation request after the generation request of the test case to be generated has been received, judging whether the test case name and path have already existed, if yes, deleting the existent test case.
[0083] Specifically, with further reference to Fig. 3, in the embodiments of the present invention, the generation request includes test case name and path, and the test case name and path can also be input by the user. After the test case name and path have been obtained, it is further required to judge whether the test case name and path have already existed, if yes, the user is reminded to delete the existent test case, if not, the process continues to the next step, namely to match out a corresponding case template from a preset case template library according to the generation request.
Date Recue/Date Received 2021-11-17
[0084] As a preferred embodiment, in the embodiments of the present invention, a system for configuring output rules is further provided, and the system is mainly employed for configuring the relation between input parameters and output result of the user. For instance, when the input parameters satisfy certain conditions, then the output result will be A; when the input parameters do not satisfy the conditions, then the output result will be B, thus making preparing conditions well for subsequent generation of cases.
Parameters required for the user to input in the system for configuring output rules include, but are not limited to, test parameters and values thereof, relations between parameters, result output after conditions are satisfied, and result output when conditions are not satisfied, etc. After the user has completed such configuration, corresponding tables are generated in the database ¨ generally speaking, it suffices for the user to configure a table for successful execution of cases and a table for failed execution of cases.
[0085] The parameter relation table is used to record parameters input by the user and values thereof, and to record their relation to other parameters, as shown in the following table.
Table 4 Fields of Parameter Relation Table Field Name Field Type Description ruleId Int rule ID
para varchar parameter name value Varchar parameter value relationship Int relation to other parameters: 1 being And, 0 being Or, what follows is adjustable as required model varchar module pertained to Date Recue/Date Received 2021-11-17 owner varchar owner
[0086] As a preferred embodiment, an output rule configuration table can be automatically generated by system code according to the parameter relation table, and the process is as follows:
1. The different parameters are enquired according to owner and pertained module, and are recorded in the array; an output rule configuration table is created according to parameters of the array: information of the table includes IDs and various parameters of the user and success values and failure values that are stored respectively as passResult and failResult fields, and the uniform format of the output rule configuration table is a module ID config.
2. Valuation of the parameters is enquired according to the names of the parameters, and each value is inserted into the output rule configuration table;
3. Values of the output results are read, including success and failure, and the information is input to corresponding fields (passResult and failResult fields) of the configuration table.
[0087] The following table is an example of rule IDs of the output rule configuration table - see specifics below.
Table 5 Rule IDs User User Name Creation Time Role Output Result Information null value null value null value all query succeeded null value null value null value administrator query Date Recue/Date Received 2021-11-17 succeeded null value null value null value common query user succeeded valid work any value valid value all query number succeeded valid mobile any value valid value all query phone number succeeded any value valid name valid value all query succeeded
[0088] Fig. 6 is a view schematically illustrating the structure of a device for generating a test case according to an exemplary embodiment, and the device comprises:
[0089] a request receiving module, for receiving a generation request of a test case to be generated;
[0090] a template matching module, for matching out a corresponding case template from a preset case template library according to the generation request;
[0091] a scenario generating module, for generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table;
[0092] a result obtaining module, for using the test scenario to test an object to be tested, and obtaining a test result; and
[0093] a case generating module, for generating a final test case according to the test scenario and the test result.
[0094] As a preferred embodiment, in the embodiments of the present invention, the generation request includes user information, and the device further comprises:
[0095] a user authenticating module, for extracting user information from the generation Date Recue/Date Received 2021-11-17 request after the generation request of the test case to be generated has been received, and authenticating a current user according to the user information.
[0096] As a preferred embodiment, in the embodiments of the present invention, the device further comprises:
[0097] a rule configuring module, for, in the case authentication is successful, generating the rule configuration table according to test requirement of the test case to be generated and the preconfigured parameter relation table.
[0098] As a preferred embodiment, in the embodiments of the present invention, the rule configuring module is further employed for:
[0099] determining a module to be tested according to test requirement of the test case to be generated, determining required parameters according to the module to be tested and the preconfigured parameter relation table, and generating the rule configuration table according to the required parameters.
[0100] As a preferred embodiment, in the embodiments of the present invention, the rule configuring module is further employed for:
[0101] creating an initial rule configuration table according to the required parameter information, inserting combinations of the parameters respectively into the initial rule configuration table, traversing data in the initial rule configuration table, generating a corresponding execution result according to preset execution conditions, writing the execution result in the initial rule configuration table, and generating the final rule configuration table.
[0102] As a preferred embodiment, in the embodiments of the present invention, the scenario generating module is specifically employed for:
[0103] analyzing the case template, generating a test case header according to an analysis result, and generating the test scenario according to the test case header and the rule configuration Date Recue/Date Received 2021-11-17 table.
[0104] As a preferred embodiment, in the embodiments of the present invention, the device further comprises:
[0105] a duplicate check processing module, for extracting test case name and path from the generation request after the generation request of the test case to be generated has been received, judging whether the test case name and path have already existed, if yes, deleting the existent test case.
[0106] Fig. 7 is a view schematically illustrating the internal structure of a computer equipment according to an exemplary embodiment. With reference to Fig. 7, the computer equipment comprises a processor, a memory, and a network interface connected to each other via a system bus. The processor of the computer equipment is employed to provide computing and controlling capabilities. The memory of the computer equipment includes a nonvolatile storage medium, and an internal memory. The nonvolatile storage medium stores therein an operating system, a computer program and a database. The internal memory provides environment for the running of the operating system and the computer program in the nonvolatile storage medium. The network interface of the computer equipment is employed to connect to an external terminal via network for communication. The computer program realizes a method of optimizing an execution plan when it is executed by a processor.
[0107] As understandable to persons skilled in the art, the structure illustrated in Fig. 7 is merely a block diagram of partial structure relevant to the solution of the present invention, and does not constitute any restriction to the computer equipment on which the solution of the present invention is applied, as the specific computer equipment may comprise component parts that are more than or less than those illustrated in Fig. 7, or may combine certain component parts, or may have different layout of component parts.
[0108] As a preferred embodiment, in the embodiments of the present invention, the computer equipment comprises a memory, a processor and a computer program stored on the memory Date Recue/Date Received 2021-11-17 and operable on the processor, and the following steps are realized when the processor executes the computer program:
[0109] receiving a generation request of a test case to be generated, and matching out a corresponding case template from a preset case template library according to the generation request;
[0110] generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table;
[0111] using the test scenario to test an object to be tested, and obtaining a test result; and
[0112] generating a final test case according to the test scenario and the test result.
[0113] As a preferred embodiment, in the embodiments of the present invention, when the processor executes the computer program, the following steps are further realized:
[0114] extracting user information from the generation request after the generation request of the test case to be generated has been received, and authenticating a current user according to the user information.
[0115] As a preferred embodiment, in the embodiments of the present invention, when the processor executes the computer program, the following step is further realized:
[0116] in the case authentication is successful, generating the rule configuration table according to test requirement of the test case to be generated and the preconfigured parameter relation table.
[0117] As a preferred embodiment, in the embodiments of the present invention, when the processor executes the computer program, the following steps are further realized:
[0118] determining a module to be tested according to test requirement of the test case to be generated, determining required parameters according to the module to be tested and the preconfigured parameter relation table, and generating the rule configuration table according to the required parameters.

Date Recue/Date Received 2021-11-17
[0119] As a preferred embodiment, in the embodiments of the present invention, when the processor executes the computer program, the following steps are further realized:
[0120] creating an initial rule configuration table according to the required parameter information, inserting combinations of the parameters respectively into the initial rule configuration table, traversing data in the initial rule configuration table, generating a corresponding execution result according to preset execution conditions, writing the execution result in the initial rule configuration table, and generating the final rule configuration table.
[0121] As a preferred embodiment, in the embodiments of the present invention, when the processor executes the computer program, the following steps are further realized:
[0122] analyzing the case template, generating a test case header according to an analysis result, and generating the test scenario according to the test case header and the rule configuration table.
[0123] As a preferred embodiment, in the embodiments of the present invention, when the processor executes the computer program, the following steps are further realized:
[0124] extracting test case name and path from the generation request after the generation request of the test case to be generated has been received, judging whether the test case name and path have already existed, if yes, deleting the existent test case.
[0125] In the embodiments of the present invention, there is further provided a computer-readable storage medium storing a computer program thereon, and the following steps are realized when the computer program is executed by a processor:
[0126] receiving a generation request of a test case to be generated, and matching out a corresponding case template from a preset case template library according to the generation request;
[0127] generating a test scenario according to the case template and a rule configuration table, Date Recue/Date Received 2021-11-17 wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table;
[0128] using the test scenario to test an object to be tested, and obtaining a test result; and
[0129] generating a final test case according to the test scenario and the test result.
[0130] As a preferred embodiment, in the embodiments of the present invention, when the computer program is executed by a processor, the following steps are further realized:
[0131] extracting user information from the generation request after the generation request of the test case to be generated has been received, and authenticating a current user according to the user information.
[0132] As a preferred embodiment, in the embodiments of the present invention, when the computer program is executed by a processor, the following step is further realized:
[0133] in the case authentication is successful, generating the rule configuration table according to test requirement of the test case to be generated and the preconfigured parameter relation table.
[0134] As a preferred embodiment, in the embodiments of the present invention, when the computer program is executed by a processor, the following steps are further realized:
[0135] determining a module to be tested according to test requirement of the test case to be generated, determining required parameters according to the module to be tested and the preconfigured parameter relation table, and generating the rule configuration table according to the required parameters.
[0136] As a preferred embodiment, in the embodiments of the present invention, when the computer program is executed by a processor, the following steps are further realized:
[0137] creating an initial rule configuration table according to the required parameter information, inserting combinations of the parameters respectively into the initial rule configuration table, traversing data in the initial rule configuration table, generating a Date Recue/Date Received 2021-11-17 corresponding execution result according to preset execution conditions, writing the execution result in the initial rule configuration table, and generating the final rule configuration table.
[0138] As a preferred embodiment, in the embodiments of the present invention, when the computer program is executed by a processor, the following steps are further realized:
[0139] analyzing the case template, generating a test case header according to an analysis result, and generating the test scenario according to the test case header and the rule configuration table.
[0140] As a preferred embodiment, in the embodiments of the present invention, when the computer program is executed by a processor, the following steps are further realized:
[0141] extracting test case name and path from the generation request after the generation request of the test case to be generated has been received, judging whether the test case name and path have already existed, if yes, deleting the existent test case.
[0142] In summary, advantageous effects brought about by the technical solutions provided by the embodiments of the present invention are as follows.
1. In the method of and device for generating a test case, computer equipment and storage medium provided by the embodiments of the present invention, by receiving a generation request of a test case to be generated, matching out a corresponding case template from a preset case template library according to the generation request, generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table, using the test scenario to test an object to be tested, obtaining a test result, and generating a final test case according to the test scenario and the test result, the problem of leaving out test scenario due to human factors is avoided, and the workload for compiling test Date Recue/Date Received 2021-11-17 cases is greatly reduced.
2. In the method of and device for generating a test case, computer equipment and storage medium provided by the embodiments of the present invention, by determining a module to be tested according to test requirement of the test case to be generated, determining required parameters according to the module to be tested and the preconfigured parameter relation table, and generating the rule configuration table according to the required parameters, automated creation of parameters is achieved, and working efficiency is enhanced.
[0143] As should be noted, when the device for generating a test case provided by this embodiment triggers a test case generating business, the division into the aforementioned various functional modules is merely by way of example, while it is possible, in actual application, to base on requirements to assign the functions to different functional modules for completion, that is to say, to divide the internal structure of the system into different functional modules to complete the entire or partial functions described above. In addition, the device for generating a test case provided by this embodiment pertains to the same conception as the method of generating a test case provided by method embodiment, that is to say, the device is based on the method of generating a test case ¨ see the corresponding method embodiment for its specific realization process, while no repetition will be made in this context.
[0144] As understandable by persons ordinarily skilled in the art, realization of the entire or partial steps of the aforementioned embodiments can be completed by hardware, or by a program instructing relevant hardware, the program can be stored in a computer-readable storage medium, and the storage medium can be a read-only memory, a magnetic disk, or an optical disk, etc.
[0145] What is described above is merely directed to preferred embodiments of the present Date Recue/Date Received 2021-11-17 invention, and they are not meant to restrict the present invention. Any amendment, equivalent replacement and improvement makeable within the spirit and scope of the present invention shall all be covered within the protection scope of the present invention.

Date Recue/Date Received 2021-11-17

Claims (10)

What is claimed is:
1. A method of generating a test case, characterized in that the method comprises the following steps:
receiving a generation request of a test case to be generated, and matching out a corresponding case template from a preset case template library according to the generation request;
generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table;
using the test scenario to test an object to be tested, and obtaining a test result; and generating a final test case according to the test scenario and the test result.
2. The method of generating a test case according to Claim 1, characterized in that the generation request includes user information, and that the method further comprises:
extracting user information from the generation request after the generation request of the test case to be generated has been received, and authenticating a current user according to the user information.
3. The method of generating a test case according to Claim 2, characterized in further comprising:
in the case that authentication is successful, generating the rule configuration table according to test requirement of the test case to be generated and the preconfigured parameter relation Date Recue/Date Received 2021-11-17 table.
4. The method of generating a test case according to any of Claims 1 to 3, characterized in further comprising a process of generating the rule configuration table, including:
determining a module to be tested according to test requirement of the test case to be generated, determining required parameters according to the module to be tested and the preconfigured parameter relation table, and generating the rule configuration table according to the required parameters.
5. The method of generating a test case according to Claim 4, characterized in that generating the rule configuration table according to the parameter information includes:
creating an initial rule configuration table according to the required parameter information, inserting combinations of the respective parameters into the initial rule configuration table, traversing data in the initial rule configuration table, generating a corresponding execution result according to preset execution conditions, writing the execution result in the initial rule configuration table, and generating the final rule configuration table.
6. The method of generating a test case according to any of Claims 1 to 3, characterized in that the step of generating a test scenario according to the case template and a rule configuration table includes:
analyzing the case template, generating a test case header according to an analysis result, and generating the test scenario according to the test case header and the rule configuration table.
7. The method of generating a test case according to any of Claims 1 to 3, characterized in that Date Recue/Date Received 2021-11-17 the generation request includes test case name and path, and that the method further comprises:
extracting test case name and path from the generation request after the generation request of the test case to be generated has been received, judging whether the test case name and path have already existed, if the test case name and path have already existed, deleting the existent test case.
8. A device for generating a test case, characterized in that the device comprises:
a request receiving module, for receiving a generation request of a test case to be generated;
a template matching module, for matching out a corresponding case template from a preset case template library according to the generation request;
a scenario generating module, for generating a test scenario according to the case template and a rule configuration table, wherein the rule configuration table is generated according to test requirement of the test case to be generated and a preconfigured parameter relation table;
a result obtaining module, for using the test scenario to test an object to be tested, and obtaining a test result; and a case generating module, for generating a final test case according to the test scenario and the test result.
9. A computer equipment, comprising a memory, a processor and a computer program stored on the memory and operable on the processor, characterized in that the method steps according to any of Claims 1 to 7 are realized when the processor executes the computer program.
10. A computer-readable storage medium, storing a computer program thereon, characterized in Date Recue/Date Received 2021-11-17 that the method steps according to any of Claims 1 to 7 are realized when the computer program is executed by a processor.
Date Recue/Date Received 2021-11-17
CA3131079A 2020-09-17 2021-09-17 Test case generation method and device, computer equipment and storage medium Pending CA3131079A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010985123.0A CN112256558B (en) 2020-09-17 2020-09-17 Test case generation method and device, computer equipment and storage medium
CN202010985123.0 2020-09-17

Publications (1)

Publication Number Publication Date
CA3131079A1 true CA3131079A1 (en) 2022-03-17

Family

ID=74231591

Family Applications (1)

Application Number Title Priority Date Filing Date
CA3131079A Pending CA3131079A1 (en) 2020-09-17 2021-09-17 Test case generation method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112256558B (en)
CA (1) CA3131079A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115237814A (en) * 2022-09-20 2022-10-25 北京结慧科技有限公司 Method and system for automatically generating interface test case, storage medium and equipment
CN115509900A (en) * 2022-09-15 2022-12-23 上海宜软检测技术有限公司 Method and system for generating functional test case
CN116304399A (en) * 2023-05-19 2023-06-23 建信金融科技有限责任公司 Visual processing method, device and system for test cases

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111581074A (en) * 2020-03-26 2020-08-25 平安普惠企业管理有限公司 Call scene coverage testing method and device, computer equipment and storage medium
CN113051171B (en) * 2021-04-08 2024-04-02 深圳赛安特技术服务有限公司 Interface testing method, device, equipment and storage medium
CN113190434B (en) * 2021-04-12 2024-03-08 成都安易迅科技有限公司 Test case generation method and device, storage medium and computer equipment
CN113176995B (en) * 2021-04-28 2024-03-19 平安银行股份有限公司 Interface testing method, device, equipment and medium based on testing scene
CN113138933A (en) * 2021-05-13 2021-07-20 网易(杭州)网络有限公司 Data table testing method, electronic device and storage medium
CN114116452A (en) * 2021-10-29 2022-03-01 北京达佳互联信息技术有限公司 Test case generation method and device, electronic equipment and storage medium
CN115047836A (en) * 2022-06-27 2022-09-13 中国核动力研究设计院 Test case generation and loading method and system based on DCS system periodic test
CN116185883A (en) * 2023-04-28 2023-05-30 阿里云计算有限公司 Test case generation method, test system, device, equipment and medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6542612B2 (en) * 2015-08-21 2019-07-10 株式会社日立製作所 Test scenario generation support apparatus and test scenario generation support method
CN110928802A (en) * 2019-12-24 2020-03-27 平安资产管理有限责任公司 Test method, device, equipment and storage medium based on automatic generation of case
CN111506498B (en) * 2020-03-16 2022-06-21 平安科技(深圳)有限公司 Automatic generation method and device of test case, computer equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115509900A (en) * 2022-09-15 2022-12-23 上海宜软检测技术有限公司 Method and system for generating functional test case
CN115509900B (en) * 2022-09-15 2024-02-02 上海宜软检测技术有限公司 Method and system for generating functional test cases
CN115237814A (en) * 2022-09-20 2022-10-25 北京结慧科技有限公司 Method and system for automatically generating interface test case, storage medium and equipment
CN116304399A (en) * 2023-05-19 2023-06-23 建信金融科技有限责任公司 Visual processing method, device and system for test cases
CN116304399B (en) * 2023-05-19 2023-08-11 建信金融科技有限责任公司 Visual processing method, device and system for test cases

Also Published As

Publication number Publication date
CN112256558B (en) 2023-03-17
CN112256558A (en) 2021-01-22

Similar Documents

Publication Publication Date Title
CA3131079A1 (en) Test case generation method and device, computer equipment and storage medium
CN107370786B (en) General information management system based on micro-service architecture
EP3152650B1 (en) High-speed application for installation on mobile devices for permitting remote configuration of such mobile devices
US9836297B2 (en) Computer implemented method and system for automatically deploying and versioning scripts in a computing environment
CN109308285A (en) Database script management method, device, computer equipment and storage medium
US20050262501A1 (en) Software distribution method and system supporting configuration management
CN105324750A (en) Development-environment system, development-environment device, and development-environment provision method and program
US7895332B2 (en) Identity migration system apparatus and method
CN109933521A (en) Automated testing method, device, computer equipment and storage medium based on BDD
CN111414391A (en) Method and system for accessing multiple data sources
CN112433944A (en) Service testing method, device, computer equipment and storage medium
CN111737227A (en) Data modification method and system
CN110727575A (en) Information processing method, system, device and storage medium
CN112506579B (en) Multi-service multi-environment management method and system
CN114443039A (en) Input parameter verification method and device, electronic equipment and storage medium
CN110806891B (en) Method and device for generating software version of embedded device
CN112561690A (en) Method, system, equipment and storage medium for testing credit card staging service interface
CN112651716A (en) Data processing method, device and storage medium
CN112905437A (en) Method and device for testing case and storage medium
CN111090638A (en) Method and device for comparing transaction functions in database migration
CN112948480B (en) Data extraction method, device, electronic equipment and storage medium
CN113052463B (en) Workflow verification method, workflow verification device, computer equipment and storage medium
JP2671345B2 (en) Computer system product management support device and support method
US20240176796A1 (en) Bypassing database automations
CN118035072A (en) Automatic acceptance method and system based on multi-version upgrading

Legal Events

Date Code Title Description
EEER Examination request

Effective date: 20220916

EEER Examination request

Effective date: 20220916

EEER Examination request

Effective date: 20220916

EEER Examination request

Effective date: 20220916