CN117762781A - Determination method and device for test cases, electronic equipment and storage medium - Google Patents

Determination method and device for test cases, electronic equipment and storage medium Download PDF

Info

Publication number
CN117762781A
CN117762781A CN202311610540.7A CN202311610540A CN117762781A CN 117762781 A CN117762781 A CN 117762781A CN 202311610540 A CN202311610540 A CN 202311610540A CN 117762781 A CN117762781 A CN 117762781A
Authority
CN
China
Prior art keywords
test
test case
determining
coverage
input parameter
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
CN202311610540.7A
Other languages
Chinese (zh)
Inventor
朱祁恒
杨杰荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202311610540.7A priority Critical patent/CN117762781A/en
Publication of CN117762781A publication Critical patent/CN117762781A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for determining a test case, electronic equipment and a storage medium, and relates to the technical field of testing, wherein the method comprises the following steps: determining a service to be tested, an input parameter set and an output parameter of the service to be tested, wherein the input parameter set comprises at least three input parameters, the input parameters comprise at least three test coverage items, and the output parameters comprise at least three output coverage items; determining the risk level of each test coverage item of each input parameter; and determining the test case of the service to be tested based on the risk level of each test coverage item of each input parameter, the replacement rule of the test coverage item, the association relation of each input parameter and the supplement rule of the test coverage item. The invention reasonably processes the relation between the sufficiency and the economy of the test cases, reduces redundant test cases on the premise of ensuring the sufficiency of the test, controls the number of the test cases in a reasonable interval, and improves the economy of the test cases.

Description

Determination method and device for test cases, electronic equipment and storage medium
Technical Field
The present invention relates to the field of testing technologies, and in particular, to a method and apparatus for determining a test case, an electronic device, and a storage medium.
Background
Along with the rapid development of financial science and technology, updating and iteration of a banking system are more and more frequent, the updated and iterated system needs to be retested, and a test case is closely related to the test efficiency and the test quality of the banking system, so that the design scheme of the test case is one of the key problems for the tested personnel to pay attention to.
Currently, test case designs mainly include full-scale analysis, orthogonal test, and paired analysis. The full-quantity analysis method is based on a Cartesian product method, and all input test coverage items are multiplied, so that all theoretically existing paths are ensured to be considered; the orthogonal test method is to select proper and representative connection lines from all input test coverage items to test design by utilizing the orthogonality of an orthogonal table, and the paired analysis method is to pair all test coverage items of different input items pairwise and cover all test coverage item pairs (test coverage item pairing results) by the least test cases.
However, the full-scale analysis method needs to comprehensively consider service requirements and actual production environments, the number of generated cases is very large, redundant and invalid test cases exist, the test cases obtained by the orthogonal test method lack analysis on the association relation among various inputs and output results, the risk of missing important test scenes exists, the analysis process of the paired analysis method is complex, and missing or redundancy easily occurs.
Disclosure of Invention
The invention provides a method, a device, electronic equipment and a storage medium for determining test cases, which aim to reasonably process the relation between the sufficiency and the economy of the test cases, reduce redundant test cases on the premise of ensuring the sufficiency of the test, control the number of the test cases in a reasonable interval and improve the economy of the test cases.
According to an aspect of the present invention, there is provided a method for determining a test case, the method including:
determining a service to be tested, an input parameter set and an output parameter of the service to be tested, wherein the input parameter set comprises at least three input parameters, the input parameters comprise at least three test coverage items, and the output parameters comprise at least three output coverage items;
determining the risk level of each test coverage item of each input parameter;
and determining the test case of the service to be tested based on the risk level of each test coverage item of each input parameter, the replacement rule of the test coverage item, the association relation of each input parameter and the supplement rule of the test coverage item.
Optionally, determining the service to be tested, the input parameter set and the output parameter of the service to be tested includes: determining a service to be tested; determining an input parameter set based on a test requirement of a service to be tested; based on the set of input parameters, an output parameter is determined.
Optionally, determining the output parameter based on the input parameter set includes: sequentially matching test coverage items of all input parameters to obtain at least one candidate output coverage item; an output parameter is determined based on the at least one candidate output coverage item.
Optionally, determining the test case of the service to be tested based on the risk level of each test coverage of each input parameter, the replacement rule of the test coverage, the association relation of each input parameter and the supplement rule of the test coverage includes: determining a first test case of a service to be tested based on the risk level of each test coverage item of each input parameter; determining a second test case of the service to be tested based on the replacement rules of the first test case and the test coverage item, wherein the second test case comprises at least six test cases; determining a third test case of the service to be tested based on the association relation between the first test case and each input parameter; and determining the test cases based on the first test case, the second test case, the third test case and the supplementary rule of the test coverage item.
Optionally, determining the first test case of the service to be tested based on the risk level of each test coverage of each input parameter includes: ranking the test coverage items of the input parameters based on the risk level of the test coverage items of the input parameters; determining target test coverage items of all input parameters according to the sorting result, wherein the target test coverage items are the test coverage items with the highest risk level in the input parameters; and determining a first test case based on the target test coverage item of each input parameter.
Optionally, determining the second test case of the service to be tested based on the replacement rule of the first test case and the test coverage includes: determining the priority of each input parameter and the priority of each test coverage item of each input parameter; and determining a second test case based on the priority of each input parameter, the priority of each test coverage of each input parameter, the replacement rule of the test coverage and the first test case.
Optionally, determining the test case based on the first test case, the second test case, the third test case, and the supplementary rule of the test coverage item includes: determining whether the first test case, the second test case and the third test case contain all output coverage items in the output parameters; if the first test case, the second test case and the third test case contain all output coverage items in the output parameters, determining the test case based on the first test case, the second test case and the third test case; if the first test case, the second test case and the third test case do not contain all the output coverage items in the output parameters, determining a fourth test case according to the supplement rule of the test coverage items, and determining the test case based on the first test case, the second test case, the third test case and the fourth test case.
Optionally, determining the fourth test case based on the supplemental rule of the test coverage includes: and determining a fourth test case based on the output coverage items which are not contained by the first test case, the second test case and the third test case in the output parameters.
Optionally, determining the test case of the service to be tested includes: determining whether an abnormal test case exists in the test cases; if the abnormal test cases exist in the test cases, eliminating the abnormal test cases in the test cases, wherein the abnormal test cases are test cases which do not accord with the association relation of the input parameters.
According to another aspect of the present invention, there is provided a determination apparatus for a test case, the apparatus comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for determining a service to be tested, an input parameter set and an output parameter of the service to be tested, wherein the input parameter set comprises at least three input parameters, the input parameters comprise at least three test coverage items, and the output parameters comprise at least three output coverage items;
the determining module is used for determining the risk level of each test coverage item of each input parameter;
and the execution module is used for determining the test case of the service to be tested based on the risk level of each test coverage item of each input parameter, the replacement rule of the test coverage item, the association relation of each input parameter and the supplement rule of the test coverage item.
According to another aspect of the present invention, there is provided an electronic device including:
at least one processor; and a memory communicatively coupled to the at least one processor;
the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the method for determining the test case according to any embodiment of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a method for determining a test case according to any one of the embodiments of the present invention.
According to the technical scheme, the service to be tested, the input parameter set of the service to be tested and the output parameters are determined, wherein the input parameter set comprises at least three input parameters, the input parameters comprise at least three test coverage items, and the output parameters comprise at least three output coverage items; determining the risk level of each test coverage item of each input parameter; and determining the test case of the service to be tested based on the risk level of each test coverage item of each input parameter, the replacement rule of the test coverage item, the association relation of each input parameter and the supplement rule of the test coverage item. According to the risk level of each test coverage item of each input parameter of the service to be tested, the replacement rule of the test coverage item, the association relation of each input parameter, the supplement rule of the test coverage item and each output coverage item, the invention determines the test cases of the service to be tested, reasonably processes the relation between the sufficiency and the economy of the test cases, reduces redundant test cases on the premise of ensuring the sufficiency of the test, controls the number of the test cases in a reasonable interval, and improves the economy of the test cases. The problems that the total analysis method needs to comprehensively consider business requirements and actual production environments, the number of generated cases is very large, redundant and invalid test cases exist, the test cases obtained by the orthogonal test method lack the analysis of the association relation and output results among various inputs, the risk of missing important test scenes exists, the analysis process of the paired analysis method is complex, missing or redundancy easily occurs and the like are solved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for determining a test case according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a method for determining a test case according to a second embodiment of the present invention;
FIG. 3 is a schematic diagram of a first test case according to a second embodiment of the present invention;
FIG. 4 is a schematic diagram of a second test case according to a second embodiment of the present invention;
FIG. 5 is a schematic diagram of another second test case according to the second embodiment of the present invention;
FIG. 6 is a schematic diagram of yet another second test case according to the second embodiment of the present invention;
FIG. 7 is a schematic diagram of a third test case according to a second embodiment of the present invention;
FIG. 8 is a schematic diagram of a fourth test case according to a second embodiment of the present invention;
FIG. 9 is a schematic structural diagram of a determining device for a test case according to a third embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flow chart of a method for determining a test case according to a first embodiment of the present invention, where the embodiment is applicable to determining a test case of a system under test, and the method may be performed by a device for determining a test case according to the present invention, where the device may be implemented in hardware and/or software, and in a specific embodiment, the device may be integrated in an electronic device. The following embodiment will be described taking the example of the integration of the apparatus in an electronic device, and referring to fig. 1, the method specifically includes the following steps:
s101, determining a service to be tested, an input parameter set and an output parameter of the service to be tested.
The business to be tested (also called transaction) is understood as the function of the bank application system that needs to be tested and evaluated, including transfer, remittance, deposit, withdrawal, etc. A banking application is understood to mean a computer application that a bank provides services to clients, typically human/machine interaction with a machine, with obvious input and output operations. The input parameter and the output parameter are both data of a certain link in the complete business process in computer processing, the input parameter can be understood as data input to the system in the business process, the output parameter can be understood as data output by the system in the business process, and the embodiment is not limited to this.
Specifically, the input parameter set includes at least three input parameters, the input parameters include at least three test coverage items, and the output parameters include at least three output coverage items (i.e., output test coverage items). The test coverage term is understood as a test design technology capable of measuring the integrity of test execution, and is derived from one or more test conditions, or a combination of attributes.
Assuming that the service to be tested is a transfer service, the input parameter set at least comprises input parameters such as a payee, a payer, an amount, a receipt and payment mode, and the like, taking the receipt and payment mode as an example, the input parameters at least comprise output results of combination items of test coverage items of the input parameters such as deposit card-to-deposit card transfer, deposit card-to-debit card transfer, credit card-to-deposit card transfer, and the like.
The benefit of this arrangement is that comprehensive test data can be determined to economically and fully formulate test cases for banking applications.
S102, determining the risk level of each test coverage item of each input parameter.
The risk level may be understood as a risk value of a test coverage, which is used to indicate a risk level of each test coverage, specifically, the higher the risk level of the test coverage, the higher the risk level, the more the test result of the test coverage with the higher risk level represents the performance of the bank application system.
Furthermore, the risk level of each test coverage item of each input parameter is determined based on factors such as actual transaction amount and risk level, the risk level of each test coverage item can provide data support for planning of test cases, and the test coverage item with the highest risk level in each input parameter is generally selected when the test cases are planned, so that the set advantage is that the test cases covering the greatest system risk can be obtained quickly.
S103, determining a test case of the service to be tested based on the risk level of each test coverage item of each input parameter, the replacement rule of the test coverage item, the association relation of each input parameter and the supplement rule of the test coverage item.
Wherein, the test case refers to the description of a test task performed on a specific software product and consists of a series of test coverage items of input/output in a transaction in series; the replacement rule of the test coverage item can be understood as a replacement mode of the composition factors of the test case (each test coverage item in the test case); the association relationship of the input parameters can be understood as the relative relationship between test coverage items of the input parameters, for example, some parameter coverage items have a connection relationship (to be adopted by a test case at the same time) and some parameter coverage items have a repulsive relationship (to be not adopted by a test case at the same time) and the like. The supplement rule of the test coverage item can be understood as an addition rule of a special test case, for example, an addition rule of an uncovered special case, etc.; the test cases of the service to be tested can be understood as test cases for testing the performance of the service to be tested, and in general, the number of the test cases of the service to be tested is at least seven, so that the performance of the service to be tested can be comprehensively evaluated only by using a plurality of test cases.
Specifically, the test cases of the service to be tested are combinations of the test cases determined in the above-described modes.
For example, assuming that T1 test cases are determined based on risk levels of respective test coverage of respective input parameters, T2 test cases are determined based on replacement rules of the test coverage, T3 test cases are determined based on association relationships of respective input parameters, and T4 test cases are determined based on supplement rules of the test coverage, then the test cases of the service to be tested are t1+t2+t3+t4.
The method has the advantages that the input test coverage items are not required to be multiplied, redundant test cases are reduced on the premise of guaranteeing the test sufficiency, the number of the test cases is controlled in a reasonable interval, and the economy of the test cases is improved.
According to the technical scheme, a service to be tested, an input parameter set of the service to be tested and output parameters are determined, wherein the input parameter set comprises at least three input parameters, the input parameters comprise at least three test coverage items, and the output parameters comprise at least three output coverage items; determining the risk level of each test coverage item of each input parameter; and determining the test case of the service to be tested based on the risk level of each test coverage item of each input parameter, the replacement rule of the test coverage item, the association relation of each input parameter and the supplement rule of the test coverage item. According to the risk level of each test coverage item of each input parameter of the service to be tested, the replacement rule of the test coverage item, the association relation of each input parameter, the supplement rule of the test coverage item and each output coverage item, the invention determines the test cases of the service to be tested, reasonably processes the relation between the sufficiency and the economy of the test cases, reduces redundant test cases on the premise of ensuring the sufficiency of the test, controls the number of the test cases in a reasonable interval, and improves the economy of the test cases. The problems that the total analysis method needs to comprehensively consider business requirements and actual production environments, the number of generated cases is very large, redundant and invalid test cases exist, the test cases obtained by the orthogonal test method lack the analysis of the association relation and output results among various inputs, the risk of missing important test scenes exists, the analysis process of the paired analysis method is complex, missing or redundancy easily occurs and the like are solved.
Example two
Fig. 2 is a flow chart of a method for determining a test case according to a second embodiment of the present invention, where the embodiment is applicable to determining a test case of a system under test, and the method may be performed by a device for determining a test case according to the present invention, where the device may be implemented in hardware and/or software, and in a specific embodiment, the device may be integrated in an electronic device. The following embodiment will be described taking the example of the integration of the device in an electronic apparatus, and referring to fig. 2, the method specifically includes the following steps:
s201, determining a service to be tested, an input parameter set and an output parameter of the service to be tested.
The service to be tested can be understood as functions which need to be tested and evaluated in the bank application system, including transfer, remittance, deposit, withdrawal and the like. The input parameter and the output parameter are both data embodiment of a certain link in the complete business process in computer processing, the input parameter can be understood as data input to a system in the business process, and the output parameter can be understood as data output by the system in the business process. Specifically, the input parameter set includes at least three input parameters, the input parameters include at least three test coverage items, and the output parameters include at least three output coverage items. The test coverage item can be understood as a minimum unit of test design according to documents such as business requirement books, design specifications and the like and analysis methods such as equivalence classes and boundary values.
In an embodiment, S201 may specifically include: determining a service to be tested; determining an input parameter set based on a test requirement of a service to be tested; based on the set of input parameters, an output parameter is determined.
The test requirement can be understood as a transaction requirement of a user when using a service to be tested, and taking a transfer service as an example, the test requirement comprises information such as a payee, a payer, a transfer amount, a transfer mode and the like.
Specifically, determining the output parameter based on the input parameter set includes: sequentially matching test coverage items of all input parameters to obtain at least one candidate output coverage item, namely selecting all candidate output coverage items in a permutation and combination mode; and determining output parameters based on at least one candidate output coverage item, namely integrating all candidate output coverage items to obtain the output parameters of the service to be tested.
S202, determining the risk level of each test coverage item of each input parameter.
The risk level may be understood as a risk value of a test coverage, which is used to indicate a risk level of each test coverage, specifically, the higher the risk level of the test coverage, the higher the risk level, the more the test result of the test coverage with the higher risk level represents the performance of the bank application system.
Furthermore, the risk level of each test coverage item of each input parameter is determined based on factors such as actual transaction amount and risk level, the risk level of each test coverage item can provide data support for planning of test cases, and the test coverage item with the highest risk level in each input parameter is generally selected when the test cases are planned, so that the set advantage is that the test cases covering the greatest system risk can be obtained quickly.
S203, determining a first test case of the service to be tested based on the risk level of each test coverage item of each input parameter.
The first test case can be understood as a test case in which test coverage items with highest risk levels in all input parameters are connected in series, and an output coverage item of the first test case is a combined output result of all the input parameters.
Specifically, S203 may specifically include: ranking the test coverage items of the input parameters based on the risk level of the test coverage items of the input parameters; determining target test coverage items of all input parameters according to the sorting result, wherein the target test coverage items are the test coverage items with the highest risk level in the input parameters; and determining a first test case based on the target test coverage item of each input parameter.
Specifically, fig. 3 is a schematic diagram of a first test case provided in the second embodiment of the present invention, where L in fig. 3 represents an input parameter, O represents an output parameter, a circle represents a test coverage item, a thickened circle in the input parameter and the output parameter represents a test coverage item with the highest risk level, and i, j, k, p and n are integers greater than or equal to 3, and are used to represent the number of test coverage items or input parameters.
As can be seen from fig. 3, the first test case is a serial combination result of test coverage items with highest risk levels, and can represent the maximum system risk of the service to be tested.
S204, determining a second test case of the service to be tested based on the replacement rule of the first test case and the test coverage item.
The second test case is a serial combination result obtained by replacing one test coverage item in the first test case according to a replacement rule of the test coverage item, and comprises at least six test cases.
The replacement rule of the test coverage in this embodiment is to replace the test coverage input by a single item in sequence from the 1 st input test by taking the test coverage of the "straight line connection (the test coverage with the maximum risk level)" of S203 as the "target" case, and after replacing all the test coverage input by the 1 st item, restore the test coverage of each input to the test coverage selected by the "straight line connection" test coverage, and replace the test coverage of the 2 nd input parameter until all the input parameters are replaced, where the combination of all the obtained second sub-cases is the second test case.
Further, the number of the second test cases is related to the number of the input parameters and the total number of test coverage items of the input parameters, and assuming that the number of the input parameters is x1 and x2 test coverage items are shared by x1 input parameters, the number of the second test cases is x2-x1.
In an embodiment, S204 may specifically include: determining the priority of each input parameter and the priority of each test coverage item of each input parameter; and determining a second test case based on the priority of each input parameter, the priority of each test coverage of each input parameter, the replacement rule of the test coverage and the first test case.
The determining the priority of each input parameter may be understood as determining the input order of each input parameter, determining the priority of each test coverage of each input parameter may be understood as determining the sequence of each test coverage in each input parameter (the arrangement sequence of all test coverage except for the target test coverage may be random or may be ordered according to a certain rule, which is not limited in this embodiment), and determining each input parameter and the replacement sequence of each test coverage of each input parameter may be understood as determining the priority of each input parameter, the priority of each test coverage of each input parameter, the replacement rule of each test coverage, and the first test case.
It is noted that the replacement procedure is to replace the target test coverage item sequentially with all test coverage items except the target test coverage item.
Specifically, fig. 4 is a schematic diagram of a second test case provided in the second embodiment of the present invention, fig. 5 is a schematic diagram of another second test case provided in the second embodiment of the present invention, and fig. 6 is a schematic diagram of yet another second test case provided in the second embodiment of the present invention.
By way of example, the determining process of the second test case is described with reference to fig. 4 to fig. 6, it can be seen from fig. 4 and fig. 5 that the present embodiment sequentially changes the test coverage items in the input parameter L1 to obtain a plurality of new test cases, and as can be seen from fig. 6, the present embodiment changes the coverage items in the input parameter L1 back to the target test coverage items, starts to change the test coverage items in the input parameter L2, determines the new test case, and so on, and after traversing all the input parameters, the obtained test case set is the second test case.
S205, determining a third test case of the service to be tested based on the association relation between the first test case and each input parameter.
The third test case is a serial combination result obtained by replacing a plurality of test coverage items in the first test case according to the association relation (mainly between services) of each input parameter.
Specifically, fig. 7 is a schematic diagram of a third test case provided in the second embodiment of the present invention, where it is assumed that a test coverage item L1-1 in an input parameter L1 and a test coverage item L2-2 in an input parameter L2 have an association relationship, and if both are required to occur simultaneously, the test coverage item L1-1 in the input parameter L1 and the test coverage item L2-2 in the input parameter L2 are replaced simultaneously, so as to obtain a new test case, and a set of test cases under all the association relationships is the third test case.
S206, determining the test cases based on the first test case, the second test case, the third test case and the supplementary rule of the test coverage item.
The supplement rule of the test coverage item may be understood as an addition rule of a specific test case, for example, an addition rule of a specific case that is not covered. Specifically, if the first test case, the second test case and the third test case do not meet the supplement rule of the test coverage item (the first test case, the second test case and the third test case already cover all test cases required by the test service to be tested), determining that the set of the first test case, the second test case and the third test case is the test case of the test service to be tested; if the first test case, the second test case and the third test case satisfy the supplement rule of the test coverage item (the first test case, the second test case and the third test case do not cover all test cases required by the test service to be tested), the test cases need to be supplemented based on the supplement rule of the test coverage item, and the aggregate of the supplemented test cases, the first test case, the second test case and the third test case is determined to be the test case of the test service to be tested.
In an embodiment, S206 may specifically include: determining whether the first test case, the second test case and the third test case contain all output coverage items in the output parameters; if the first test case, the second test case and the third test case contain all output coverage items in the output parameters, determining the test case based on the first test case, the second test case and the third test case; if the first test case, the second test case and the third test case do not contain all the output coverage items in the output parameters, determining a fourth test case according to the supplement rule of the test coverage items, and determining the test case based on the first test case, the second test case, the third test case and the fourth test case.
The fourth test case may be understood as a test case determined based on the supplementary rule of the test coverage. Specifically, determining the fourth test case based on the supplemental rule of the test coverage includes: and determining a fourth test case based on the output coverage items which are not contained by the first test case, the second test case and the third test case in the output parameters.
In this embodiment, the supplement rule of the test coverage item may be that a new test case needs to be formed by the input test coverage item serial combination corresponding to the uncovered output coverage item, fig. 8 is a schematic diagram of a fourth test case provided by the second embodiment of the present invention, and if the output coverage item O1 in fig. 8 is not covered by the first test case, the second test case and the third test case, it is proved that the first test case, the second test case and the third test case satisfy the supplement rule of the test coverage item, and the input test coverage item serial combination corresponding to the output coverage item O1 (the coverage item connected by the thickened lines in fig. 8) needs to be supplemented, and the set formed by the input test coverage item serial combination corresponding to each uncovered output coverage item is the fourth test case.
The method has the advantages that the tested transaction can be fully covered, the test case can fully cover the tested coverage items, and key contents are mainly covered by combining business rules and importance degrees, so that the sufficiency related to the test case is ensured.
Optionally, determining the test case of the service to be tested includes: determining whether an abnormal test case exists in the test cases; if the abnormal test cases exist in the test cases, eliminating the abnormal test cases in the test cases.
The abnormal test case may be understood as a test case having a conflict factor, for example, at least two test coverage items that repel each other are simultaneously present in one test case, a test coverage item combination that conflicts with an association relationship, and the like.
The method has the advantages that unnecessary test work can be detected by eliminating abnormal test cases in the test cases, the test efficiency of an application system is improved, and the test time is saved.
According to the technical scheme, a service to be tested, an input parameter set of the service to be tested and output parameters are determined, wherein the input parameter set comprises at least three input parameters, the input parameters comprise at least three test coverage items, and the output parameters comprise at least three output coverage items; determining the risk level of each test coverage item of each input parameter; determining a first test case of a service to be tested based on the risk level of each test coverage item of each input parameter; determining a second test case of the service to be tested based on the replacement rules of the first test case and the test coverage item, wherein the second test case comprises at least six test cases; determining a third test case of the service to be tested based on the association relation between the first test case and each input parameter; and determining the test cases based on the first test case, the second test case, the third test case and the supplementary rule of the test coverage item. According to the risk level of each test coverage item of each input parameter of the service to be tested, the replacement rule of the test coverage item, the association relation of each input parameter, the supplement rule of the test coverage item and each output coverage item, the invention determines the test cases of the service to be tested, reasonably processes the relation between the sufficiency and the economy of the test cases, reduces redundant test cases on the premise of ensuring the sufficiency of the test, controls the number of the test cases in a reasonable interval, and improves the economy of the test cases. The problems that the total analysis method needs to comprehensively consider business requirements and actual production environments, the number of generated cases is very large, redundant and invalid test cases exist, the test cases obtained by the orthogonal test method lack the analysis of the association relation and output results among various inputs, the risk of missing important test scenes exists, the analysis process of the paired analysis method is complex, missing or redundancy easily occurs and the like are solved.
Example III
Fig. 9 is a schematic structural diagram of a determining device for a test case according to a third embodiment of the present invention. As shown in fig. 9, the apparatus includes: an acquisition module 901, a determination module 902, and an execution module 903.
The obtaining module 901 is configured to determine a service to be tested, an input parameter set of the service to be tested, and an output parameter, where the input parameter set includes at least three input parameters, the input parameter includes at least three test coverage items, and the output parameter includes at least three output coverage items.
A determining module 902 is configured to determine a risk level of each test coverage item of each input parameter.
The execution module 903 is configured to determine a test case of the service to be tested based on a risk level of each test coverage of each input parameter, a replacement rule of the test coverage, an association relationship of each input parameter, and a supplement rule of the test coverage.
Optionally, the acquiring module 901 is specifically configured to determine a service to be tested; determining an input parameter set based on a test requirement of a service to be tested; based on the set of input parameters, an output parameter is determined.
Optionally, the acquiring module 901 is specifically configured to sequentially match test coverage items of each input parameter to obtain at least one candidate output coverage item; an output parameter is determined based on the at least one candidate output coverage item.
Optionally, the execution module 903 is specifically configured to determine a first test case of a service to be tested based on a risk level of each test coverage item of each input parameter; determining a second test case of the service to be tested based on the replacement rules of the first test case and the test coverage item, wherein the second test case comprises at least six test cases; determining a third test case of the service to be tested based on the association relation between the first test case and each input parameter; and determining the test cases based on the first test case, the second test case, the third test case and the supplementary rule of the test coverage item.
Optionally, the execution module 903 is specifically configured to sort each test coverage item of each input parameter based on a risk level of each test coverage item of each input parameter; determining target test coverage items of all input parameters according to the sorting result, wherein the target test coverage items are the test coverage items with the highest risk level in the input parameters; and determining a first test case based on the target test coverage item of each input parameter.
Optionally, the execution module 903 is specifically configured to determine a priority of each input parameter and a priority of each test coverage item of each input parameter; and determining a second test case based on the priority of each input parameter, the priority of each test coverage of each input parameter, the replacement rule of the test coverage and the first test case.
Optionally, the execution module 903 is specifically configured to determine whether the first test case, the second test case, and the third test case include all output coverage items in the output parameters; if the first test case, the second test case and the third test case contain all output coverage items in the output parameters, determining the test case based on the first test case, the second test case and the third test case; if the first test case, the second test case and the third test case do not contain all the output coverage items in the output parameters, determining a fourth test case according to the supplement rule of the test coverage items, and determining the test case based on the first test case, the second test case, the third test case and the fourth test case.
Optionally, the execution module 903 is specifically configured to determine the fourth test case based on output coverage items that are not included in the output parameters by the first test case, the second test case, and the third test case.
Optionally, the execution module 903 is further configured to determine whether an abnormal test case exists in the test cases; if the abnormal test cases exist in the test cases, eliminating the abnormal test cases in the test cases, wherein the abnormal test cases are test cases which do not accord with the association relation of the input parameters.
The test case determining device provided by the embodiment of the invention can execute the test case determining method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Example IV
Fig. 10 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 10, the electronic device 10 includes at least one processor 11, and a Memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a random access Memory (also referred to as a random access Memory, random Access Memory, RAM) 13, etc., in which a computer program executable by the at least one processor is stored, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the test case determination method.
In some embodiments, the method of test case determination may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the above-described method of determining test cases may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the test case determination method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server) or that includes a middleware component (e.g., an application server) or that includes a front-end component through which a user can interact with an implementation of the systems and techniques described here, or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for determining a test case, comprising:
determining a service to be tested, an input parameter set and output parameters of the service to be tested, wherein the input parameter set comprises at least three input parameters, the input parameters comprise at least three test coverage items, and the output parameters comprise at least three output coverage items;
determining the risk level of each test coverage item of each input parameter;
And determining the test case of the service to be tested based on the risk level of each test coverage item of each input parameter, the replacement rule of the test coverage item, the association relation of each input parameter and the supplement rule of the test coverage item.
2. The method of claim 1, wherein the determining the traffic to be tested, the set of input parameters and the output parameters of the traffic to be tested, comprises:
determining the service to be tested;
determining the input parameter set based on the test requirement of the service to be tested;
the output parameters are determined based on the set of input parameters.
3. The method according to claim 1, wherein the determining the test case of the service to be tested based on the risk level of each test coverage of each input parameter, the replacement rule of the test coverage, the association relation of each input parameter, and the supplementary rule of the test coverage includes:
determining a first test case of the service to be tested based on the risk level of each test coverage item of each input parameter;
determining a second test case of the service to be tested based on the replacement rules of the first test case and the test coverage item, wherein the second test case comprises at least six test cases;
Determining a third test case of the service to be tested based on the association relation between the first test case and each input parameter;
and determining the test case based on the first test case, the second test case, the third test case and the supplementary rule of the test coverage item.
4. A method according to claim 3, wherein said determining the first test case of the service under test based on the risk level of each test coverage of each of the input parameters comprises:
ranking the test coverage items of the input parameters based on the risk level of the test coverage items of the input parameters;
determining target test coverage items of the input parameters according to the sorting result, wherein the target test coverage items are the test coverage items with the highest risk grades in the input parameters;
and determining the first test case based on the target test coverage item of each input parameter.
5. The method of claim 3, wherein the determining the second test case for the business to be tested based on the replacement rules for the first test case and the test coverage comprises:
Determining the priority of each input parameter and the priority of each test coverage item of each input parameter;
and determining the second test case based on the priority of each input parameter, the priority of each test coverage of each input parameter, the replacement rule of the test coverage and the first test case.
6. The method of claim 3, wherein the determining the test case based on the supplemental rules for the first test case, the second test case, the third test case, and the test coverage comprises:
determining whether the first test case, the second test case and the third test case contain all output coverage items in the output parameters;
if the first test case, the second test case and the third test case contain all output coverage items in the output parameters, determining the test case based on the first test case, the second test case and the third test case;
if the first test case, the second test case and the third test case do not contain all output coverage items in the output parameters, a fourth test case is determined according to the supplement rule of the test coverage items, and the test cases are determined based on the first test case, the second test case, the third test case and the fourth test case.
7. The method of claim 1, wherein the determining the test case for the service to be tested comprises:
determining whether an abnormal test case exists in the test cases;
if the abnormal test cases exist in the test cases, eliminating the abnormal test cases in the test cases.
8. A device for determining a test case, comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for determining a service to be tested, an input parameter set of the service to be tested and output parameters, wherein the input parameter set comprises at least three input parameters, the input parameters comprise at least three test coverage items, and the output parameters comprise at least three output coverage items;
the determining module is used for determining the risk level of each test coverage item of each input parameter;
the execution module is used for determining the test case of the service to be tested based on the risk level of each test coverage item of each input parameter, the replacement rule of the test coverage item, the association relation of each input parameter and the supplement rule of the test coverage item.
9. An electronic device, the electronic device comprising:
At least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the test case determination method of any one of claims 1 to 7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the method of determining test cases of any one of claims 1 to 7 when executed.
CN202311610540.7A 2023-11-29 2023-11-29 Determination method and device for test cases, electronic equipment and storage medium Pending CN117762781A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311610540.7A CN117762781A (en) 2023-11-29 2023-11-29 Determination method and device for test cases, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311610540.7A CN117762781A (en) 2023-11-29 2023-11-29 Determination method and device for test cases, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117762781A true CN117762781A (en) 2024-03-26

Family

ID=90324715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311610540.7A Pending CN117762781A (en) 2023-11-29 2023-11-29 Determination method and device for test cases, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117762781A (en)

Similar Documents

Publication Publication Date Title
CN106910065B (en) Data processing method, device and system for calculating settlement amount based on multiple transactions
CN107133289A (en) A kind of method and apparatus of determination commercial circle
CN111080424A (en) Accounting management method and device
CN110428240A (en) The suspicious transaction automatic identification of one kind and processing method, terminal and server
CN112417060A (en) Method, device, equipment and computer readable medium for identifying enterprise relationship
CN115239443A (en) Transaction matching method, device, equipment and medium based on block chain
CN115328621B (en) Transaction processing method, device, equipment and storage medium based on block chain
CN115840738A (en) Data migration method and device, electronic equipment and storage medium
CN117762781A (en) Determination method and device for test cases, electronic equipment and storage medium
CN115563310A (en) Method, device, equipment and medium for determining key service node
CN106156185A (en) A kind of service request performs the querying method of state, Apparatus and system
CN114722048A (en) Data processing method and device, electronic equipment and storage medium
CN114490408A (en) Test case generation method, device, equipment, storage medium and product
CN113379464A (en) Block chain-based site selection method, device, equipment and storage medium
CN104881491A (en) Software development system based on big data platform
CN117632741A (en) Determination method and device of regression test case library, electronic equipment and storage medium
CN111967960B (en) Batch adjustment method and device for account data
CN113240472B (en) Financial product recommendation method, electronic equipment and storage medium
CN116308713A (en) Multiplexing method and device for business transaction codes, electronic equipment and storage medium
CN116385150A (en) Credit information determining method, device, equipment, medium and product
CN115438089A (en) Query method, device, equipment and medium based on bank flow data
CN114862619A (en) Basic electricity charge processing method and device, electronic equipment and medium
CN117237070A (en) Evaluation method, device, equipment and medium of resource allocation strategy
CN117611290A (en) Method, device, equipment and storage medium for ordering merchant nodes
CN116340173A (en) Test account management method, device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination