[go: up one dir, main page]

CN114328201B - A test case generation method and device, electronic device and storage medium - Google Patents

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

Info

Publication number
CN114328201B
CN114328201B CN202111572818.7A CN202111572818A CN114328201B CN 114328201 B CN114328201 B CN 114328201B CN 202111572818 A CN202111572818 A CN 202111572818A CN 114328201 B CN114328201 B CN 114328201B
Authority
CN
China
Prior art keywords
test case
module
dependent
atomic
configuration
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
CN202111572818.7A
Other languages
Chinese (zh)
Other versions
CN114328201A (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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology 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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202111572818.7A priority Critical patent/CN114328201B/en
Publication of CN114328201A publication Critical patent/CN114328201A/en
Application granted granted Critical
Publication of CN114328201B publication Critical patent/CN114328201B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

本公开提供一种测试用例生成方法及装置、电子设备和存储介质。其中,所述方法包括,确定目标业务系统,并确定组成目标业务系统的原子模块,基于原子模块,生成第一配置集;其中,第一配置集包含多个第一取值组合;将具有依赖关系的原子模块对应的第一取值组合分别输入至测试用例模型集,生成目标业务系统对应的目标测试用例集。本公开提供的测试用例生成方法,通过将具有依赖关系的原子模块对应的第一取值组合分别输入至测试用例模型集,自动生成目标测试用例集,避免了通过手动编写测试用例时可能出现的问题,以及因利用常规的测试用例生成技术生成的测试用例仅适用于特定编程语言和/或特定业务系统的情况发生,提高了其通用性。

The present disclosure provides a test case generation method and device, an electronic device and a storage medium. The method includes determining a target business system and determining the atomic modules constituting the target business system, and generating a first configuration set based on the atomic modules; wherein the first configuration set includes multiple first value combinations; the first value combinations corresponding to the atomic modules with dependencies are respectively input into the test case model set to generate a target test case set corresponding to the target business system. The test case generation method provided by the present disclosure automatically generates a target test case set by inputting the first value combinations corresponding to the atomic modules with dependencies into the test case model set, thereby avoiding problems that may occur when manually writing test cases, and the situation where the test cases generated by conventional test case generation techniques are only applicable to specific programming languages and/or specific business systems, thereby improving its versatility.

Description

Test case generation method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of software testing, and in particular relates to a test case generation method and device, electronic equipment and a storage medium.
Background
Testing is a critical loop in the application software project cycle. Verification of the quality and functionality of an application is typically accomplished by testing the application when it is online or delivered. The method for testing the application software comprises the steps of determining test requirements according to the application software, generating test cases according to the test requirements, executing the generated test cases, analyzing execution results of the test cases after the test cases are executed, and finally determining whether the tested application software has online or delivered conditions according to the obtained execution results.
The method for testing the application software has the defects that when the method is used for testing the application software, the function or the requirement coverage is insufficient easily caused by manually writing the test case, and the universality is poor caused by that the generated test case is only suitable for a specific programming language and/or a specific service system.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the disclosure provides a test case generation method and device, electronic equipment and storage medium.
The present disclosure provides a test case generation method, including:
Determining a target service system, determining an atomic module forming the target service system, and generating a first configuration set based on the atomic module, wherein the first configuration set comprises a plurality of first value combinations;
respectively inputting the first value combination corresponding to the atomic module with the dependency relationship into a test case model set to generate a target test case set corresponding to the target service system;
The test case model set comprises a plurality of test case models, the test case models correspond to the atomic modules, the test case models are obtained through training according to second value combinations contained in a second configuration set, the second configuration set comprises a plurality of second value combinations, and the second configuration set is generated by a functional factor module obtained based on the atomic modules.
According to the test case generation method provided by the disclosure, the generating a first configuration set based on the atomic module includes:
Acquiring a first configuration item of the atomic module, and acquiring basic value data of the first configuration item;
And processing the basic value data based on a preset combination test tool to generate the first configuration set containing a plurality of first value combinations.
According to the test case generation method provided by the disclosure, the functional factor module is generated by the following method:
Determining dependent atomic modules and dependent atomic modules in the atomic modules with the dependency relationship;
Determining a dependent configuration item corresponding to the dependent atomic module in the first configuration item, and acquiring a function execution result obtained by executing the dependent atomic module;
And adding the dependency configuration item corresponding to the dependency atomic module and the function execution result to the dependency atomic module to obtain the function factor module.
According to the test case generating method provided by the present disclosure, the generating the second configuration set includes:
acquiring a second configuration item of the functional factor module, and acquiring target value data of the second configuration item;
And processing the target value data based on the preset combination test tool to generate the second configuration set containing a plurality of second value combinations.
According to the test case generating method provided by the present disclosure, the first value combinations corresponding to the atomic modules with the dependency relationships are respectively input into a test case model set, and a target test case set corresponding to the target service system is generated, including:
Determining a dependent configuration item corresponding to the dependent atomic module in the first configuration item, adding the dependent configuration item to the first value combination corresponding to the dependent atomic module, inputting the obtained data result to the test case model corresponding to the dependent atomic module, and generating a service execution result;
and respectively inputting the service execution result, the first value combination corresponding to the dependent atomic module and the dependent configuration item corresponding to the dependent atomic module into the test case model corresponding to the dependent atomic module to generate the target test case set corresponding to the target service system.
The present disclosure also provides a test case generating device, including:
the system comprises a determining unit, a determining unit and a processing unit, wherein the determining unit is used for determining a target service system, determining an atomic module forming the target service system and generating a first configuration set based on the atomic module, wherein the first configuration set comprises a plurality of first value combinations;
The generation unit is used for respectively inputting the first value combinations corresponding to the atomic modules with the dependency relationship into a test case model set to generate a target test case set corresponding to the target service system;
The test case model set comprises a plurality of test case models, the test case models correspond to the atomic modules, the test case models are obtained through training according to second value combinations contained in a second configuration set, the second configuration set comprises a plurality of second value combinations, and the second configuration set is generated by a functional factor module obtained based on the atomic modules.
According to the test case generating device provided by the present disclosure, the determining unit includes:
The acquisition subunit is used for acquiring a first configuration item of the atomic module and acquiring basic value data of the first configuration item;
The generating subunit is configured to process the basic value data based on a preset combination testing tool, and generate the first configuration set that includes a plurality of first value combinations.
The device for generating the test case further comprises a functional factor module generating unit, a testing module generating unit and a testing module generating unit, wherein the functional factor module generating unit is used for:
Determining dependent atomic modules and dependent atomic modules in the atomic modules with the dependency relationship;
Determining a dependent configuration item corresponding to the dependent atomic module in the first configuration item, and acquiring a function execution result obtained by executing the dependent atomic module;
And adding the dependency configuration item corresponding to the dependency atomic module and the function execution result to the dependency atomic module to obtain the function factor module.
The test case generating device provided by the disclosure further comprises a second configuration set generating unit, a first configuration set generating unit and a second configuration set generating unit, wherein the second configuration set generating unit is used for:
acquiring a second configuration item of the functional factor module, and acquiring target value data of the second configuration item;
And processing the target value data based on the preset combination test tool to generate the second configuration set containing a plurality of second value combinations.
According to the test case generating device provided by the present disclosure, the generating unit includes:
A determining subunit, configured to determine a dependent configuration item corresponding to the dependent atomic module in the first configuration item, add the dependent configuration item to the first value combination corresponding to the dependent atomic module, input the obtained data result to the test case model corresponding to the dependent atomic module, and generate a service execution result;
And the generation subunit is used for respectively inputting the service execution result, the first value combination corresponding to the dependent atomic module and the dependent configuration item corresponding to the dependent atomic module into the test case model corresponding to the dependent atomic module to generate the target test case set corresponding to the target service system.
The present disclosure also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the test case generating method as described in any one of the above when the program is executed.
The present disclosure also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the test case generating method as described in any of the above.
The test case generation method, the device, the electronic equipment and the storage medium provided by the disclosure are used for generating the first configuration set by determining the target service system and determining the atomic modules forming the target service system and generating the first configuration set based on the atomic modules, wherein the first configuration set comprises a plurality of first value combinations, the first value combinations corresponding to the atomic modules with the dependency relationship are respectively input into the test case model set, the target test case set corresponding to the target service system is automatically generated, the problem which can occur when the test case is written manually is avoided, and the test case generated by utilizing the conventional test case generation technology is only suitable for the condition of a specific programming language and/or a specific service system, so that the universality is improved.
Drawings
In order to more clearly illustrate the present disclosure or the prior art solutions, a brief description will be given below of the drawings that are needed in the embodiments or prior art descriptions, it being apparent that the drawings in the following description are some embodiments of the present disclosure and that other drawings may be obtained from these drawings without inventive effort to a person of ordinary skill in the art.
FIG. 1 is a flow chart of a test case generation method provided by an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart of training a test case model in the test case generation method provided by the embodiment of the present disclosure;
FIG. 3 is a schematic flow chart of generating a first configuration set in the test case generating method provided by the embodiment of the present disclosure;
FIG. 4 is a schematic flow chart of a functional factor module obtained in the test case generating method provided in the embodiment of the present disclosure;
FIG. 5 is an exemplary diagram of a functional factor module obtained in a test case generation method provided by an embodiment of the present disclosure;
FIG. 6 is a schematic flow chart of generating a second configuration set in the test case generating method provided by the embodiment of the present disclosure;
FIG. 7 is an application example diagram of an atomic module in a test case generation method provided by an embodiment of the present disclosure;
FIG. 8 is a schematic flow chart of generating a target test case set in the test case generating method provided by the embodiment of the present disclosure;
FIG. 9 is an exemplary diagram of generating a target test case set in the test case generation method provided by the embodiments of the present disclosure;
FIG. 10 is a schematic structural diagram of a test case generating device provided by an embodiment of the present disclosure;
fig. 11 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are some embodiments, but not all embodiments of the present disclosure. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the disclosed embodiments, are within the scope of the disclosed embodiments.
The figures are merely examples and are not drawn to scale. As used herein, the term "preferred" and similar terms are used as a table approximation, not as a table degree, and are intended to illustrate inherent deviations in measured or calculated values that would be recognized by one of ordinary skill in the art. It should be noted that in this specification, the expressions "first", "second", "third", etc. are used only to distinguish one feature from another feature, and do not denote any limitation of the features, particularly do not denote any order of precedence.
It will be further understood that terms such as "comprises," "comprising," "includes," "including," and/or "having," are intended to be inclusive and not to open ended as defined in the specification, and to exclude the presence of other features, elements, components, and/or groups thereof. Furthermore, when describing embodiments of the application, use of "may" means "one or more embodiments of the application. Also, the term "exemplary" is intended to refer to an example or illustration.
Unless otherwise defined, all terms (including engineering and technical terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application pertains. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
In order to solve the problems in the prior art, embodiments of the present disclosure provide a test case generating method and apparatus, an electronic device, and a storage medium.
First, terms related to one or more embodiments of the present disclosure will be explained.
The target service system is a service system with multiple dependencies and multiple functions of the included configuration items.
The atomic module refers to a minimum functional unit which is obtained by splitting the target service system, has a plurality of functions independent of each other and contains limited discrete configuration items.
The combined test is a method for generating test cases, which abstracts the tested application into a system influenced by a plurality of factors, wherein the value of each factor is discrete and limited.
The preset combined test tool is PICT (PAIRWISE INDEPENDENT Combinatorial Testing tool, tool for automatically generating test cases).
FIG. 1 is a flow diagram of a test case generation method provided in accordance with one embodiment of the present disclosure. As shown in fig. 1, the method includes:
Step 101, determining a target service system, determining an atomic module forming the target service system, and generating a first configuration set based on the atomic module.
The first configuration set comprises a plurality of first value combinations.
Specifically, determining the atomic modules that make up the target business system refers to splitting the target business system to obtain atomic modules that make up multiple functions of the target business system that are independent of each other and that contain a limited number of discrete configuration items.
Correspondingly, the first configuration set refers to a data set obtained by processing values in at least one configuration item contained in an atomic module forming the target service system.
Step 102, inputting the first value combinations corresponding to the atomic modules with the dependency relationships to the test case model sets respectively, and generating target test case sets corresponding to the target service systems.
The test case model set comprises a plurality of test case models, the test case models correspond to the atomic modules, the test case models are obtained through training according to second value combinations contained in a second configuration set, the second configuration set comprises a plurality of second value combinations, and the second configuration set is generated by a functional factor module obtained based on the atomic modules.
Specifically, the atomic modules having a dependency relationship refer to at least two atomic modules having a dependency relationship among atomic modules constituting the target business system.
The target test case set corresponding to the target service system refers to a set of all target test cases for testing the target service system.
Further, the second configuration set refers to a data set obtained by processing values in at least one configuration item contained in the function factor module obtained based on the atomic module.
Based on the above embodiment, the test case generating method provided by the invention automatically generates the target test case set by respectively inputting the first value combinations corresponding to the atomic modules with the dependency relationships into the test case model set, so that the problem possibly occurring when the test case is manually written is avoided, and the universality is improved because the test case generated by utilizing the conventional test case generating technology is only suitable for the condition of specific programming language and/or specific service system.
Preferably, based on the above embodiments, the training generation test case model is described.
Based on the above embodiments, fig. 2 is a schematic flow chart of training a test case model in the test case generating method according to one embodiment of the present disclosure. As shown in fig. 2, the process of training the test case model includes:
specifically, as shown in fig. 2, the functional factor modules 1,2, 3..n (n is a positive integer) are respectively obtained based on the atomic modules 1,2, 3..n.
Further, the values of at least one configuration item correspondingly contained in the functional factor modules 1,2 and 3..n (n is a positive integer) are processed, and a second configuration set 1,2 and 3..n (n is a positive integer) is correspondingly obtained respectively. Wherein the second configuration sets 1,2, 3..n (n is a positive integer) each correspondingly comprise a plurality of second value combinations.
Further, training the machine learning model by using a plurality of second value combinations which are respectively and correspondingly contained in the second configuration sets 1,2 and 3..n (n is a positive integer), and respectively and correspondingly obtaining test case models 1,2 and 3..n (n is a positive integer).
Further, a test case model set is constituted by n (n is a positive integer) test case models.
Based on the above embodiments, fig. 3 is a schematic flow chart of generating a first configuration set in the test case generating method according to one embodiment of the present disclosure. As shown in fig. 3, the process of generating the first configuration set includes:
step 301, obtaining a first configuration item of an atomic module, and obtaining basic value data of the first configuration item.
Specifically, the first configuration item refers to a parameter item which is independent and discrete and contains a plurality of values in the atomic module.
Correspondingly, the basic value data refer to all the value data which are contained in the first configuration item and can be enumerated.
Step 302, based on a preset combination test tool, the basic value data is processed to generate a first configuration set including a plurality of first value combinations.
The basic value data a, b and c, the basic value data d, e and f and the basic value data g and h are processed by PICT, so that first value combinations a, d and g, first value combinations c, e and g, first value combinations b, d and h, first value combinations a, e and h and the like can be obtained, and further, the first configuration set is formed by the first value combinations a, d and g, the first value combinations c, e and g, the first value combinations b, d and h, the first value combinations a, e and h and the like.
Based on the above embodiment, a plurality of first value combinations contained in the first configuration set are input to the test case model set one by one, so that a target test case set corresponding to the target service system can be automatically generated.
Based on the above embodiments, fig. 4 is a schematic flow chart of a functional factor module obtained in the test case generating method according to one embodiment of the present disclosure. As shown in fig. 4, the process of obtaining the functional factor module includes:
in step 401, dependent atomic modules and dependent atomic modules in the atomic modules with the dependency relationship are determined.
Illustratively, if an atomic module includes an atomic module a and an atomic module B, and the atomic module a depends on the atomic module B, then the atomic module a belongs to the dependent atomic module and the atomic module B belongs to the dependent atomic module.
Step 402, determining a dependency configuration item corresponding to the dependency atomic module in the first configuration item, and obtaining a function execution result obtained by executing the dependency atomic module.
Specifically, the dependent configuration items refer to one or more of the first configuration items corresponding to the dependent atomic modules, which the dependent atomic modules depend on.
For example, if the first configuration item corresponding to the dependent atomic module includes a first configuration item a, a first configuration item B, a first configuration item C, and a first configuration item D, and the dependent atomic module depends on the first configuration item a, the first configuration item a is a dependent configuration item of the dependent atomic module.
The function execution result is an execution result obtained after compiling and executing the dependent atomic module.
And step 403, adding the dependency configuration item and the function execution result corresponding to the dependency atomic module to obtain the function factor module.
Based on the above embodiment, by generating the functional factor module, all configurable paths that depend on the atomic module can be summarized.
The flow of obtaining the functional factor module may be described preferably in connection with a specific application example.
Based on the above embodiments, fig. 5 is an exemplary diagram of a functional factor module obtained in a test case generating method according to an embodiment of the present disclosure. As shown in fig. 5, examples of resulting functional factor modules include:
specifically, as shown in fig. 5, a target service system is determined, and the target service system is split to obtain an atomic module 1, an atomic module 2, and an atomic module 3, which are independent of each other in function constituting the target service system.
Correspondingly, among the atomic modules constituting the target business system, the atomic modules determined to have the dependency relationship are the dependent atomic module 1 and the dependent atomic module 2.
Further, the first configuration items of the relied atomic module 1 include a first configuration item a, a first configuration item B, and the like. The first configuration items of the dependent atomic module 2 include a first configuration item 1, a first configuration item 2, and the like.
Further, if the dependent configuration item of the dependent atomic module 2 is the first configuration item a, and after compiling the dependent atomic module 1, an execution result of the dependent atomic module 1 is obtained.
Further, the execution result of the first configuration item a and the dependent atomic module 1 is added to the dependent atomic module 2, and then the first configuration item a, the execution result of the dependent atomic module 1, the first configuration item 1 and the first configuration item 2 included in the dependent atomic module 2 are combined to form the functional factor module 2 corresponding to the dependent atomic module 2.
Based on the above embodiments, fig. 6 is a schematic flow chart of generating a second configuration set in the test case generating method according to one embodiment of the present disclosure. As shown in fig. 6, the process of generating the second configuration set includes:
Step 601, obtaining a second configuration item of the functional factor module, and obtaining target value data of the second configuration item.
Specifically, the second configuration item refers to a plurality of independent and discrete parameter items containing multiple values in the functional factor module.
Correspondingly, the target value data refers to all the enumerated value data contained in the second configuration item.
Step 602, based on a preset combination test tool, processes the target value data to generate a second configuration set including a plurality of second value combinations.
For example, if the target value data includes i, j and k, l, m and n, o and p, the target value data i, j and k, the target value data l, m and n, and the target value data o and p are processed by using the PICT, so as to obtain second value combinations i, l and o, second value combinations k, m and o, second value combinations j, l and p, second value combinations j, m and p, and the like, and further, the second configuration set is formed by the second value combinations i, l and o, the second value combinations k, m and o, the second value combinations j, l and p, the second value combinations j, m and p, and the like.
Based on the embodiment, the test case model can be trained and generated by utilizing the second value combination contained in the generated second configuration set, and meanwhile, the training precision of the test case model is improved.
Preferably, a specific application of the atomic module may be described in connection with the above embodiments.
Based on the above embodiments, fig. 7 is an application example diagram of an atomic module in a test case generating method provided according to one embodiment of the present disclosure. As shown in fig. 7, the process of generating the second configuration set includes:
Specifically, as shown in fig. 7, an atomic module i (i is a positive integer) is one of all atomic modules that constitute the target business system. The atomic module i includes a first configuration item 1, a first configuration item 2.
Correspondingly, all first configuration items of the atomic module i are acquired, basic value data of all the first configuration items are acquired, the acquired basic value data are processed based on PICT, and a first configuration set is generated, wherein the first configuration set comprises a first value combination 1, a first value combination 2 and the like.
Further, determining a dependent configuration item of the atomic module i and a dependent module on which the dependent configuration item is dependent, and acquiring a function execution result obtained by executing the dependent atomic module. And adding the dependent configuration item and the function execution result of the dependent atomic module to the atomic module i to obtain a function factor module i. And the functional factor module i comprises a second configuration item 1, a second configuration item 2. Depending on the configuration item and the result of the execution of the function by the dependent atomic module. It should be noted that, the dependent configuration item and the function execution result of the dependent atomic module also belong to the second configuration item.
Correspondingly, all second configuration items of the functional factor module i are acquired, target value data of all the second configuration items are acquired, the acquired target value data are processed based on PICT, and a second configuration set is generated, wherein the second configuration set comprises a second value combination 1, a second value combination 2 and the like.
Further, training machine learning models by using a second value combination 1, a second value combination 2 and the like contained in the second configuration set, and correspondingly obtaining a test case model i.
Based on the above embodiments, fig. 8 is a flowchart illustrating the generation of a target test case set in the test case generation method according to one embodiment of the present disclosure. As shown in fig. 8, the process of generating the target test case set includes:
Step 801, determining a dependent configuration item corresponding to the dependent atomic module in the first configuration items, adding the dependent configuration item to a first value combination corresponding to the dependent atomic module, inputting the obtained data result to a test case model corresponding to the dependent atomic module, and generating a service execution result.
Step 802, respectively inputting a service execution result, a first value combination corresponding to the dependent atomic module and a dependent configuration item corresponding to the dependent atomic module into a test case model corresponding to the dependent atomic module, and generating a target test case set corresponding to the target service system.
Based on the above embodiment, the target test case set is automatically generated by respectively inputting the service execution result, the first value combination corresponding to the dependent atomic module and the dependent configuration item corresponding to the dependent atomic module into the test case model corresponding to the dependent atomic module, so that the problem which may occur when the test case is manually written is avoided, and the universality is improved because the test case generated by using the conventional test case generation technology is only applicable to the condition of a specific programming language and/or a specific service system.
Preferably, the flow of generating the target test case set may be described in connection with a specific application instance.
Based on the above embodiments, fig. 9 is an exemplary diagram of generating a target test case set in the test case generating method provided according to one embodiment of the present disclosure. As shown in fig. 9, an example of generating a target test case set includes:
specifically, as shown in fig. 9, an atom module i and an atom module j in the target service system have a dependency relationship, and the atom module j is a dependent atom module, and the dependent atom module on which the atom module j depends is the atom module i.
Correspondingly, determining a dependent configuration item corresponding to the atomic module i in the first configuration items, adding the dependent configuration item to a first value combination in the first configuration set corresponding to the atomic module i, inputting the obtained data result to a test case model i corresponding to the atomic module i, and generating a service execution result.
Further, a service execution result output by the test case model i, a first value combination in a first configuration set corresponding to the atomic module j and a dependency configuration item corresponding to the atomic module j are respectively input into the test case model j corresponding to the atomic module j, and a target test case set corresponding to the target service system is generated.
Based on the above embodiments, fig. 10 is a schematic structural diagram of a test case generating device provided according to one embodiment of the present disclosure. As shown in fig. 10, the test case generating apparatus includes a determining unit 1010 and a generating unit 1020.
And a determining unit 1010, configured to determine a target service system, determine atomic modules that form the target service system, and generate a first configuration set based on the atomic modules, where the first configuration set includes a plurality of first value combinations.
The determining unit 1010 includes an acquiring subunit and a generating subunit.
The acquisition subunit is used for acquiring the first configuration item of the atomic module and acquiring basic value data of the first configuration item.
The generating subunit is used for processing the basic value data based on a preset combination testing tool to generate a first configuration set containing a plurality of first value combinations.
The generating unit 1020 is configured to input the first value combinations corresponding to the atomic modules with the dependency relationships to the test case model sets respectively, and generate target test case sets corresponding to the target service systems;
the test case model set comprises a plurality of test case models, the test case models correspond to the atomic modules, the test case models are obtained through training according to second value combinations contained in a second configuration set, the second configuration set comprises a plurality of second value combinations, and the second configuration set is generated by a functional factor module obtained based on the atomic modules.
Optionally, the device further comprises a functional factor module generating unit, a function factor module generating unit and a function factor module generating unit, wherein the functional factor module generating unit is used for determining dependent atomic modules and dependent atomic modules in the atomic modules with the dependency relationship;
Determining a dependency configuration item corresponding to the dependency atomic module in the first configuration item, and acquiring a function execution result obtained by executing the dependency atomic module;
and adding the dependency configuration item and the function execution result corresponding to the dependency atomic module to obtain the function factor module.
Optionally, the device also comprises a second configuration set generating unit, a first configuration set generating unit and a second configuration set generating unit, wherein the second configuration set generating unit is used for acquiring a second configuration item of the functional factor module and acquiring target value data of the second configuration item;
And processing the target value data based on a preset combination test tool to generate a second configuration set containing a plurality of second value combinations.
Optionally, the generating unit 1020 includes a determining subunit and a generating subunit.
The determining subunit is configured to determine a dependent configuration item corresponding to the dependent atomic module in the first configuration item, add the dependent configuration item to the first value combination corresponding to the dependent atomic module, input the obtained data result to the test case model corresponding to the dependent atomic module, and generate a service execution result.
The generation subunit is used for respectively inputting the service execution result, the first value combination corresponding to the dependent atomic module and the dependent configuration item corresponding to the dependent atomic module into the test case model corresponding to the dependent atomic module to generate a target test case set corresponding to the target service system.
Based on the above embodiment, the test case generating device provided by the invention automatically generates the target test case set by respectively inputting the first value combinations corresponding to the atomic modules with the dependency relationships into the test case model set, so that the problem possibly occurring when the test case is manually written is avoided, and the universality is improved because the test case generated by utilizing the conventional test case generating technology is only suitable for the condition of a specific programming language and/or a specific service system.
Fig. 11 is a schematic diagram of a hardware structure of an electronic device provided according to an embodiment of the present disclosure. As shown in FIG. 11, the electronic device may include a processor 1110, a communication interface Communications Interface, a memory 1130, and a communication bus 1140, where the processor 1110, the communication interface 1120, and the memory 1130 communicate with each other via the communication bus 1140. The processor 1110 can call logic instructions in the memory 1130 to execute the provided test case generation method, and the method includes determining a target service system, determining atom modules forming the target service system, generating a first configuration set based on the atom modules, wherein the first configuration set includes a plurality of first value combinations, inputting the first value combinations corresponding to the atom modules with dependency relationships to a test case model set respectively to generate a target test case set corresponding to the target service system, wherein the test case model set includes a plurality of test case models, the test case models correspond to the atom modules mutually, the test case models are obtained by training according to second value combinations included in a second configuration set, the second configuration set includes a plurality of second value combinations, and the second configuration set is generated by a functional factor module obtained based on the atom modules.
Further, the logic instructions in the memory 1130 described above may be implemented in the form of software functional units and sold or used as a stand-alone product, stored on a computer-readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present disclosure may be essentially or, what contributes to the prior art, or part of the technical solutions, may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present disclosure. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes.
In another aspect, the disclosure further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer being capable of executing the test case generation method provided by the above embodiments, the method comprising determining a target business system, determining atomic modules constituting the target business system, and generating a first configuration set based on the atomic modules, wherein the first configuration set comprises a plurality of first value combinations, inputting the first value combinations corresponding to the atomic modules having a dependency relationship to test case model sets respectively, generating a target test case set corresponding to the target business system, wherein the test case model sets comprise a plurality of test case models, the test case models and the atomic modules mutually correspond, the test case models are obtained by training according to a second value combination contained in a second configuration set, the second configuration set comprises a plurality of the second value combinations, and the test case models are obtained by training the atomic modules.
In still another aspect, the disclosure further provides a non-transitory computer readable storage medium, on which a computer program is stored, the computer program being implemented when executed by a processor to perform the test case generation method provided in the foregoing embodiments, where the method includes determining a target service system, determining an atomic module that composes the target service system, and generating a first configuration set based on the atomic module, where the first configuration set includes a plurality of first value combinations, inputting the first value combinations corresponding to the atomic module that has a dependency relationship into a test case model set, respectively, to generate a target test case set corresponding to the target service system, where the test case model set includes a plurality of test case models, the test case models and the atomic module correspond to each other, and the test case model is obtained by training according to a second value combination included in a second configuration set, the second configuration set includes a plurality of second value combinations, and the second configuration set is obtained by training a function module based on the atomic factor generation module.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that the foregoing embodiments are merely illustrative of the technical solutions of the present disclosure, and not limiting thereof, and although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that modifications may be made to the technical solutions described in the foregoing embodiments or equivalents may be substituted for some of the technical features thereof, and these modifications or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present disclosure in essence.

Claims (10)

1. A test case generation method, comprising:
Determining a target service system, determining an atomic module forming the target service system, and generating a first configuration set based on the atomic module, wherein the first configuration set comprises a plurality of first value combinations;
The first value combination corresponding to the atomic module with the dependency relationship is respectively input into a test case model set to generate a target test case set corresponding to the target service system, wherein the target test case set is generated by respectively inputting a service execution result of the dependent atomic module, the first value combination corresponding to the dependent atomic module and a dependent configuration item corresponding to the dependent atomic module into the test case model corresponding to the dependent atomic module;
The test case model set comprises a plurality of test case models, the test case models correspond to the atom modules, the test case models are obtained by training according to a second value combination contained in a second configuration set, the second configuration set contains a plurality of second value combinations, and the second configuration set is generated by a second configuration item of a functional factor module obtained based on the atom modules;
the generating, based on the atomic module, a first configuration set includes:
Acquiring a first configuration item of the atomic module, and acquiring basic value data of the first configuration item;
And processing the basic value data based on a preset combination test tool to generate the first configuration set containing a plurality of first value combinations.
2. The test case generation method according to claim 1, wherein the functional factor module is generated by:
Determining dependent atomic modules and dependent atomic modules in the atomic modules with the dependency relationship;
Determining a dependent configuration item corresponding to the dependent atomic module in the first configuration item, and acquiring a function execution result obtained by executing the dependent atomic module;
And adding the dependency configuration item corresponding to the dependency atomic module and the function execution result to the dependency atomic module to obtain the function factor module.
3. The test case generating method according to claim 2, wherein the generating method of the second configuration set includes:
acquiring a second configuration item of the functional factor module, and acquiring target value data of the second configuration item;
And processing the target value data based on the preset combination test tool to generate the second configuration set containing a plurality of second value combinations.
4. The test case generating method according to claim 2, wherein the step of inputting the first value combinations corresponding to the atomic modules having the dependency relationships to test case model sets to generate target test case sets corresponding to the target service systems includes:
Determining a dependent configuration item corresponding to the dependent atomic module in the first configuration item, adding the dependent configuration item to the first value combination corresponding to the dependent atomic module, inputting the obtained data result to the test case model corresponding to the dependent atomic module, and generating a service execution result;
and respectively inputting the service execution result, the first value combination corresponding to the dependent atomic module and the dependent configuration item corresponding to the dependent atomic module into the test case model corresponding to the dependent atomic module to generate the target test case set corresponding to the target service system.
5. A test case generating apparatus, comprising:
the system comprises a determining unit, a determining unit and a processing unit, wherein the determining unit is used for determining a target service system, determining an atomic module forming the target service system and generating a first configuration set based on the atomic module, wherein the first configuration set comprises a plurality of first value combinations;
The generation unit is used for respectively inputting the first value combination corresponding to the atomic module with the dependency relationship into a test case model set to generate a target test case set corresponding to the target service system, wherein the target test case set is generated by respectively inputting a service execution result of the dependent atomic module, the first value combination corresponding to the dependent atomic module and a dependent configuration item corresponding to the dependent atomic module into the test case model corresponding to the dependent atomic module;
The test case model set comprises a plurality of test case models, the test case models correspond to the atom modules, the test case models are obtained by training according to a second value combination contained in a second configuration set, the second configuration set contains a plurality of second value combinations, and the second configuration set is generated by a second configuration item of a functional factor module obtained based on the atom modules;
the determination unit includes:
The acquisition subunit is used for acquiring a first configuration item of the atomic module and acquiring basic value data of the first configuration item;
The generating subunit is configured to process the basic value data based on a preset combination testing tool, and generate the first configuration set that includes a plurality of first value combinations.
6. The test case generating device according to claim 5, further comprising a functional factor module generating unit configured to:
Determining dependent atomic modules and dependent atomic modules in the atomic modules with the dependency relationship;
Determining a dependent configuration item corresponding to the dependent atomic module in the first configuration item, and acquiring a function execution result obtained by executing the dependent atomic module;
And adding the dependency configuration item corresponding to the dependency atomic module and the function execution result to the dependency atomic module to obtain the function factor module.
7. The test case generating apparatus according to claim 6, further comprising a second configuration set generating unit configured to:
acquiring a second configuration item of the functional factor module, and acquiring target value data of the second configuration item;
And processing the target value data based on the preset combination test tool to generate the second configuration set containing a plurality of second value combinations.
8. The test case generating device according to claim 6, wherein the generating unit includes:
A determining subunit, configured to determine a dependent configuration item corresponding to the dependent atomic module in the first configuration item, add the dependent configuration item to the first value combination corresponding to the dependent atomic module, input the obtained data result to the test case model corresponding to the dependent atomic module, and generate a service execution result;
And the generation subunit is used for respectively inputting the service execution result, the first value combination corresponding to the dependent atomic module and the dependent configuration item corresponding to the dependent atomic module into the test case model corresponding to the dependent atomic module to generate the target test case set corresponding to the target service system.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the test case generating method according to any one of claims 1 to 4 when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the steps of the test case generating method according to any of claims 1 to 4.
CN202111572818.7A 2021-12-21 2021-12-21 A test case generation method and device, electronic device and storage medium Active CN114328201B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111572818.7A CN114328201B (en) 2021-12-21 2021-12-21 A test case generation method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111572818.7A CN114328201B (en) 2021-12-21 2021-12-21 A test case generation method and device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN114328201A CN114328201A (en) 2022-04-12
CN114328201B true CN114328201B (en) 2025-06-17

Family

ID=81053939

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111572818.7A Active CN114328201B (en) 2021-12-21 2021-12-21 A test case generation method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114328201B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116049009A (en) * 2023-01-29 2023-05-02 深圳思谋信息科技有限公司 Test method, device, computer equipment and computer-readable storage medium
CN118838851B (en) * 2024-09-24 2025-02-07 上海孤波科技有限公司 A test case generation method, device, electronic device and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109902002A (en) * 2019-02-14 2019-06-18 浙江口碑网络技术有限公司 Generation method and device, storage medium, the computer equipment of combined test use-case

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4580670B2 (en) * 2004-03-29 2010-11-17 株式会社日本総合研究所 Test case generation method and test case generation apparatus
US9734044B2 (en) * 2014-03-05 2017-08-15 International Business Machines Corporation Automatic test case generation
CN111611152B (en) * 2019-02-25 2023-08-04 北京嘀嘀无限科技发展有限公司 Test case generation method and device, electronic equipment and readable storage medium
CN113778849B (en) * 2021-03-15 2025-07-18 北京沃东天骏信息技术有限公司 Method, apparatus, device and storage medium for testing code

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109902002A (en) * 2019-02-14 2019-06-18 浙江口碑网络技术有限公司 Generation method and device, storage medium, the computer equipment of combined test use-case

Also Published As

Publication number Publication date
CN114328201A (en) 2022-04-12

Similar Documents

Publication Publication Date Title
US9465724B2 (en) Method, program, and system for generating test cases
US11327874B1 (en) System, method, and computer program for orchestrating automatic software testing
CN113886262B (en) Software automated testing method, device, computer equipment and storage medium
CN114328201B (en) A test case generation method and device, electronic device and storage medium
US11580012B2 (en) Smart test case generator
CN114048129B (en) Automated testing method, device, equipment and system for software function changes
CN107608902A (en) Routine interface method of testing and device
CN111679979A (en) Destructive testing method and device
WO2022122174A1 (en) Methods and apparatuses for troubleshooting a computer system
CN115757097A (en) Test case generation method and device, electronic equipment and storage medium
WO2021183382A1 (en) Graph-based method for inductive bug localization
CN117609063A (en) API use case generation method, device, electronic equipment, storage medium and product
CN112363933A (en) Automatic verification method and device for word paragraph table, computer equipment and storage medium
CN112540925B (en) New feature compatibility detection system and method, electronic device and readable storage medium
CN112749084A (en) Test case generation method and device
CN115098140A (en) Model updating method and related device
RU2830052C1 (en) Method and system for automated application release management
CN119441062B (en) Test case generation method and system based on large language model
CN110321280B (en) Data processing method and related equipment
CN110765020A (en) Test case generation method based on domain knowledge
CN115630309B (en) Virtual object matching method, virtual object matching device, and storage medium
CN110633204A (en) A program defect detection method and device
CN115757123B (en) Test case generation method, device, equipment and medium
CN118051439A (en) API automatic test case generation method and device, electronic equipment and readable medium
CN117785158A (en) Knowledge distillation method and device based on large model

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