1. Approximate ideas
① first imports the WSDL document, parses it, generates a WSDL tree or any representation, gets the type of input data and constraints , and then produces the corresponding test data for the type constraint (generation principles such as 1).
Model Generation steps:
There are several steps to building a model for input data:
First step : Take the name of a complex data type as the initial node (root node).
Second Step : If one of the child elements of the root node is still a complex data type, then a node of that child complex type is generated, and the other one is an edge with the name of the child complex type, which points to the node of the child complex type.
Step Three: if a child element of the root node is a primitive type (a simple data type), then a node of that base type is generated, and an edge is generated that is named after the element name of the element to point to the node of that base type.
Fourth Step: If a child element of the root node is a derived type (a simple data type), you need to generate 4 builds consisting of two nodes and two edges, two nodes as a base type of the derived type node and a constraint node that contains the constraint values. Two edges are an edge named after the derived type, which points from the root node to a node of the base type of the derived type, and an edge with the name of the constraint name, which points from the node of the custom type base type to the constraint node.
Fifth step: for each sub-complex data element in the input element by repeating the first step to the fourth step to establish the type model, finally get the INPUT element data type model, that is, the WSDL data type model, can be used for subsequent test data generation.
In the resulting data type model, if a node no longer has an edge pointing to another node, that node typically represents a constraint on a primitive type or a simple data type.
② Simple data type test data generation:
First, the constraints on the simple data types are extracted and generated by the black Box test method (equivalence class partitioning, boundary value analysis, error analysis).
③ Complex data types are simple data types + complex element data structure relationships (sequence, all, choice).
Sequence: All child elements appear in order and appear only once. Cartesian product by order
All: Any child elements can appear without appearing, in order. Random Sequence
Choice: All Sub-# # # title # #素只出现其中一个. randomly select a child element
2. # # Framework
The ① GUI module , which is implemented by Html+jquery, is responsible for uploading WSDL files, displaying data constraints after WSDL parsing, and allowing the tester to eliminate the need to modify editing constraints.
②WSDL Modeling module : Use WSDL4J to parse the WSDL file to form a data structure for constraint, SimpleType, ComplexType, type class.
③ test Data Generation module: JAXB technology is a technique that can generate Java classes based on XML schemas.
④ Constraint Variant module:
⑤ Data Filtering module:
3. # # Effect
Automatic generation technology of test data based on WSDL