CN111858301B - Change history-based composite service test case set reduction method and device - Google Patents

Change history-based composite service test case set reduction method and device Download PDF

Info

Publication number
CN111858301B
CN111858301B CN202010503066.8A CN202010503066A CN111858301B CN 111858301 B CN111858301 B CN 111858301B CN 202010503066 A CN202010503066 A CN 202010503066A CN 111858301 B CN111858301 B CN 111858301B
Authority
CN
China
Prior art keywords
change
record
message
service
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010503066.8A
Other languages
Chinese (zh)
Other versions
CN111858301A (en
Inventor
林欣堂
张海波
夏晖
余良将
方湘艳
陈璇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
709th Research Institute of CSIC
Original Assignee
709th Research Institute of CSIC
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 709th Research Institute of CSIC filed Critical 709th Research Institute of CSIC
Priority to CN202010503066.8A priority Critical patent/CN111858301B/en
Publication of CN111858301A publication Critical patent/CN111858301A/en
Application granted granted Critical
Publication of CN111858301B publication Critical patent/CN111858301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for reducing a combined service test case set based on change history, wherein the method comprises the following steps: extracting service combination flow description, a message list and a variable list of messages in a combined Web service description document from a historical record for analyzing combined Web service projects needing to be maintained; constructing a change record library related to service change, defining and constructing a BPEL flow graph, and determining a node set, an edge set, a starting node and a terminating node; comparing the combined Web service flow graph before and after the change according to the BPEL flow graph, acquiring the name of the changed node, determining the change type, generating a change record and adding the change record into the change record library; and according to the change record set in the change record library, dividing various change types into equivalence classes, selecting representative test cases from the equivalence classes, and reducing the test suite. The invention can improve the testing efficiency of the combined Web service and reduce the testing cost.

Description

Change history-based composite service test case set reduction method and device
Technical Field
The invention belongs to the technical field of Web services, and particularly relates to a method and a device for reducing a combination service test case set based on change history, which can effectively solve the problem that a case set reduction method is lacked in the current combination Web service regression test, and simultaneously improve the case selection efficiency of the combination Web service change test.
Background
With the rapid development of internet technology, web services are widely used and play a crucial role. Simple Web services can only provide limited functions, and in order to implement complex service functions, multiple Web services are usually combined and run, that is, more complex services are flexibly implemented by using existing services. During the software lifecycle, each of the Web services that make up the combination of Web services is in a process of continuous evolutionary change. In addition, business process reorganization or service replacement in a composite service may also result in composite service changes, which are collectively referred to as Web service composite changes. When a change occurs, a change test must be performed to check whether a new defect is introduced.
Common problems in composite Web service maintenance are: after the service is changed, the stability of the whole system is difficult to guarantee, and the newly added service generally needs to be in running-in with the original service; regression testing for service changes is difficult to sequence, reduce, and select test cases because of the limited information available. These situations greatly increase maintenance costs and are a major challenge facing quality assurance of composite Web services. One effective solution to these problems is to combine more existing Web service profile information and change history when reducing combined Web service change test cases. In other words, standardized service description documents such as OWL _ S, WSDL, XSD, BPEL, and the like need to be analyzed, and on the basis, the specific operation types (addition, deletion, or modification) of changes are specified in combination with the history of service changes, so that test cases in the Web service changes are reduced and combined, and the test efficiency is further improved. However, since the Web service provides only interface information, and in the evolution of the composite service, the process for change history is very limited.
Disclosure of Invention
The invention mainly aims to research a method capable of efficiently reducing the combined Web service change test case, particularly needs to screen Web service description documents and change history records, makes up the defects of the current combined Web service change test case reduction method and effectively ensures the quality of the combined Web service.
In a first aspect of the present invention, a method for reducing a set of composite service test cases based on change history is provided, where the method includes:
s1, extracting service combination flow description, a message list and a message variable list in a combined Web service description document from a historical record for analyzing aiming at a combined Web service item needing to be maintained;
s2, constructing a change record library related to service change, defining and constructing a BPEL flow graph, and determining a node set, an edge set, an initial node and a termination node;
s3, comparing the combined Web service flow diagrams before and after change according to the BPEL flow diagram, acquiring the name of the changed node, determining the change type, generating a change record and adding the change record into a change record library;
and S4, according to the change record set in the change record library, dividing the various change types into equivalence classes, selecting representative test cases from the equivalence classes, and reducing the test suite.
Preferably, the step S1 specifically includes the following sub-steps:
s11, extracting a service combination flow: analyzing the combined Web service description document, extracting sequence tag information, performing sequencing traversal on the content in the sequence tag, and generating an analysis tree containing BPEL flow information;
s12, extracting a message list: analyzing the combined Web service description document, extracting variable tag information, and extracting and storing a message entity according to a corresponding WSDL document;
s13, extracting a variable list of the message: and analyzing the WSDL document according to the member variables defined in the message entity, and acquiring specific constraint contents in the WSDL document or accessing an XSD document to acquire detailed descriptions.
Preferably, in the step S2, the specific process of constructing a change record library related to the service change is as follows:
initializing a Mysql database, storing all change records in a table, wherein the column information of each row of change record is a serial number, calling a path, changing types, clustering ids, names, namespaces, operation types and changing contents >; the operation type comprises addition, deletion or modification;
if the change record contains a plurality of changes, the change record is divided into a plurality of sub-change records.
Preferably, in step S2, the defining and constructing a BPEL flow graph specifically includes:
constructing a BPEL flow graph BFG = { N, E, s, F }, wherein N is a node set, N = { IN, NN, SN, EN, MN, CN }, E is an edge set, E = { CE, ME }, s is a starting node, and F is a terminating node set; IN a node set N, IN represents interactive nodes, NN represents common nodes, SN represents service nodes, EN represents mutual exclusion nodes, MN represents multi-branch/combination nodes, and CN represents concurrent nodes; CE represents the structure-related edge, ME represents the information exchange-related edge; IN the node set N, nodes NN, EN, MN and CN are structure type nodes, and nodes IN and SN are message type nodes.
Preferably, the step S3 specifically includes:
s31, comparing BFG graphs in change history records of two continuous versions of structural nodes NN, EN, MN and CN, extracting changed structural class changes, determining change types according to node types, and generating change record labels of change information to be added into a change record library;
s32, comparing the BFG graphs IN the change history records of the two continuous versions for the nodes IN and SN, extracting the changed nodes IN and SN, and obtaining the message class change:
if the type of the change is addition or deletion, the change type is MA or MD;
if the change type is changed, the change information is generated into a change record label and added into a change record library.
Preferably, the step S4 specifically includes:
dividing the test cases in the test suite into a single Web service test and a combined Web service test, acquiring a classified combined Web service change record set from the change record library, and reading change records;
for the structure class change based on NN, EN, MN and CN nodes, further converting a BPEL flow graph into a BPEL control dependency graph with dependency relationship, acquiring the dependency relationship, transforming the sequence of test cases according to the dependency relationship, and testing corresponding node sets;
for the message class change based on MA, MD, MVA, MVE and MVD, searching a corresponding test case according to the message change record, and testing the changed service;
and acquiring a test case set reduced under the change, reading the next change record and performing the same treatment until all changes based on the history record in the change record library are searched after the treatment.
In a second aspect of the present invention, a combinational service test case set reduction apparatus based on change history is provided, the apparatus includes:
the information extraction module: the system is used for extracting a message list, a message variable list and a service combination flow description in a description document from a historical record for a combined Web service project needing to be maintained and analyzing;
change record library: for recording service changes;
a flow graph construction module: the method comprises the steps of defining and constructing a BPEL flow graph, and determining a node set, an edge set, a starting node and a terminating node;
a change extraction module: the Web service flow graph is used for comparing the combined Web service flow graph before and after change according to the BPEL flow graph, acquiring the name of the changed node, determining the change type, generating a change record and adding the change record into the change record library;
a type reduction module: and the test suite reduction module is used for dividing various change types into equivalence classes according to the change record set in the change record library, and selecting representative test cases from the equivalence classes to reduce the test suite.
Preferably, the change extraction module specifically includes:
structure class change extraction means: for structural nodes NN, EN, MN and CN, comparing BFG graphs in change history records of two continuous versions, extracting changed structural class changes, determining change types according to node types, and generating change record labels of change information to be added into a change record library;
message class change extraction means: for nodes IN and SN, comparing BFG graphs IN change history records of two continuous versions, extracting changed nodes IN and SN, and obtaining message class change:
if the type of the change is addition or deletion, the change type is MA or MD;
if the change information is changed, accessing and analyzing the WSDL document to which the message belongs, searching for a message label which accords with the name of the change message, analyzing variable information of the message label, comparing the variable information with original variable information in a historical record, judging whether the change occurs, determining the change type according to the addition of MVA, the modification of MVE or the deletion of MVD of the variable if the change occurs, and generating a change record label of the change information and adding the change record label into the change record library.
Preferably, the type reduction module specifically includes:
structure class change reduction unit: acquiring a change record, further converting a BPEL flow graph into a BPEL control dependency graph with dependency relationship for the structure class change based on NN, EN, MN and CN nodes, acquiring the dependency relationship, transforming the sequence of test cases according to the dependency relationship, and testing corresponding node sets;
message class change reduction unit: and acquiring a change record, searching a corresponding test case for message class change based on MA, MD, MVA, MVE and MVD according to the message change record, and testing the changed service.
The invention has the beneficial effects that:
the invention extracts the change related information by comparing the information difference between two continuous versions of the combined Web service. And establishing an incidence relation between the change and the existing test case library, and reducing the test cases required by the change of the combined Web services of the same type to obtain a simplified test case set, so that the test efficiency is further improved, and the test cost is reduced.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the technical description of the present invention will be briefly introduced below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive labor.
Fig. 1 is a schematic flow chart of a method for reducing a set of composite service test cases based on change history according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a process for obtaining service change elements according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a process of extracting change records based on change history according to an embodiment of the present invention;
fig. 4 is a simplified schematic diagram of performing a test case according to a change type according to an embodiment of the present invention.
Detailed Description
The invention mainly provides a method for reducing a combined service test case set based on change history. First, the present invention focuses on the correspondence between the combined Web service description document and the change, and the focus is to determine the position where the change occurs (replacement of a single Web service or change of a combined flow). Secondly, the invention needs to process the extraction of the history record of the change information of the combined Web service, and extracts the relevant change information by comparing the information difference between two continuous versions of the combined Web service. And finally, establishing an incidence relation between the change and the existing test case library, and reducing the test cases required by the change of the combined Web services of the same type to obtain a simplified version test case set. In view of the above tasks, the work and contributions of the present invention are as follows:
1. and finding the corresponding relation between the combined Web service description document and the service change. The invention divides the change of the combined Web service into three categories of change (condition, sequence, cycle, etc.) of the combined Web service flow, change (modification) of the service message and change (addition and deletion) of the service variable. Aiming at the combined Web service project needing to be maintained, the structure of the project and the message in the service called by the project are analyzed, and the service combined flow description, the message list and the variable list of the message in the combined Web service description document in each historical record version are extracted. The formal representation of different histories may change, i.e., the service changes.
2. And finishing the extraction of the history record of the change information of the combined Web service. When the combined Web service is changed, the relevant document is compared with the history record, and the position where the change occurs is determined. For the change of the combined Web service flow, specific change types are obtained through comparison of the BPEL flow graph, such as newly building an activity, deleting an activity and changing a branch judgment statement; for the change of the service variable and the change of the service message, the following information is obtained in a static analysis mode: and developing detection of service message change on a BPEL flow chart, acquiring variables in the message after detecting the changed message, and analyzing the change of the service variables by adopting a document comparison mode.
3. And reducing test cases required by the change of the same type of combined Web service. The test cases of the combined Web service are divided into two types, namely a test case of a single Web service message and a test case of a combined flow, and the test cases need to be developed according to the two types when the test suite is reduced, equivalent classes are divided based on different change types (the change of a service variable, the change of a service message and the change of the combined Web service flow), and then representative test cases are selected to reduce the test suite.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the present invention provides a method for reducing a combinational service test case set based on a change history, the method comprising:
s1, extracting business combination Process description (BPEL Process), message list (BPEL variables) and message variable list (WSDL types) in a combined Web service description document from a historical record for a combined Web service project needing to be maintained and analyzing;
further, for a combined Web service project which needs to be maintained, a service change element including a combined Web service flow, a service message and a service variable is obtained from a history record of the combined Web service project, please refer to fig. 2, a schematic diagram of a flow of the service change element is obtained in the present invention, and the step S1 specifically includes the following sub-steps:
s11, extracting a service combination flow: analyzing the combined Web service description document (BPEL file), extracting sequence tag information, taking Entry as a root node, performing sequencing traversal on the content in the < sequence > </sequence > tag, wherein each node represents a BPEL activity, and generating an analysis tree containing BPEL flow information.
S12, extracting a message list: analyzing a combined Web service description document (.bpel file), extracting variable tag information, and extracting and storing a message entity according to a corresponding WSDL document; specifically, the content (including name, namespace, and messageType) in the < variables > tag is extracted, the corresponding WSDL document is accessed according to the namespace, the variable name corresponding to the messageType in the document is extracted, and the variable name is stored in the entity message < name, namespace, messageType, and variable name >.
S13, extracting a variable list of the message: and analyzing the WSDL document according to the member variables defined in the message entity to obtain specific constraint contents in the WSDL document, or accessing an XSD document to obtain detailed descriptions. Specifically, the WSDL document is analyzed according to a member variable in the entity message, a tag < element > which conforms to the variable name under the tag < types > is obtained, specific constraint content in the WSDL document is obtained, and the XSD document needs to be analyzed if necessary. And integrating the information extracted in the steps S11 to S13 to obtain the related change information.
S2, constructing a change record library related to service change, defining and constructing a BPEL flow graph, and determining a node set, an edge set, an initial node and a termination node;
further, the specific process of constructing a change record library related to service change is as follows: initializing a Mysql database, storing all change records in a table, wherein the column information of each row of change records is a sequence number, calling a path, changing types, clustering ids, names, name spaces, operation types (adding, deleting or modifying), and changing contents >;
if the change record contains a plurality of changes, the change record is divided into a plurality of sub-change records. For Web services capable of acquiring historical records, directly analyzing change record information acquired by a Web service provider, converting the change record information into entries and storing the entries in a local database; for Web services that cannot directly acquire a history, the first time the service is integrated into a composite Web service is taken as the starting point of the change record.
Further, the defining and constructing a BPEL flow graph specifically includes:
constructing a BPEL flow graph BFG = { N, E, S, F } according to the analysis tree IN the step S11, wherein N is a node set, N = { IN, NN, SN, EN, MN, CN }, E is an edge set, E = { CE, ME }, S is an initial node, and F is a terminal node set; IN the Node set N, IN (Interaction Node) represents an Interaction Node, NN (Normal Node) represents a common Node, SN (Service Node) represents a Service Node, EN (explicit Node) represents a mutex Node, MN (Multiple Node) represents a multi-branch/merge Node, CN (current Node) represents a Concurrent Node, CE (Control Edge) represents a structure-related Edge, and ME (Message Edge) represents an information exchange-related Edge. IN the node set N, nodes NN, EN, MN and CN are structure type nodes, and nodes IN and SN are message type nodes.
S3, comparing the combined Web service flow diagrams before and after change according to the BPEL flow diagram, acquiring the name of the changed node, determining the change type, generating a change record and adding the change record into a change record library;
further, referring to fig. 3, the present invention extracts a change record flow diagram based on the change history, compares the original BPEL flow graph with the changed BPEL flow graph, obtains the name of the changed node, determines the change type, generates a change record, and adds the change record into the change record library for storage. The step S3 specifically includes:
s31, comparing BFG graphs in change history records of two continuous versions of structural nodes NN, EN, MN and CN, extracting changed structural class changes, determining change types according to node types, and generating change record labels of change information to be added into a change record library;
specifically, the BFG node set has 4 kinds of structural nodes, which are NN, EN, MN, and CN, respectively. NN denotes some structured activities, such as assign, wait, onAlarm, etc.; EN denotes nodes containing conditional statements, including if, pick, while and repeatUntil; MN represents a multiple branch node, including links with a joinCondition value of "OR" OR null; CN represents a parallel node, including a flow AND a link with a joinCondition value of "AND". The invention compares the BFG graph of the two change history records according to the division of different node types on the BFG graph, finds the changed node, determines the different types of the changes according to the different types of the nodes, and realizes the classification of the changes. And adding a change information generation change record label into the database.
S32, for the nodes IN and SN, comparing BFG graphs IN change history records of two continuous versions, extracting changed nodes IN and SN, and obtaining message class change;
IN particular, IN represents activities that interact with other partner services, including invoke, receive, reply, and onMessage IN pick, SN represents a partnerLink node defined IN the BPEL document, typically occurring with IN; the edge involved is ME, indicating the information exchange between IN and SN. Because the BFG can reflect the execution path of the combined Web service, the change of the service message can be obtained by comparing BFG graphs IN different history versions and extracting the changed IN and SN: if the change type is addition or deletion, the change type is MA (Message Add) or MD (Message Delete); if the message is modified, accessing and analyzing the WSDL document to which the message belongs: firstly, searching WSDL < Message > label, searching the Message label conforming to the name of the change Message, then analyzing the Variable information of the Message, comparing with the original Variable information in the history record, judging whether the change occurs, if so, determining the change type according to the increment MVA (Message Variable Add), the modification (Message Variable Edit) or the deletion (Message Variable Delete) of the Variable. And adding a change record label generated by the change information into the database.
And S4, according to the change record set in the change record library, dividing various change types into equivalence classes, selecting representative test cases from the equivalence classes, and reducing the test suite.
Further, referring to fig. 4, the schematic diagram of reducing the test case according to the change type according to the present invention, where step S4 specifically includes:
dividing the test cases in the test suite into a single Web service test and a combined Web service test, acquiring a classified combined Web service change record set from the change record library, and reading change records;
for the structure class change based on NN, EN, MN and CN nodes, further converting the BPEL flow graph into a BPEL control dependency graph with dependency relationship, acquiring the dependency relationship, transforming the sequence of test cases according to the dependency relationship, and testing the corresponding node set;
specifically, for a node that has changed, it can be simplified to a test of a message flow in units of Web service messages, in which a sequence of controls depends on the node. For example, if the flow of the combined Web service is changed from the sequential flow (NN) to the conditional flow (EN), the Web service message only controlling the dependence on the EN is selected, and the corresponding test cases are selected one by one according to the changed sequence for testing, so that the test of the whole flow is avoided. MN can be similar to switch in C + +, because static analysis cannot determine which branch is called specifically, so it is necessary to pick and test cases for Web messages related to all branches under MN. The CN represents a parallel node, and because the message flows under the node are parallel or in random sequence, each message flow under the CN can only be tested one by one to ensure the service quality after the combined Web service is changed.
For the message class change based on MA, MD, MVA, MVE and MVD, searching a corresponding test case according to the message change record, and testing the changed service;
in particular, because the records are changed<Name (R)>Which represents the name of the message and,<name space>And the name space of the message is represented, so that a corresponding test case, namely the soap message, is searched according to the message change record. From h 0 If the change type is MA, selecting a corresponding test case from the test suite according to the added message name and the added name space; if the change type is MD, deleting the corresponding test case from the current test set; if the change type is MVA, the Web service provider updates the parameter list of the message, and at this time, not only a test case meeting the corresponding name and the name space needs to be selected, but also whether the input and output variables under the test case meet the change condition needs to be judged; if the change type is MVE, firstly, determining whether the current test case is available, if so, not performing related operation, otherwise, performing the same operation as MVA; and if the change type is MVD, searching whether the test case available in the old version exists in the original test suite. And correspondingly testing the changed message according to the new test case.
And acquiring a test case set reduced under the change, reading the next change record and performing the same treatment until all changes based on the history record in the change record library are searched after the treatment. If a new change occurs, the steps S3 to S4 are continued to reduce the test case.
Corresponding to the embodiment of the method, the invention also provides a device for reducing the combination service test case set based on the change history, which comprises the following steps:
the information extraction module: the system is used for extracting a message list, a message variable list and a service combination flow description in a description document from a historical record for a combined Web service project needing to be maintained and analyzing;
change record library: for recording service changes;
a flow graph construction module: the method comprises the steps of defining and constructing a BPEL flow graph, and determining a node set, an edge set, a starting node and a terminating node;
a change extraction module: the Web service flow graph is used for comparing the combined Web service flow graph before and after change according to the BPEL flow graph, acquiring the name of the changed node, determining the change type, generating a change record and adding the change record into the change record library;
further, the change extraction module specifically includes:
structure class change extraction means: for structural nodes NN, EN, MN and CN, comparing BFG graphs in change history records of two continuous versions, extracting changed structural class changes, determining change types according to node types, and generating change record labels of change information to be added into a change record library;
message class change extraction means: for nodes IN and SN, comparing BFG graphs IN change history records of two continuous versions, extracting changed nodes IN and SN, and obtaining message class change:
if the type of the change is addition or deletion, the change type is MA or MD;
if the change type is changed, the change information is generated into a change record label and added into a change record library.
A type reduction module: and the test suite reduction module is used for dividing various change types into equivalence classes according to the change record set in the change record library, and selecting representative test cases from the equivalence classes to reduce the test suite.
Further, the type reduction module specifically includes:
structure class change reduction unit: acquiring a change record, further converting a BPEL flow graph into a BPEL control dependency graph with dependency relationship for the structure class change based on NN, EN, MN and CN nodes, acquiring the dependency relationship, transforming the sequence of test cases according to the dependency relationship, and testing corresponding node sets;
message class change reduction unit: and acquiring a change record, searching a corresponding test case for message class change based on MA, MD, MVA, MVE and MVD according to the message change record, and testing the changed service.
The above apparatus embodiments and method embodiments are in one-to-one correspondence, and for the sake of simplicity, reference may be made to the method embodiments.
The embodiments in the present specification are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and similar parts in each embodiment are referred to each other, and all parts not described in the specification are the prior art or the common general knowledge.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in random access memory, read only memory, electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (8)

1. A method for reducing a set of composite service test cases based on change history is characterized by comprising the following steps:
s1, extracting service combination flow description, a message list and a message variable list in a combined Web service description document from a historical record for analyzing aiming at a combined Web service item needing to be maintained;
s2, constructing a change record library related to service change, defining and constructing a BPEL flow graph, and determining a node set, an edge set, a starting node and a terminating node;
s3, comparing the combined Web service BPEL flow graph before and after change according to the BPEL flow graph, acquiring the changed node name, determining the change type, generating a change record and adding the change record into a change record library;
the step S3 specifically includes:
s31, comparing BFG graphs in change history records of two continuous versions of structural nodes NN, EN, MN and CN, extracting changed structural class changes, determining change types according to node types, and generating change record labels of change information to be added into a change record library;
s32, comparing the BFG graphs IN the change history records of the two continuous versions for the nodes IN and SN, extracting the changed nodes IN and SN, obtaining the message class change, and determining the change type:
if the type is addition or deletion, the change type is MA or MD;
if the message is modified, accessing and analyzing the WSDL document to which the message belongs, searching a message label conforming to the name of the modified message, analyzing variable information of the message label, comparing the variable information with original variable information in a historical record, judging whether the message label is changed, if so, determining the modification type according to the addition of MVA, modification of MVE or deletion of MVD of the variable, and generating a modified record label of the modified information and adding the modified record label into a modified record library;
and S4, according to the change record set in the change record library, dividing equivalent classes for various change types, selecting representative test cases from the equivalent classes, and reducing the test suite, wherein the equivalent classes refer to the classification of the change types and comprise the change of NN, EN, MN and CN types.
2. The method for reducing the set of combinational service test cases based on the change history according to claim 1, wherein the step S1 specifically comprises the following sub-steps:
s11, extracting a service combination flow: analyzing the combined Web service description document, extracting sequence tag information, performing sequencing traversal on the content in the sequence tag, and generating an analysis tree containing BPEL flow information;
s12, extracting a message list: analyzing the combined Web service description document, extracting variable tag information, and extracting and storing a message entity according to a corresponding WSDL document;
s13, extracting a variable list of the message: and analyzing the WSDL document according to the member variables defined in the message entity, and acquiring specific constraint contents in the WSDL document or accessing an XSD document to acquire detailed descriptions.
3. The method for reducing the set of composite service test cases based on the change history according to claim 1, wherein in the step S2, the specific process of constructing a change record library related to the service change is as follows:
initializing a Mysql database, storing all change records in a table, wherein the column information of each row of change records is a serial number, calling a path, changing types, clustering ids, names, name spaces, operation types and changing contents; the operation type comprises addition, deletion or modification; if the change record contains a plurality of changes, the change record is divided into a plurality of sub-change records.
4. The change history based composite service test case set reduction method according to claim 2, wherein in the step S2, the defining and constructing a BPEL flow graph specifically includes:
constructing a BPEL flow graph BFG = { N, E, s, F }, wherein N is a node set, N = { IN, NN, SN, EN, MN, CN }, E is an edge set, E = { CE, ME }, s is a starting node, and F is a terminating node set; IN a node set N, IN represents interactive nodes, NN represents common nodes, SN represents service nodes, EN represents mutual exclusion nodes, MN represents multi-branch/combination nodes, and CN represents concurrent nodes; CE represents the structure-related edge, ME represents the information exchange-related edge; IN the node set N, nodes NN, EN, MN and CN are structure type nodes, and nodes IN and SN are message type nodes.
5. The method for reducing the set of combinational service test cases based on change history according to claim 1, wherein said step S4 specifically comprises:
dividing the test cases in the test suite into a single Web service test and a combined Web service test, acquiring a classified combined Web service change record set from the change record library, and reading change records;
for the structure class change based on NN, EN, MN and CN nodes, further converting the BPEL flow graph into a BPEL control dependency graph with dependency relationship, acquiring the dependency relationship, transforming the sequence of test cases according to the dependency relationship, and testing the corresponding node set;
for the message class change based on MA, MD, MVA, MVE and MVD, searching a corresponding test case according to the message change record, and testing the changed service;
and acquiring a test case set reduced under the change, reading the next change record and performing the same treatment until all changes based on the history record in the change record library are searched after the treatment.
6. A combinational service test case set reduction apparatus based on change history, the apparatus comprising:
the information extraction module: the system is used for extracting a message list, a message variable list and service combination flow description in a description document from a historical record for analyzing a combined Web service item needing to be maintained;
a change record library: for recording service changes;
a flow graph construction module: the method comprises the steps of defining and constructing a BPEL flow graph, and determining a node set, an edge set, a starting node and a terminating node;
a change extraction module: the BPEL flow graph is used for comparing the combined Web service BPEL flow graph before and after change according to the BPEL flow graph, acquiring the changed node name, determining the change type, generating a change record and adding the change record into the change record library; the method specifically comprises the following steps:
for structural nodes NN, EN, MN and CN, comparing BFG graphs in change history records of two continuous versions, extracting changed structural class changes, determining change types according to node types, and generating change record labels of change information to be added into a change record library;
for nodes IN and SN, comparing BFG graphs IN change history records of two continuous versions, extracting changed nodes IN and SN, obtaining message class change, determining change type:
if the type is addition or deletion, the change type is MA or MD;
if the change type is changed, the change information is generated into a change record label and added into a change record library;
a type reduction module: and the test suite reduction module is used for dividing various change types into equivalence classes according to the change record set in the change record library, and selecting representative test cases from the equivalence classes to reduce the test suite.
7. The device for reducing the set of composite service test cases based on the change history as claimed in claim 6, wherein the change extraction module specifically comprises:
structure class change extraction means: for structural nodes NN, EN, MN and CN, comparing BFG graphs in change history records of two continuous versions, extracting changed structural class changes, determining change types according to node types, and generating change record labels of change information to be added into a change record library;
message class change extraction means: for nodes IN and SN, comparing BFG graphs IN change history records of two continuous versions, extracting changed nodes IN and SN, and obtaining message class change:
if the type is addition or deletion, the change type is MA or MD;
if the change information is changed, accessing and analyzing the WSDL document to which the message belongs, searching for a message label which accords with the name of the change message, analyzing variable information of the message label, comparing the variable information with original variable information in a historical record, judging whether the change occurs, determining the change type according to the addition of MVA, the modification of MVE or the deletion of MVD of the variable if the change occurs, and generating a change record label of the change information and adding the change record label into the change record library.
8. The change history-based combinational service test case set reduction apparatus according to claim 7, wherein said type reduction module specifically comprises:
structure class change reduction unit: acquiring a change record, further converting a BPEL flow graph into a BPEL control dependency graph with dependency relationship for the structure class change based on NN, EN, MN and CN nodes, acquiring the dependency relationship, transforming the sequence of test cases according to the dependency relationship, and testing corresponding node sets;
message class change reduction unit: and acquiring a change record, searching a corresponding test case according to the message change record for the message class change based on MA, MD, MVA, MVE and MVD, and testing the changed service.
CN202010503066.8A 2020-06-05 2020-06-05 Change history-based composite service test case set reduction method and device Active CN111858301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010503066.8A CN111858301B (en) 2020-06-05 2020-06-05 Change history-based composite service test case set reduction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010503066.8A CN111858301B (en) 2020-06-05 2020-06-05 Change history-based composite service test case set reduction method and device

Publications (2)

Publication Number Publication Date
CN111858301A CN111858301A (en) 2020-10-30
CN111858301B true CN111858301B (en) 2022-10-11

Family

ID=72985061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010503066.8A Active CN111858301B (en) 2020-06-05 2020-06-05 Change history-based composite service test case set reduction method and device

Country Status (1)

Country Link
CN (1) CN111858301B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113176999A (en) * 2020-11-24 2021-07-27 季明 Software testing method and system based on distributed application program
CN113190439B (en) * 2021-04-22 2024-03-22 北京百度网讯科技有限公司 Execution method and device of test case and electronic equipment
CN113688044A (en) * 2021-08-26 2021-11-23 中国工商银行股份有限公司 Automatic testing method and device based on business scene library
CN114564293B (en) * 2022-03-02 2022-11-25 北京大学 Large-scale online service system change scheduling method and system based on constraint detection and conflict resolution

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101866317A (en) * 2010-06-29 2010-10-20 南京大学 Regression test case selection method based on cluster analysis
CN102750153A (en) * 2012-06-29 2012-10-24 南京大学 Regression testing case set construction method based on program change
CN102915271A (en) * 2012-10-31 2013-02-06 北京邮电大学 Method for optimizing unit regression test case set based on control flow diagram
CN104156313A (en) * 2014-08-12 2014-11-19 南京大学 Method for automatically generating Web service testing case
CN104598619A (en) * 2015-01-30 2015-05-06 南京邮电大学 Service compositional verification method based on constraint solver
CN107515826A (en) * 2017-08-28 2017-12-26 广州阿里巴巴文学信息技术有限公司 Test case accurate recommendation method, device, system, equipment and storage medium
CN110413506A (en) * 2019-06-19 2019-11-05 平安普惠企业管理有限公司 Test case recommended method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2369797A1 (en) * 2002-01-31 2003-07-31 Bridgewater Systems Corporation System and method for web service management
US20160019135A1 (en) * 2014-07-21 2016-01-21 Simula Innovation As Optimal test suite reduction as a network maximum flow

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101866317A (en) * 2010-06-29 2010-10-20 南京大学 Regression test case selection method based on cluster analysis
CN102750153A (en) * 2012-06-29 2012-10-24 南京大学 Regression testing case set construction method based on program change
CN102915271A (en) * 2012-10-31 2013-02-06 北京邮电大学 Method for optimizing unit regression test case set based on control flow diagram
CN104156313A (en) * 2014-08-12 2014-11-19 南京大学 Method for automatically generating Web service testing case
CN104598619A (en) * 2015-01-30 2015-05-06 南京邮电大学 Service compositional verification method based on constraint solver
CN107515826A (en) * 2017-08-28 2017-12-26 广州阿里巴巴文学信息技术有限公司 Test case accurate recommendation method, device, system, equipment and storage medium
CN110413506A (en) * 2019-06-19 2019-11-05 平安普惠企业管理有限公司 Test case recommended method, device, equipment and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Test Case Reduction Technique for BPEL-based Testing;Wenli Dong;《IEEE》;20080130;全文 *
Testing BPEL-based Web Service Composition Using High-level Petri Nets;Wen Li Dong1;《IEEE》;20061020;全文 *
服务组合BPEL测试序列生成研究;张亚;《计算机科学》;20170115(第01期);全文 *
面向服务的船舶电子信息系统软件测试要求;科技工作者之家;《https://www.kejie.org.cn/article/detail?id=561959》;20191223;全文 *

Also Published As

Publication number Publication date
CN111858301A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
CN111858301B (en) Change history-based composite service test case set reduction method and device
US20200401386A1 (en) Reconfiguring application software into microservice architecture
US20230393846A1 (en) System and Method For Automated Cross-Application Dependency Mapping
US8869111B2 (en) Method and system for generating test cases for a software application
US7093207B1 (en) Data analysis flow engine
US20110029822A1 (en) Tracking of java objects during request processing
CN109240666B (en) Function calling code generation method and system based on call stack and dependent path
CN113326247B (en) Cloud data migration method and device and electronic equipment
CN111026433A (en) Method, system and medium for automatically repairing software code quality problem based on code change history
CN110990055B (en) Pull Request function classification method based on program analysis
CN115599347A (en) Automatic code development implementation method and system
US11144840B2 (en) Completing decision logic to avoid a side effect
CN116166547A (en) Code change range analysis method, device, equipment and storage medium
Iacob et al. Quantitative analysis of service-oriented architectures
CN113220592A (en) Processing method and device for automated testing resources, server and storage medium
CN110928784A (en) Software testing environment monitoring method and device
Zhang et al. Composite‐Level Conflict Detection in UML Model Versioning
CN116860227B (en) Data development system and method based on big data ETL script arrangement
CN117076332B (en) Test case testing method and device, electronic equipment and storage medium
CN115982055B (en) Test method special for java language development program
US20200236000A1 (en) System and Method for Automated Cross-Application and Infrastructure Dependency Mapping
Sharma et al. Recent trends in Component Based software development and Efficiency analysis of Semantic search based component retrieval Technique
Peleg et al. Symbolic automata for representing big code
CN112783604B (en) PaaS-based application scheduling and workflow arrangement method and system
CN116737532A (en) Data processing method, device, equipment and 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
GR01 Patent grant
GR01 Patent grant