A method and device for generating test parameters

By converting the first logical expression that characterizes the dependency of the parameters to be tested into the second logical expression, the test parameters of each equivalent class are automatically determined, which solves the problem that the test parameters cannot be automatically generated in the prior art, and improves the efficiency of software testing.

CN111367806BActive Publication Date: 2025-05-30WEBANK (CHINA) +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010150775.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-06
Publication Date
2025-05-30
Estimated Expiration
2040-03-06

AI Technical Summary

Technical Problem

The existing technology cannot automatically generate test parameters for each equivalent category through the dependency relationship between each parameter, resulting in the need to manually analyze and troubleshoot the equivalent category during the software testing process and delay the test progress.

Method used

By obtaining a first logical expression that characterizes the dependence between the parameters to be tested and converts it into a second logical expression, the test parameters of each equivalent class are determined according to the second logical expression.

Benefits of technology

It realizes automated generation of test parameters, reduces the need for human analysis, and improves the efficiency and accuracy of software testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111367806B_ABST
    Figure CN111367806B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and apparatus for generating test parameters. The method includes: obtaining a first logical expression characterizing the dependency relationship between the parameters to be tested; converting the first logical expression into a second logical expression, determining each equivalence class of the value ranges of the parameters to be tested according to the second logical expression, and generating test parameters for each equivalence class. When the above method is applied to financial technology (Fintech), it can automatically and accurately generate test parameters for each equivalence class.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of financial technology (Fintech) and software testing, and particularly to a method and device for generating test parameters. Background Art

[0002] With the development of computer technology, more and more technologies are applied in the financial field, and traditional finance is gradually transforming into financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher requirements are also put forward for technologies. Before the relevant software of financial technology is launched, in order to verify the reliability of the software, etc., the software usually needs to be tested to timely repair software vulnerabilities.

[0003] Various parameters are used in software, and there may be dependencies between parameters, that is, the legal value range of one parameter may be affected by the value of another parameter. For example, parameter one represents the month, and parameter two represents the number of days in a month. Obviously, when parameter one takes 2, parameter two cannot take 30. Therefore, when generating the specific values of each parameter for testing, it is necessary to consider the dependencies between the parameters. In order to minimize the generated test cases as much as possible, currently, after dividing the equivalence classes of each parameter, equivalence class testing is usually generated, that is, the value range of each parameter in the software is divided into equivalence classes, and based on the properties of the equivalence relationship, a representative element is selected in each equivalence class to generate test parameters, so as to test whether there is a problem with the entire equivalence class. Obviously, equivalence class partitioning is of great significance for software testing, but currently, it is necessary to manually analyze and check the equivalence classes, which will undoubtedly delay the progress of the entire testing process. Therefore, in the prior art, it is impossible to automatically generate test parameters for each equivalence class through the dependencies between parameters, which is an urgent problem to be solved. Summary of the Invention

[0004] The present invention provides a method and device for generating test parameters, which solves the problem in the prior art that test parameters for each equivalence class cannot be automatically generated through the dependencies between parameters.

[0005] In a first aspect, the present invention provides a method for generating test parameters, including: obtaining a first logical expression representing the dependency relationship between the parameters to be tested; the first logical expression includes a dependency condition and a dependency value associated by an implication connective, wherein each of the dependency condition and the dependency value includes each independent proposition that restricts the value range of each parameter, or each independent proposition and each logical connective between the independent propositions; converting the first logical expression into a second logical expression, wherein each dependency value associated with the implication connectives in the second logical expression includes only one independent proposition and the independent propositions in the dependency conditions of the implication connectives meet the requirements of a simple conjunction; determining each equivalence class of the value ranges of the parameters to be tested according to the second logical expression, and generating test parameters for each equivalence class.

[0006] In the above method, after obtaining the first logical expression representing the dependency relationship between the parameters to be tested, the dependency condition and the dependency value in the first logical expression are converted to obtain a second logical expression. Each dependency value associated with the implication connectives in the second logical expression includes only one independent proposition and the independent propositions in the dependency conditions of the implication connectives meet the requirements of a simple conjunction. Further, each equivalence class is obtained and test parameters for each equivalence class are generated. Thus, a method for converting a first logical expression in a specific form into a second logical expression in a specific form is proposed, and each equivalence class of the value ranges of the parameters to be tested can be determined based on the second logical expression in the specific form, and test parameters for each equivalence class are generated.

[0007] Optionally, the converting the first logical expression into a second logical expression includes: performing a conversion process on the dependency value in the first logical expression according to a preset equivalent conversion formula to obtain the dependency condition after the equivalent conversion of the first logical expression and each dependency value in the second logical expression; each dependency value associated with the implication connectives after the conversion process of the dependency value in the first logical expression includes only one independent proposition; converting the dependency condition after the equivalent conversion of the first logical expression into a dependency condition in the form of a simple conjunction according to the equivalent conversion formula, as the dependency condition in the second logical expression.

[0008] In the above method, first, according to a preset equivalent transformation formula, the dependent values in the first logical expression are transformed, so that each dependent value in the transformed logical expression only contains one independent proposition. Then, according to the equivalent transformation formula, the dependent conditions after the equivalent transformation of the first logical expression are transformed into dependent conditions in the form of a simple conjunction, thus proposing a fixed method of first transforming the dependent values in the first logical expression in a specific form and then transforming the dependent conditions after the equivalent transformation of the first logical expression, and obtaining a second logical expression in a specific form.

[0009] Optionally, the preset equivalent transformation formula includes: Formula 1: p -> (q ∧ r) => (p -> q) ∧ (p -> r); Formula 2: p -> (q ∨ r) => (p ∨ (!r)) -> q; where p, q, and r each include at least one independent proposition, and none of p, q, and r include an implication connective; -> represents an implication connective; ∧ represents a conjunction connective; ∨ represents a disjunction connective;! represents a negation connective; => represents an equivalent transformation.

[0010] In the above method, Formula 1 gives an equivalent transformation method for reducing the number of independent propositions in the dependent values when the outermost layer of the dependent values in the first logical expression contains a disjunction connective, and Formula 2 gives an equivalent transformation method for reducing the number of independent propositions in the dependent values when the outermost layer of the dependent values in the first logical expression contains a conjunction connective, thus giving an equivalent transformation method for reducing the number of independent propositions in the dependent values through Formula 1 and Formula 2.

[0011] Optionally, the transformation of the dependent conditions after the equivalent transformation of the first logical expression into dependent conditions in the form of a simple conjunction according to the equivalent transformation formula of discrete mathematics includes: establishing an expression tree of the dependent conditions after the equivalent transformation of the first logical expression according to the dependent conditions after the equivalent transformation of the first logical expression; and by using the expression tree algorithm, applying the equivalent transformation formula of discrete mathematics to the first logical expression, so as to transform the dependent conditions after the equivalent transformation of the first logical expression into dependent conditions in the form of a simple conjunction.

[0012] In the above manner, an expression tree of the dependent conditions after the equivalent transformation of the first logical expression that is more intuitive is established, and then by using the expression tree algorithm, the equivalent transformation formula of discrete mathematics is applied to the first logical expression, thus providing a method for transforming to obtain dependent conditions in the form of a simple conjunction through the expression tree algorithm.

[0013] Optionally, the expression tree of the dependency condition after the equivalent transformation of the first logical expression is established through an expression tree stack and a symbol stack; the expression tree stack is used to store the expression tree; the symbol stack is used to store logical connectives or parentheses; establishing the expression tree of the dependency condition after the equivalent transformation of the first logical expression according to the dependency condition after the equivalent transformation of the first logical expression includes: scanning the dependency condition after the equivalent transformation of the first logical expression from left to right in sequence, and for each scanned unit, performing a first preset operation on the scanned unit; taking the expression tree obtained after scanning the dependency condition after the equivalent transformation of the first logical expression as the expression tree of the dependency condition after the equivalent transformation of the first logical expression; the first preset operation is: if the scanned unit is an independent proposition, push it onto the expression tree stack; if the scanned unit is a logical connective, and the top element of the symbol stack is not empty and the operation priority of the logical connective is lower than or equal to the priority of the logical connective at the top of the symbol stack, pop two expression trees from the expression tree stack, and push an expression tree generated according to the two expression trees and the scanned unit onto the expression tree stack; if the scanned unit is a logical connective, and the operation priority of the logical connective is higher than the priority of the logical connective at the top of the symbol stack or the top element of the symbol stack is empty, push the scanned unit onto the symbol stack; if the scanned unit is a left parenthesis, push the scanned unit onto the symbol stack, if the scanned unit is a right parenthesis, pop two expression trees from the expression tree stack, and generate an expression tree according to the logical connective at the top of the symbol stack and the two expression trees, and push the expression tree onto the expression tree stack.

[0014] In the above manner, the expression tree of the dependency condition after the equivalent transformation of the first logical expression is established through an expression tree stack and a symbol stack; the expression tree stack is used to store the expression tree; the symbol stack is used to store logical connectives or parentheses. Based on the defined first preset operation, scan the dependency condition after the equivalent transformation of the first logical expression from left to right in sequence, and perform the first preset operation on each scanned unit. After scanning, the expression tree can be obtained, thus providing a method for automatically establishing an expression tree through an expression tree stack and a symbol stack.

[0015] Optionally, the expression tree of the dependency condition after the equivalent transformation of the first logical expression is a binary tree, where each node corresponds to an OR connective, an AND connective, or an independent proposition; the expression tree algorithm is as follows: for a target node, if the target node is a non-leaf node of the expression tree, perform a second preset operation; the second preset operation is: if the target node corresponds to an AND connective, and the root node of the target subtree of the target node corresponds to an OR connective, then make the target node correspond to an OR connective, make the root node of the target subtree and the root node of the remaining subtree of the target node both correspond to AND connectives, and replace the left subtree (or right subtree) of the target subtree of the target node with the remaining subtree of the target node, and replace the remaining subtree of the target node with the tree composed of the remaining subtree of the target node and the non-replaced subtree of the target subtree of the target node, so as to update the expression tree, and respectively take the root node of the target subtree and the root node of the remaining subtree of the target node as the target node again, and return to the step of performing the second preset operation for the target node; if the target node is a leaf node of the expression tree, determine that the expression tree conforms to the form of a simple conjunction; when the target subtree of the target node is the left subtree of the target node, the remaining subtree of the target node is the right subtree of the target node; when the target subtree of the target node is the right subtree of the target node, the remaining subtree of the target node is the left subtree of the target node.

[0016] In the above manner, each node in the expression tree of the dependency condition after the equivalent transformation of the first logical expression corresponds to an OR connective, an AND connective, or an independent proposition; for a target node, if the target node is a non-leaf node of the expression tree, perform a second preset operation to update the expression tree until the target node is a leaf node of the expression tree, then determine that the expression tree conforms to the form of a simple conjunction; thus, a realization method is provided for equivalently transforming the dependency condition after the equivalent transformation of the first logical expression into the form of a simple conjunction by performing transformations on the expression tree.

[0017] Optionally, parameter priorities are preset for each of the parameters to be measured; generating test parameters for each equivalence class of the value ranges of each of the parameters to be measured according to the second logical expression includes: for each sub-item separated by an "or" connective in the second logical expression, performing an equivalent transformation on the sub-item according to the equivalent transformation formula of discrete mathematics, so that the dependent values of the sub-item only include independent propositions that constrain the parameter to be measured with the lowest parameter priority in the sub-item, and taking the transformed logical expression as the third logical expression; taking each set of value ranges when the truth value of the independent proposition of each parameter to be measured in each sub-item of the third logical expression is true or false as an equivalence class in each equivalence class of the value ranges of each of the parameters to be measured; taking at least one set of random values in each equivalence class of each equivalence class as the test parameters generated by the equivalence class.

[0018] In the above manner, parameter priorities are preset for each of the parameters to be measured; for each sub-item separated by an "or" connective in the second logical expression, performing an equivalent transformation on the sub-item according to the equivalent transformation formula of discrete mathematics, so that the dependent values of the sub-item only include independent propositions that constrain the parameter to be measured with the lowest parameter priority in the sub-item, and taking the transformed logical expression as the third logical expression; since the dependent values in each sub-item need to be generated under dependent conditions, after presetting the parameter priorities, it is ensured that the parameter to be measured constrained in the dependent values has a parameter priority less than or equal to the parameter to be measured constrained in the dependent conditions, unifying the generation order of the parameters, thereby avoiding confusion caused by order conflicts when generating test parameters for each equivalence class in each equivalence class.

[0019] In a second aspect, the present invention provides a device for generating test parameters, including: an acquisition module, configured to acquire a first logical expression characterizing the dependency relationship between each parameter to be measured; the first logical expression includes a dependency condition and a dependency value associated by an implication connective, wherein the dependency condition and the dependency value include each independent proposition that constrains the value range of each parameter, or each independent proposition and each logical connective between each independent proposition; a processing module, configured to convert the first logical expression into a second logical expression, wherein each dependency value associated by an implication connective in the second logical expression only contains one independent proposition and the independent propositions in the dependency conditions of each implication connective meet the requirements of a simple conjunction; and configured to determine each equivalence class of the value ranges of each parameter to be measured according to the second logical expression, and generate test parameters for each equivalence class.

[0020] Optionally, the processing module is specifically configured to: perform conversion processing on the dependent values in the first logical expression according to a preset equivalent conversion formula to obtain the dependent conditions after the equivalent conversion of the first logical expression and the dependent values in the second logical expression; each dependent value associated with an implication connective after the conversion processing of the dependent values in the first logical expression only includes one independent proposition; according to the equivalent conversion formula, convert the dependent conditions after the equivalent conversion of the first logical expression into dependent conditions in the form of a simple conjunction, as the dependent conditions in the second logical expression.

[0021] Optionally, the preset equivalent transformation formula includes: Formula 1: p -> (q ∧ r) => (p -> q) ∧ (p -> r); Formula 2: p -> (q ∨ r) => (p ∨ (!r)) -> q; where p, q, and r each include at least one independent proposition, and none of p, q, and r include an implication connective; -> represents an implication connective; ∧ represents a conjunction connective; ∨ represents a disjunction connective;! represents a negation connective; => represents an equivalent transformation.

[0022] Optionally, the processing module is specifically configured to: establish an expression tree of the dependent conditions after the equivalent conversion of the first logical expression according to the dependent conditions after the equivalent conversion of the first logical expression; by using the expression tree algorithm, apply the equivalent conversion formula of discrete mathematics to the first logical expression, so as to convert the dependent conditions after the equivalent conversion of the first logical expression into dependent conditions in the form of a simple conjunction.

[0023] Optionally, the expression tree of the dependency condition after the equivalent transformation of the first logical expression is established through an expression tree stack and a symbol stack; the expression tree stack is used to store the expression tree; the symbol stack is used to store logical connectives or parentheses; specifically, the processing module is configured to: sequentially scan the dependency condition after the equivalent transformation of the first logical expression from left to right, and for each scanned scanning unit, perform a first preset operation on the scanning unit; use the expression tree obtained after scanning the dependency condition after the equivalent transformation of the first logical expression as the expression tree of the dependency condition after the equivalent transformation of the first logical expression; the first preset operation is: if the scanning unit is an independent proposition, push it onto the expression tree stack; if the scanning unit is a logical connective, and the top element of the symbol stack is not empty and the operation priority of the logical connective is lower than or equal to the priority of the logical connective at the top of the symbol stack, pop two expression trees from the expression tree stack, and push an expression tree generated according to the two expression trees and the scanning unit onto the expression tree stack; if the scanning unit is a logical connective, and the operation priority of the logical connective is higher than the priority of the logical connective at the top of the symbol stack or the top element of the symbol stack is empty, push the scanning unit onto the symbol stack; if the scanning unit is a left parenthesis, push the scanning unit onto the symbol stack, if the scanning unit is a right parenthesis, pop two expression trees from the expression tree stack, and generate an expression tree according to the logical connective at the top of the symbol stack and the two expression trees, and push the expression tree onto the expression tree stack.

[0024] Optionally, the expression tree of the dependency conditions after the equivalent transformation of the first logical expression is a binary tree, where each node corresponds to an OR connective, an AND connective, or an independent proposition; the expression tree algorithm is as follows: for a target node, if the target node is a non-leaf node of the expression tree, then perform a second preset operation; the second preset operation is: if the target node corresponds to an AND connective and the root node of the target subtree of the target node corresponds to an OR connective, then change the target node to correspond to an OR connective, change the root node of the target subtree and the root node of the remaining subtree of the target node to both correspond to AND connectives, and replace the left subtree (or right subtree) of the target subtree of the target node with the remaining subtree of the target node, and replace the remaining subtree of the target node with the tree formed by the remaining subtree of the target node and the non-replaced subtree of the target subtree of the target node, so as to update the expression tree, and respectively use the root node of the target subtree and the root node of the remaining subtree of the target node as the target node again, and return to the step of performing the second preset operation for the target node; if the target node is a leaf node of the expression tree, then determine that the expression tree conforms to the form of a simple conjunction; when the target subtree of the target node is the left subtree of the target node, the remaining subtree of the target node is the right subtree of the target node; when the target subtree of the target node is the right subtree of the target node, the remaining subtree of the target node is the left subtree of the target node.

[0025] Optionally, each of the parameters to be measured has a preset parameter priority; specifically, the processing module is configured to: for each sub-item separated by an OR connective in the second logical expression, perform an equivalent transformation on the sub-item according to the equivalent transformation formula of discrete mathematics, so that the dependency values of the sub-item only include independent propositions that constrain the parameter to be measured with the lowest parameter priority in the sub-item, and use the transformed logical expression as the third logical expression; take each set of value ranges when the truth values of the independent propositions of each parameter to be measured in each sub-item of the third logical expression are true or false as an equivalence class in the value ranges of the parameters to be measured; take at least one set of random values in each equivalence class of the equivalence classes as the test parameters generated by the equivalence class.

[0026] For the beneficial effects of the second aspect and each item of the second aspect, reference can be made to the beneficial effects of the first aspect and each item of the first aspect, which will not be elaborated here.

[0027] In a third aspect, the present invention provides a computer device, including a program or instruction, which when executed, is used to execute the optional methods of the first aspect and each item of the first aspect.

[0028] Fourthly, the present invention provides a storage medium, including programs or instructions, which, when executed, are used to execute the methods in the first aspect and various optional methods of the first aspect as described above. Description of the Drawings

[0029] Figure 1 It is a schematic flow chart of the steps of a method for generating test parameters provided by an embodiment of the present application;

[0030] Figure 2 It is a schematic diagram of the processing process of dependency value decomposition in a method for generating test parameters provided by an embodiment of the present application;

[0031] Figure 3 It is a schematic diagram of the processing process of the expression tree algorithm in a method for generating test parameters provided by an embodiment of the present application;

[0032] Figure 4 It is a schematic structural diagram of a device for generating test parameters provided by an embodiment of the present application. Detailed Embodiments

[0033] In order to better understand the above technical solutions, the above technical solutions will be described in detail below in conjunction with the accompanying drawings of the specification and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solutions of the present application, rather than limitations on the technical solutions of the present application. Without conflict, the technical features in the embodiments of the present application and the embodiments can be combined with each other.

[0034] The following first lists the noun definitions involved in the embodiments of the present application.

[0035] Parameter to be measured: The basic test unit in the software testing process and also the basic generation unit in the test generation process.

[0036] Independent proposition: A proposition that only restricts the legal value range of one parameter to be measured is called an independent proposition. For example, the parameter to be measured a > 0 only restricts the parameter to be measured a. Any proposition is formed by connecting or compounding independent propositions through logical connectives.

[0037] Logical connectives include the following: AND (conjunction connective, which can be represented by ∧), connecting two independent propositions, and taking the value of true when both are satisfied; OR (disjunction connective, which can be represented by ∨), connecting two events, and taking the value of true when one of them is satisfied; NOT (negation connective, which can be represented by!), following an independent proposition, and taking the value of true when the event is not satisfied; -> (implication connective), connecting two independent propositions, and taking the value of true when the former is false, or when the former is true and the latter is true. The meaning of the above dependency expression is that if parameter a = 3 and parameter b = 4, then either parameter c = 4 or parameter d = 4.

[0038] Dependence of parameters to be measured: During the test generation process, if the legal value range of a parameter A to be measured is affected by the value of another parameter B to be measured, it is said that there is a dependence of parameters to be measured between these two parameters to be measured. For example, a parameter such as a product category will affect the legal value range of product parameters. Among them, the parameter B to be measured that affects the legal value range of the parameter A to be measured is called the dependent parameter.

[0039] Dependence expression: A logical expression representing the dependence relationship between parameters to be measured. For example, (a = 3 ∧ b = 4) -> (c = 4 ∨ d = 4). Among them, a dependence expression containing an implication connective is called an implicative logical expression, and a dependence expression containing only one implication connective is called an independent implicative expression. It should be noted that in the embodiments of the present application, there is no compound implicative logical relationship in the implicative logical expression.

[0040] Dependence condition: The proposition on the left side of the implication connective in an implicative logical expression is called the dependence condition of this implicative logical expression, such as a = 3 ∧ b = 4 in (a = 3 ∧ b = 4) -> (c = 4 ∨ d = 4).

[0041] Dependent value: The proposition on the right side of the implication connective in an implicative logical expression is called the dependence condition of this implicative logical expression, such as c = 4 ∨ d = 4 in (a = 3 ∧ b = 4) -> (c = 4 ∨ d = 4).

[0042] During the operation of financial institutions (banking institutions, insurance institutions or securities institutions) in conducting business (such as loan business, deposit business, etc. of banks), various financial software will be used. There are multiple parameters involved in the software, and there may be a dependence relationship between the parameters. Therefore, before the software goes online, it is usually necessary to generate test parameters for the software to implement the test of the software. At present, a commonly used method in software testing is the equivalence class testing method, but currently, it is necessary to manually analyze and check the equivalence classes. This situation does not meet the needs of financial institutions such as banks and cannot ensure the efficient operation of various businesses of financial institutions.

[0043] For this reason, as Figure 1 shown, the embodiments of the present application provide a method for generating test parameters.

[0044] Step 101: Obtain a first logical expression representing the dependence relationship between the parameters to be measured.

[0045] Step 102: Convert the first logical expression into a second logical expression.

[0046] Step 103: Determine the equivalence classes of the value ranges of the parameters to be measured according to the second logical expression, and generate test parameters for the equivalence classes.

[0047] In step 101, the first logical expression includes a dependency condition and a dependency value associated by an implication connective, where each of the dependency condition and the dependency value includes each independent proposition that restricts the value range of each parameter, or each independent proposition and each logical connective between the independent propositions.

[0048] For example, the first logical expression can be E1 -> F1, where E1 is the dependency condition and F1 is the dependency value. Both E1 and F1 can include one independent proposition and multiple independent propositions. For example, E1 is (e1 ∧ e2 ∨ e3), and E1 can also be e4; F1 is (f1 ∧ f2), and F1 can also be f3; the first logical expression can also be E2 -> F2 ∧ E3 -> F3; where e1, e2, e3, e4, f1, f2, and f3 are all independent propositions.

[0049] In step 102, the dependency value associated with each implication connective in the second logical expression contains only one independent proposition, and the independent propositions in the dependency conditions of the implication connectives meet the requirements of a simple conjunction.

[0050] That is to say, for each independent implication expression in the second logical expression, the dependency value of the independent implication expression contains only one independent proposition, that is, it only restricts the value range of one parameter. In addition, the dependency conditions in the independent implication expression include multiple minterms connected by ∨. For example, in the independent implication expression E4 -> F4, E4 is E4-1 ∨ E4-2, and both E4-1 and E4-2 can be either one independent proposition or a compound proposition connected only by ∧ and!, and F4 is one independent proposition. The form of each independent implication expression in the second logical expression is also called a standardized implication expression.

[0051] For example, the form of the second logical expression is: G1 -> H1 ∧ G2 -> H2 ∧ G3 -> H3; G1 -> H1, G2 -> H2, and G3 -> H3 are all independent implication expressions, that is, none of G1, H1, G2, H2, G3, and H3 contain an implication connective; the independent propositions in the dependency conditions G1, G2, and G3 in each independent implication expression meet the requirements of a simple conjunction. For example, G1 is g1-1 ∧ g1-2 ∨ g1-3.

[0052] For example, the first logical expression is: (a = 3 ∧ b = 4) -> (c = 4 ∨ d = 4); then the second logical expression is:

[0053] (a = 3 ∧ b = 4 ∧ c ≠ 4) -> (d = 4).

[0054] It should be noted that the standardized dependency expression is not unique either. For example, the expression can also be expressed as:

[0055] (a = 3 ∧ c ≠ 4 ∧ d ≠ 4) -> (b ≠ 4).

[0056] In an alternative implementation of step 102, it can be executed in the following manner:

[0057] First step: According to the equivalent transformation formula of discrete mathematics, perform transformation processing on the dependent values in the first logical expression to obtain the dependent conditions after the equivalent transformation of the first logical expression and the dependent values in the second logical expression; each dependent value associated with the implication connectives after the transformation processing of the dependent values in the first logical expression only contains one independent proposition. The first step can be simply referred to as dependent value decomposition.

[0058] Second step: According to the equivalent transformation formula of discrete mathematics, convert the dependent conditions after the equivalent transformation of the first logical expression into dependent conditions in the form of a simple conjunctive formula, as the dependent conditions in the second logical expression. The second step can be simply referred to as dependent condition decomposition.

[0059] It should be noted that the first step makes the dependent values of each independent implication expression in the logical expression after the transformation of the first logical expression be independent propositions; the second step makes the dependent conditions of each independent implication expression in the logical expression after the transformation of the first logical expression be in the form of a simple conjunctive formula. The process of obtaining the second logical expression in step 102 is not limited to the method of first performing dependent value decomposition in the first step and then performing dependent condition decomposition in the second step. For example, it is possible not to convert the dependent values of the independent implication expression into independent propositions, first convert the dependent values of the independent implication expression into an independent implication expression with two independent propositions, then perform dependent condition decomposition, and then perform dependent value decomposition on the logical expression obtained after the dependent condition decomposition, as long as it is ultimately in the form of the second logical expression, and the specific intermediate process of how to transform in step 102 is not limited.

[0060] In an alternative implementation of the first step, the preset equivalent transformation formulas include: Formula 1: p -> (q ∧ r) => (p -> q) ∧ (p -> r); Formula 2: p -> (q ∨ r) => (p ∨ (!r)) -> q; where p, q, and r each include at least one independent proposition, and none of p, q, and r include an implication connective; -> represents an implication connective; ∧ represents a conjunction connective; ∨ represents a disjunction connective;! represents a negation connective; => represents an equivalent transformation.

[0061] For any independent implication expression, formula 1 or formula 2 can be recursively applied layer by layer, and the specific process is as Figure 2 shown.

[0062] First, determine whether there is a logical connective in the dependent value of the target independent implicative expression; if so, obtain the first logical connective that is not a negation connective in the outermost layer; if not, end the algorithm, and the dependent value of the target independent implicative expression is an independent proposition.

[0063] The outermost logical connective refers to one or more logical connectives with the lowest operation priority in the dependent value of the target independent implicative expression; initially, the target independent implicative expression can be any independent implicative expression in the first logical expression.

[0064] After obtaining the first logical connective that is not a negation connective in the outermost layer, perform the following steps:

[0065] If it is an AND connective (AND, ∧), then according to Formula 1, split the target independent implicative expression into two sub-target logical expressions, and respectively re-use the two sub-target independent implicative expressions as the target independent implicative expression, and return to the step of obtaining the first logical connective in the outermost layer of the target independent implicative expression, so as to perform recursive processing.

[0066] If it is an OR connective (OR, ∨), then according to Formula 2, move the expression after ∨ to the dependent condition of the target independent implicative expression.

[0067] For example, if q is the compound proposition a ∧ b; the first application according to Formula 1 gives: (p -> a ∧ b) ∧ (p -> r); then recursively process (p -> a ∧ b) to get: (p -> a) ∧ (p -> b) ∧ (p -> r).

[0068] It should be noted that according to the equivalent transformation formula of discrete mathematics, the equivalent transformation formula of discrete mathematics in the conversion process of the dependent value in the first logical expression is not limited either, as long as it is equivalent to Formula 1 and Formula 2.

[0069] For example, the equivalent formula of Formula 1 is Formula 3:

[0070] p -> q ∧ r =>!q ∨!r ->!p; Formula 3 can also achieve the purpose of decomposing the dependent value.

[0071] For example, the equivalent formula of Formula 2 is Formula 4:

[0072] p -> q ∨ r => (!q ∧!r) ->!p; Formula 4 can also achieve the purpose of decomposing the dependent value.

[0073] It should be noted that after the first-step decomposition of dependency value extraction, the dependency conditions will become more complex. Therefore, it is necessary to perform the second-step decomposition of dependency conditions to transform the dependency conditions obtained in the first step into the form of a simple conjunctive formula. It is worth mentioning that the dependency conditions in each independent implicative expression obtained in the first step must not contain the implicative connective, and can be obtained through the equivalent transformation formulas in discrete mathematics in the second step. For example, it can be obtained through formula five: (p ∨ q) ∧ r = (p ∧ r) ∨ (q ∧ r). If p or q or r is a compound proposition, it can be recursively processed.

[0074] In an alternative implementation manner of the second step, it can be executed in the following way:

[0075] Step (2-1): According to the dependency conditions after the equivalent transformation of the first logical expression, establish an expression tree of the dependency conditions after the equivalent transformation of the first logical expression.

[0076] Step (2-2): Through the expression tree algorithm, apply the equivalent transformation formulas in discrete mathematics to the first logical expression, so as to transform the dependency conditions after the equivalent transformation of the first logical expression into dependency conditions in the form of a simple conjunctive formula.

[0077] Specifically, in an alternative implementation manner of step (2-1), the expression tree of the dependency conditions after the equivalent transformation of the first logical expression is established through an expression tree stack and a symbol stack; the expression tree stack is used to store the expression tree; the symbol stack is used to store logical connectives or parentheses; the execution process of step (2-1) can be as follows:

[0078] Scan the dependency conditions after the equivalent transformation of the first logical expression from left to right in sequence. For each scanned unit, perform a first preset operation on the scanned unit; use the expression tree obtained after scanning the dependency conditions after the equivalent transformation of the first logical expression as the expression tree of the dependency conditions after the equivalent transformation of the first logical expression.

[0079] Among them, the first preset operation specifically includes (a) to (d):

[0080] (a) If the scanned unit is an independent proposition, push it into the expression tree stack.

[0081] (b) If the scanned unit is a logical connective, and the top element of the symbol stack is not empty and the operation priority of the logical connective is lower than or equal to the priority of the logical connective at the top of the symbol stack, pop two expression trees from the expression tree stack, and push an expression tree generated according to the two expression trees and the scanned unit into the expression tree stack.

[0082] (c) If the scanning unit is a logical connective, and the operation priority of the logical connective is higher than that of the logical connective at the top of the symbol stack or the element at the top of the symbol stack is empty, then push the scanning unit onto the symbol stack.

[0083] (d) If the scanning unit is a left parenthesis, then push the scanning unit onto the symbol stack. If the scanning unit is a right parenthesis, then pop two expression trees from the expression tree stack, and generate an expression tree based on the logical connective at the top of the symbol stack and the two expression trees, and push the expression tree onto the expression tree stack.

[0084] For example, the dependency condition after equivalent transformation of the first logical expression is a ∧ (b ∨ c).

[0085] The first scan: The elements in the expression tree stack from top to bottom are a.

[0086] The second scan: The elements in the expression tree stack from top to bottom are a; the elements in the symbol stack from top to bottom are ∧.

[0087] The third scan: The elements in the expression tree stack from top to bottom are a; the elements in the symbol stack from top to bottom are (, ∧.

[0088] The fourth scan: The elements in the expression tree stack from top to bottom are a, b; the elements in the symbol stack from top to bottom are (, ∧.

[0089] The fifth scan: The elements in the expression tree stack from top to bottom are a, b; the elements in the symbol stack from top to bottom are ∨ (∧.

[0090] The sixth scan: The elements in the expression tree stack from top to bottom are a, b, c; the elements in the symbol stack from top to bottom are ∨ (∧.

[0091] The seventh scan: The elements in the expression tree stack from top to bottom are a, (b ∨ c); the elements in the symbol stack from top to bottom are ∧.

[0092] The eighth scan: The elements in the expression tree stack from top to bottom are a ∧ (b ∨ c); the elements in the symbol stack from top to bottom are empty.

[0093] Specifically, in an optional implementation manner of step (2-2), the expression tree of the dependency condition after equivalent transformation of the first logical expression is a binary tree, where each node corresponds to an OR connective, an OR, an AND connective, or an independent proposition; the specific expression tree algorithm is as follows:

[0094] For the target node, if the target node is a non-leaf node of the expression tree, then perform a second preset operation; if the target node is a leaf node of the expression tree, then determine that the expression tree conforms to the form of a simple conjunctive formula.

[0095] The specific second preset operation is as follows:

[0096] If the target node corresponds to an OR connective and the root node of the target subtree of the target node corresponds to an OR connective, then make the target node correspond to an OR connective, make the root node of the target subtree of the target node and the root node of the remaining subtree both correspond to an AND connective, replace the left subtree (or right subtree) of the target subtree of the target node with the remaining subtree of the target node, and replace the remaining subtree of the target node with a tree composed of the remaining subtree of the target node and the non-replaced subtree of the target subtree of the target node, so as to update the expression tree. Then, make the root node of the target subtree of the target node and the root node of the remaining subtree be the target node respectively, and return to the step of performing the second preset operation on the target node.

[0097] The above processing process for the target node is as Figure 3 shown. When the target node corresponds to an AND connective and the root node of the target subtree (the subtree composed of a and b) of the target node corresponds to an OR connective, then make the target node correspond to an OR connective, make the root node of the target subtree (the subtree composed of a and b) of the target node and the root node of the remaining subtree (c) both correspond to an AND connective, replace a (or b) with c, and replace the remaining subtree of the target node with a tree b (or a) composed of c and the non-replaced subtree of the target subtree of the target node.

[0098] When the target subtree of the target node is the left subtree of the target node, the remaining subtree of the target node is the right subtree of the target node; when the target subtree of the target node is the right subtree of the target node, the remaining subtree of the target node is the left subtree of the target node.

[0099] It should be noted that the above implementation actually moves the node corresponding to the OR connective (OR, ∨) gradually upward until there is no node corresponding to the OR connective (∨) below the node corresponding to the AND connective (∧). The logical expression corresponding to the obtained expression tree is the logical expression in the form of a simple conjunctive formula.

[0100] After obtaining the second logical expression through steps 101 and 102, a situation of order conflict of the parameters to be measured may occur. For example, for two different parameters to be measured, in two different independent implicative expressions, they appear in the dependent condition and the dependent value respectively. For example, the second logical expression is (a = 4) -> (b = 4) ∧ (b = 3) -> (a = 3), which means that b = 4 is taken under the dependent condition of a = 4 and a = 4 is taken under the dependent condition of b = 3. That is to say, one requires generating parameter a first and the other requires generating parameter b first, which will lead to that it is inappropriate to generate parameter a first and generate parameter b first when generating parameters.

[0101] To this end, in step 103, the above situation can be avoided by eliminating the loop therein. Specifically, the priority order of the parameters can be set arbitrarily, and in each normalized expression, the parameter with the lowest priority is transformed to the right side of the conditional expression.

[0102] In an optional implementation manner of step 103, the parameters to be measured preset parameter priorities; step 103 may specifically include:

[0103] Step (3-1): For each sub-item separated by the disjunctive connective in the second logical expression, according to the equivalent transformation formula of discrete mathematics, perform equivalent transformation on the sub-item so that the dependent value of the sub-item only includes the independent proposition that restricts the parameter to be measured with the lowest priority in the sub-item, and use the transformed logical expression as the third logical expression.

[0104] Step (3-2): Take each set of value ranges when the truth value of the independent proposition of each parameter to be measured in each sub-item of the third logical expression is true or false as an equivalent class in each equivalent class of the value ranges of the parameters to be measured.

[0105] Step (3-3): Take at least one set of random values in each equivalent class of the equivalent classes as the test parameters generated by the equivalent class.

[0106] For example, if the priority order of the parameters is a, b, c, then the second logical expression (a = 3 ∧ c = 3) -> (b = 4) can be transformed into the third logical expression (a = 3 ∧!b = 4) -> (!c = 3); another example is that the second logical expression (a = 4) -> (b = 4) ∧ (b = 3) -> (a = 3) can be transformed into the third logical expression (a = 4) -> (b = 4) ∧ (!a = 3) -> (!b = 3), so that no conflict will be formed.

[0107] In addition, in steps (3-2) to (3-3), for example, when the third logical expression is (a = 4) -> (b = 4) ∧ (!a = 3) -> (!b = 3), then (a = 4) can be true or false; (b = 4) can be true or false; (!a = 3) can be true or false; (!b = 3) can be true or false. Each combination of the 16 value combinations formed becomes an equivalent class.

[0108] Under the above-described embodiment, by reorganizing the dependencies of the parameters to be measured, the dependency situation of each parameter to be measured can be seen more clearly. During subsequent automated test generation, it is possible to know at any time the legal and illegal value ranges of the currently generated parameters. After the equivalent class partitioning, there is no need to generate excessive redundant data in the test. After setting the priorities of the parameters to be measured, there will be no confusion in test parameter generation due to parameter order conflicts, thereby improving the quality of test data and the efficiency of testing.

[0109] As Figure 4 shown, the present invention provides a test parameter generation device, including: an acquisition module 401, configured to acquire a first logical expression representing the dependencies between the parameters to be measured; the first logical expression includes a dependency condition and a dependency value associated by an implication connective, where the dependency condition and the dependency value include each independent proposition that restricts the value range of each parameter, or, each independent proposition and each logical connective between each independent proposition; a processing module 402, configured to convert the first logical expression into a second logical expression, where each dependency value associated by each implication connective in the second logical expression includes only one independent proposition and each independent proposition in the dependency condition of each implication connective conforms to the requirements of a simple conjunction form; and configured to determine the value ranges of the parameters to be measured as equivalent classes according to the second logical expression, and generate test parameters for each equivalent class.

[0110] Optionally, the processing module 402 is specifically configured to: perform a conversion process on the dependency value in the first logical expression according to a preset equivalent conversion formula to obtain the dependency condition after the equivalent conversion of the first logical expression and each dependency value in the second logical expression; each dependency value associated by each implication connective after the conversion process of the dependency value in the first logical expression includes only one independent proposition; and convert the dependency condition after the equivalent conversion of the first logical expression into a dependency condition in a simple conjunction form according to the equivalent conversion formula as the dependency condition in the second logical expression.

[0111] Optionally, the preset equivalent transformation formula includes: Formula 1: p -> (q ∧ r) => (p -> q) ∧ (p -> r); Formula 2: p -> (q ∨ r) => (p ∨ (!r)) -> q; where p, q, and r each include at least one independent proposition, and none of p, q, and r include an implication connective; -> represents the implication connective; ∧ represents the conjunction connective; ∨ represents the disjunction connective;! represents the negation connective; => represents equivalent transformation.

[0112] Optionally, the processing module 402 is specifically configured to: establish an expression tree for the dependency condition after equivalent transformation of the first logical expression according to the dependency condition after equivalent transformation of the first logical expression; by using the expression tree algorithm, apply the equivalent transformation formula of discrete mathematics to the first logical expression, so as to convert the dependency condition after equivalent transformation of the first logical expression into a dependency condition in the form of a simple conjunction.

[0113] Optionally, the expression tree for the dependency condition after equivalent transformation of the first logical expression is established through an expression tree stack and a symbol stack; the expression tree stack is used to store the expression tree; the symbol stack is used to store logical connectives or parentheses; the processing module 402 is specifically configured to: sequentially scan the dependency condition after equivalent transformation of the first logical expression from left to right, and perform a first preset operation on the scanned unit for each scanned unit; use the expression tree obtained after scanning the dependency condition after equivalent transformation of the first logical expression as the expression tree for the dependency condition after equivalent transformation of the first logical expression; the first preset operation is: if the scanned unit is an independent proposition, push it onto the expression tree stack; if the scanned unit is a logical connective, and the top element of the symbol stack is not empty and the operation priority of the logical connective is lower than or equal to the priority of the logical connective at the top of the symbol stack, pop two expression trees from the expression tree stack, and push an expression tree generated according to the two expression trees and the scanned unit onto the expression tree stack; if the scanned unit is a logical connective, and the operation priority of the logical connective is higher than the priority of the logical connective at the top of the symbol stack or the top element of the symbol stack is empty, push the scanned unit onto the symbol stack; if the scanned unit is a left parenthesis, push the scanned unit onto the symbol stack, if the scanned unit is a right parenthesis, pop two expression trees from the expression tree stack, and generate an expression tree according to the logical connective at the top of the symbol stack and the two expression trees, and push the expression tree onto the expression tree stack.

[0114] Optionally, the expression tree of the dependency conditions after the equivalent transformation of the first logical expression is a binary tree, where each node corresponds to an OR connective, an AND connective, or an independent proposition; the expression tree algorithm is as follows: for a target node, if the target node is a non-leaf node of the expression tree, then perform a second preset operation; the second preset operation is: if the target node corresponds to an AND connective and the root node of the target subtree of the target node corresponds to an OR connective, then make the target node correspond to an OR connective, make the root node of the target subtree and the root node of the remaining subtree of the target node both correspond to an AND connectives, and replace the left subtree (or right subtree) of the target subtree of the target node with the remaining subtree of the target node, and replace the remaining subtree of the target node with the tree formed by the remaining subtree of the target node and the non-replaced subtree of the target subtree of the target node, so as to update the expression tree, and respectively use the root node of the target subtree and the root node of the remaining subtree of the target node as the target node again, and return to the step of performing the second preset operation for the target node; if the target node is a leaf node of the expression tree, then determine that the expression tree conforms to the form of a simple conjunction; when the target subtree of the target node is the left subtree of the target node, the remaining subtree of the target node is the right subtree of the target node; when the target subtree of the target node is the right subtree of the target node, the remaining subtree of the target node is the left subtree of the target node.

[0115] Optionally, parameter priorities are preset for each parameter to be measured; specifically, the processing module 402 is configured to: for each sub-item separated by an OR connective in the second logical expression, perform an equivalent transformation on the sub-item according to the equivalent transformation formula of discrete mathematics, so that the dependency values of the sub-item only include independent propositions that constrain the parameter to be measured with the lowest parameter priority in the sub-item, and use the transformed logical expression as the third logical expression; use each set of value ranges when the truth value of the independent proposition of each parameter to be measured in each sub-item of the third logical expression is true or false as an equivalence class in the value ranges of each parameter to be measured; use at least one set of random values in each equivalence class of the equivalence classes as the test parameters generated by the equivalence class.

[0116] An embodiment of the present application provides a computer device, including a program or instruction, which when executed, is used to execute a method for generating test parameters provided by an embodiment of the present application and any optional method.

[0117] An embodiment of the present application provides a storage medium, including a program or instruction, which when executed, is used to execute a method for generating test parameters provided by an embodiment of the present application and any optional method.

[0118] Finally, it should be noted that those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) that contain computer-usable program code.

[0119] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the processes Figure 1 or multiple processes and / or blocks

[0120] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one or more of the processes Figure 1 or multiple processes and / or blocks

[0121] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. A method for generating test parameters, characterized in that, it includes: obtaining a first logical expression representing the dependency relationship between the parameters to be tested; the first logical expression includes a dependency condition and a dependency value associated by an implication connective, wherein the dependency condition and the dependency value include independent propositions that restrict the value ranges of the parameters, and logical connectives between the independent propositions; converting the first logical expression into a second logical expression, where the dependency values associated by the implication connectives in the second logical expression only contain one independent proposition and the independent propositions in the dependency conditions of the implication connectives meet the requirements of a simple conjunction; determining equivalence classes of the value ranges of the parameters to be tested according to the second logical expression, and generating test parameters for the equivalence classes; wherein, converting the first logical expression into a second logical expression includes: according to the dependency condition after equivalent transformation of the first logical expression, establishing an expression tree of the dependency condition after equivalent transformation of the first logical expression; the expression tree of the dependency condition after equivalent transformation of the first logical expression is established through an expression tree stack and a symbol stack; the expression tree stack is used to store the expression tree; the symbol stack is used to store logical connectives or parentheses; through an expression tree algorithm, applying a preset equivalent transformation formula to the first logical expression, so as to convert the dependency condition after equivalent transformation of the first logical expression into a dependency condition in the form of a simple conjunction.

2. The method according to claim 1, characterized in that, the conversion of the first logical expression into the second logical expression further includes: performing a conversion process on the dependency value in the first logical expression according to a preset equivalent transformation formula to obtain the dependency condition after equivalent transformation of the first logical expression and the dependency values in the second logical expression; the dependency values associated by the implication connectives after the conversion process of the dependency value in the first logical expression only contain one independent proposition.

3. The method according to claim 1, characterized in that, the preset equivalent transformation formula includes: Formula 1: p->(q∧r)=>(p->q)∧(p->r); Formula 2: p->(q∨r)=>(p∨(!r))->q; wherein, p, q, and r each include at least one independent proposition, and none of p, q, and r include an implication connective; -> represents an implication connective; ∧ represents a conjunction connective; ∨ represents a disjunction connective;! represents a negation connective; => represents an equivalent transformation.

4. The method according to claim 1, characterized in that, the establishment of the expression tree of the dependency condition after equivalent transformation of the first logical expression according to the dependency condition after equivalent transformation of the first logical expression includes: Scan the dependency conditions after the equivalent transformation of the first logical expression sequentially from left to right. For each scanned unit, perform a first preset operation on the scanned unit; use the expression tree obtained after scanning the dependency conditions after the equivalent transformation of the first logical expression as the expression tree of the dependency conditions after the equivalent transformation of the first logical expression. The first preset operation is as follows: If the scanned unit is an independent proposition, push it onto the expression tree stack; if the scanned unit is a logical connective, and the top element of the symbol stack is not empty and the operation priority of the logical connective is lower than or equal to the priority of the logical connective at the top of the symbol stack, pop two expression trees from the expression tree stack, and push an expression tree generated according to the two expression trees and the scanned unit onto the expression tree stack; if the scanned unit is a logical connective, and the operation priority of the logical connective is higher than the priority of the logical connective at the top of the symbol stack or the top element of the symbol stack is empty, push the scanned unit onto the symbol stack; if the scanned unit is a left parenthesis, push the scanned unit onto the symbol stack, if the scanned unit is a right parenthesis, pop two expression trees from the expression tree stack, and generate an expression tree according to the logical connective at the top of the symbol stack and the two expression trees, and push the expression tree onto the expression tree stack.

5. The method according to claim 1, wherein, the expression tree of the dependency conditions after the equivalent transformation of the first logical expression is a binary tree, where each node corresponds to an OR connective, an AND connective, or an independent proposition; the expression tree algorithm is as follows: For a target node, if the target node is a non-leaf node of the expression tree, perform a second preset operation; the second preset operation is as follows: If the target node corresponds to an AND connective, and the root node of the target subtree of the target node corresponds to an OR connective, change the target node to correspond to an OR connective, change the root node of the target subtree and the root node of the remaining subtree of the target node to both correspond to AND connectives, and replace the left subtree or the right subtree of the target subtree of the target node with the remaining subtree of the target node, and replace the remaining subtree of the target node with a tree composed of the remaining subtree of the target node and the non-replaced subtree of the target subtree of the target node, so as to update the expression tree, and respectively use the root node of the target subtree and the root node of the remaining subtree of the target node as the target node again, and return to the step of performing the second preset operation for the target node; if the target node is a leaf node of the expression tree, determine that the expression tree conforms to the form of a simple conjunction; when the target subtree of the target node is the left subtree of the target node, the remaining subtree of the target node is the right subtree of the target node; when the target subtree of the target node is the right subtree of the target node, the remaining subtree of the target node is the left subtree of the target node.

6. The method according to any one of claims 1-5, wherein, Each of the parameters to be measured has a preset parameter priority; generating test parameters for each equivalence class of the value ranges of the parameters to be measured according to the second logical expression includes: For each sub-item separated by an "or" connective in the second logical expression, perform an equivalent transformation on each sub-item according to the preset equivalent transformation formula, so that the dependent values of each sub-item only include independent propositions that constrain the parameter with the lowest priority among the parameters to be measured in each sub-item, and use the transformed logical expression as the third logical expression; Take each set of value ranges when the truth value of the independent proposition of each parameter to be measured in each sub-item of the third logical expression is true or false as an equivalence class among the equivalence classes of the value ranges of the parameters to be measured; Take at least one set of random values in each equivalence class of the equivalence classes as the test parameters generated for the equivalence class.

7. A device for generating test parameters, Characterized in that it includes: An acquisition module for acquiring a first logical expression characterizing the dependency relationship between the parameters to be measured; The first logical expression includes a dependency condition and a dependency value associated by an implication connective, where the dependency condition and the dependency value include independent propositions that constrain the value ranges of the parameters, or, the independent propositions and the logical connectives between the independent propositions; A processing module for converting the first logical expression into a second logical expression, where the dependency value associated with each implication connective in the second logical expression only contains one independent proposition and the independent propositions in the dependency conditions of the implication connectives meet the requirements of a simple conjunction; and for determining each equivalence class of the value ranges of the parameters to be measured according to the second logical expression and generating test parameters for each equivalence class; Among them, converting the first logical expression into a second logical expression includes: establishing an expression tree of the dependency condition after equivalent transformation of the first logical expression according to the dependency condition after equivalent transformation of the first logical expression; the expression tree of the dependency condition after equivalent transformation of the first logical expression is established through an expression tree stack and a symbol stack; the expression tree stack is used to store the expression tree; the symbol stack is used to store logical connectives or parentheses; through an expression tree algorithm, apply the preset equivalent transformation formula to the first logical expression, so as to convert the dependency condition after equivalent transformation of the first logical expression into a dependency condition in the form of a simple conjunction.

8. A computer device, Characterized in that it includes a program or instruction, and when the program or instruction is executed, the method according to any one of claims 1 to 6 is executed.

9. A storage medium, Characterized in that it includes a program or instruction, and when the program or instruction is executed, the method according to any one of claims 1 to 6 is executed.

Citation Information

Patent Citations

  • Method and device for automatically generating test scheduling based on use case dependencies

    CN105824746A

  • Method and device for determining dependency relationship between tasks

    CN110609740A