[ieee 2009 ieee international conference on service-oriented computing and applications (soca) -...

8
Slicing Web Service-based Software Chengying Mao School of Software, Jiangxi University of Finance and Economics, 330013 Nanchang, China [email protected] Abstract Web services offer a brand-new mechanism for program interactions over the Internet. However, the new features such as heterogeneous, loose-coupling and distributed bring great challenge to its compre- hension and debugging. In the paper, the method of static slicing BPEL programs in Web service composi- tions is proposed. At first, an extended control flow graph (ECFG) is constructed through a in-depth anal- ysis on the new activity elements such as flow and pick. Then, the def-use relations between Web service units are computed. Based on the above results, BPEL pro- gram dependence graph is built by introducing the concept of synchronized edge. Subsequently, the static (backward / forward) slicing algorithm is discussed in details. While considering the slicing effects on a real- world Web service application, the proposed slicing technique can reduce the number of statements need- ing to be checked in understanding or debugging activ- ities. Keywords: Web services, BPEL, ECFG, depen- dence analysis, BPDG, slicing algorithm 1. Introduction Service-oriented architecture (SOA) has been re- garded as a promising solution to develop and execute distributed applications. SOA provides a flexible and cost-effective paradigm to construct highly dynamic systems through service discovery, composition, and ultra-late binding. However, the increasing adoption of SOA for mission critical systems calls for effective approach to ensure high reliability [1]. Web services (WSs) are the most prominent exam- ple of the emerging SOA. In general, the whole system is implemented by means of Web service compositions (WSCs). Its business workflow is usually modeled by using process languages like WS-BPEL [2], BPML and WSFL. Among them, BPEL has become the de- facto standard and been widely adopted in industrial applications. Therefore, how to ensure the correctness and quality of BPEL becomes critical [3]. At present, most researches are concerned with the error revealing, but not error removing. Quite a few methods [3,5,16-23] are proposed to test BPEL pro- grams, but how to locate and remove some specific fault is still an open issue. In the paper, we introduce and transform the traditional slicing technology [4] to tackle this problem. At first, we analyze the control dependence and data dependence in BPEL programs. Then, BPEL program dependence graph (BPDG) is constructed according to these dependence relations. Finally, a static slicing method for Web service-based software (WSS) is addressed. The rest of the paper is organized as follows: Sec- tion 2 outlines the background and technical prelimi- naries for WSS (especially for BPEL specifications). Section 3 presents the methods of dependence analysis and SDG construction. Section 4 addresses the static slicing algorithm for BPEL programs, and followed by a literature review and conclusions in Section 5 and 6, respectively. 2. Background In the Web service-based software system, a Web service can be regarded as a component unit. Its inter- face information is described via the WSDL files. For the complex task, it should be implemented by WSCs but not a single service unit. The workflow is defined by the BPEL specification, and the message is passed through SOAP protocol file. WS-BPEL defines a model and a grammar for de- scribing the behavior of a business process based on interactions between the process and its partners [2]. The interaction with each partner occurs through Web Service interfaces which are defined in WSDL files. In fact, BPEL is a XML document conforming to a spe- cific XML schema format, which can describe differ- ent aspects of a business process, such as roles, port types, and orchestration [5]. From the perspective of the structure at the interface level, a BPEL process is 978-1-4244-5299-6/09/$26.00 (c)2009 IEEE

Upload: chengying

Post on 27-Jan-2017

213 views

Category:

Documents


1 download

TRANSCRIPT

Slicing Web Service-based Software

Chengying Mao School of Software, Jiangxi University of

Finance and Economics, 330013 Nanchang, China [email protected]

Abstract

Web services offer a brand-new mechanism for program interactions over the Internet. However, the new features such as heterogeneous, loose-coupling and distributed bring great challenge to its compre-hension and debugging. In the paper, the method of static slicing BPEL programs in Web service composi-tions is proposed. At first, an extended control flow graph (ECFG) is constructed through a in-depth anal-ysis on the new activity elements such as flow and pick. Then, the def-use relations between Web service units are computed. Based on the above results, BPEL pro-gram dependence graph is built by introducing the concept of synchronized edge. Subsequently, the static (backward / forward) slicing algorithm is discussed in details. While considering the slicing effects on a real-world Web service application, the proposed slicing technique can reduce the number of statements need-ing to be checked in understanding or debugging activ-ities.

Keywords: Web services, BPEL, ECFG, depen-dence analysis, BPDG, slicing algorithm 1. Introduction

Service-oriented architecture (SOA) has been re-garded as a promising solution to develop and execute distributed applications. SOA provides a flexible and cost-effective paradigm to construct highly dynamic systems through service discovery, composition, and ultra-late binding. However, the increasing adoption of SOA for mission critical systems calls for effective approach to ensure high reliability [1].

Web services (WSs) are the most prominent exam-ple of the emerging SOA. In general, the whole system is implemented by means of Web service compositions (WSCs). Its business workflow is usually modeled by using process languages like WS-BPEL [2], BPML and WSFL. Among them, BPEL has become the de-facto standard and been widely adopted in industrial

applications. Therefore, how to ensure the correctness and quality of BPEL becomes critical [3].

At present, most researches are concerned with the error revealing, but not error removing. Quite a few methods [3,5,16-23] are proposed to test BPEL pro-grams, but how to locate and remove some specific fault is still an open issue. In the paper, we introduce and transform the traditional slicing technology [4] to tackle this problem. At first, we analyze the control dependence and data dependence in BPEL programs. Then, BPEL program dependence graph (BPDG) is constructed according to these dependence relations. Finally, a static slicing method for Web service-based software (WSS) is addressed.

The rest of the paper is organized as follows: Sec-tion 2 outlines the background and technical prelimi-naries for WSS (especially for BPEL specifications). Section 3 presents the methods of dependence analysis and SDG construction. Section 4 addresses the static slicing algorithm for BPEL programs, and followed by a literature review and conclusions in Section 5 and 6, respectively. 2. Background

In the Web service-based software system, a Web service can be regarded as a component unit. Its inter-face information is described via the WSDL files. For the complex task, it should be implemented by WSCs but not a single service unit. The workflow is defined by the BPEL specification, and the message is passed through SOAP protocol file.

WS-BPEL defines a model and a grammar for de-scribing the behavior of a business process based on interactions between the process and its partners [2]. The interaction with each partner occurs through Web Service interfaces which are defined in WSDL files. In fact, BPEL is a XML document conforming to a spe-cific XML schema format, which can describe differ-ent aspects of a business process, such as roles, port types, and orchestration [5]. From the perspective of the structure at the interface level, a BPEL process is

978-1-4244-5299-6/09/$26.00 (c)2009 IEEE

mainly composed of activities, which can be separated into basic activities, such as receive, reply, in-voke, assign, throw, exist and structure activi-ties, such as sequence, if, while, repeatuntil, pick, flow. It should be noted that, the flow (<flow>) activity provides concurrency and synchro-nization, and is used to define a set of activities that will be invoked in parallel. In general, an operation that is the source of parallel work to be performed is called a concurrent (fork) operation. An operation that is the target of parallel work is called a synchronized (join) operation.

In BPEL, the structural activities with the feature of concurrency and synchronization can not be represented by traditional control flow graph (CFG), so some special notations like synchronized node and concurrent node are employed to extend CFG [3,7]. Therefore, the graphical representation of BPEL pro-gram will include not only traditional basic node and select-branch node, but also the nodes with concurrent features. Up to now, there are several kinds of notation methods for BPEL activities, among which UML ac-tivity diagram, Petri Net [6] and BPMN [7] are three typical representatives, and are all with the ability of expressing parallel execution.

Running Example. In order to address our slicing method for BPEL programs, a widely used Web ser-vice composition (BusinessTravelProcess [8]) as below is introduced into this paper. This Web service-based system enables customers to choose the right flight according to their requirements. This example mainly involves three partner Web services, i.e. Employee Travel Status Web service and the American and Delta Airlines Web service. The main body of this BPEL process is listed in Figure 1. For space reason, some unimportant parts are omitted here. <?xml version="1.0" encoding="utf-8"?> <process name="BusinessTravelProcess" ...> <partnerLinks> ... <!-- Include client, emplTrvlSt, AAirl and DAirl --> </partnerLinks> <variables> <variable name="TrvlReq" …/> <variable name="EmplTrvlStReq" …/> <variable name="EmplTrvlStResp" …/> <variable name="FlightDetails" …/> <variable name="FlightRespAA" …/> <variable name="FlightRespDA" …/> <variable name="TrvlResp" …/> </variables> <sequence> 01 <receive partnerLink="client" operation="TrvlApproval" varia-ble="TrvlReq" ... /> 02 <assign> <copy> <from variable="TrvlReq" part="employee"/> <to variable="EmplTrvlStReq" part="employee"/></copy> </assign>03 <invoke partnerLink="emplTrvlSt" operation="EmplTrvlStatus" inputVariable="EmplTrvlStReq" outputVariable = "EmplTrvlStResp " ... /> 04 <assign> <copy> <from variable="TrvlReq" part="flightData"/> <to variable="FlightDetails" part="flightData"/> </copy>

<copy> <from variable="EmplTrvlStResp" part="travelClass"/>

<to variable="FlightDetails" part="travelClass"/> </copy> </assign> 05 <flow> 06 <sequence> <invoke partnerLink="AAirl" opera-tion="FlightAvailability" inputVariable="FlightDetails" .../> 07 <receive partnerLink="AAirl" operation="FlightTicketCallback" variable="FlightRespAA" .../> </sequence> 08 <sequence> <invoke partnerLink="DAirl" opera-tion="FlightAvailability" inputVariable="FlightDetails" /> 09 <receive partnerLink="DAirl" operation="FlightTicketCallback" variable="FlightRespDA" /> </sequence> 10 </flow> 11 <switch> <case condi-tion="bpws:getVariableData('FlightRespAA','confData','/confData/Price') = bpws:getVariableData('FlightRespDA','confData','/confData/ Price')"> 12 <assign> <copy> <from variable="FlightRespAA" /> <to varia-ble="TrvlResp" /> </copy> </assign> </case> 13 <otherwise> <assign> <copy> <from variable="FlightRespDA" /> <to variable="TrvlResp" /> </copy> </assign> </otherwise> 14 </switch> 15 <invoke partnerLink="client" operation="ClientCallback" input-Variable="TrvlResp" .../> </sequence> </process>

Figure 1. BPEL program of the BusinessTravelProcess example

3. Dependence analysis 3.1. Control dependence analysis

In order to analyze the control and data flow depen-dence in BPEL program, it’s necessary to represent it in graphical form. Here, we adopt the popular BPMN to express the workflow of the example BPEL program (as shown in Figure 2).

It should be noted that, the node number in the fol-lowing figure is consistent with the line label in the corresponding BPEL program. In the extended CFG (ECFG), there are five kinds of nodes. The first three, i.e. basic activity node, select-branch node and merge node, are similar to the nodes in traditional CFG. However, the last two (concurrent node and synchro-nized node) are introduced to express the parallel ex-ecution behaviors in BPEL process. They are also called parallel gateway and exclusive gateway in BPMN. Therefore, although node 05 and 11 have the same feature in graph theory, they have different se-mantics at all. For the similar reason, node 10 is not a simple joint node in traditional CFG. It can be ex-ecuted only after all sequences 06 07 and 08 09 have been gone trough. In contrast, the common branch node such as 14 can be executed either one condition edge is covered.

entry

01, 02, 03, 04

05

06

07

08

09

10

11

12 13

14

15

exit

Legend:

basic activity

concurrent node

join node

branch node

merge node Figure 2. The extended CFG of the example

Definition 1 (Parallel Execution Relation) Suppose 1seq and 2seq are two sequences immediately follow-

ing a concurrent node in ECFG, these sequence will execute at the same time when the BPEL program runs on process engine, denoted as 1 2seq seq . Similarly, the nodes (e.g., 1n and 2n ) in parallel sequences also have such relation in ECFG, i.e., 1 2n n .

While considering the above example, the sequence 06 07 has the parallel execution relation with 08 09. Furthermore, the nodes in set {06, 07} also have paral-lel relation with those in {08, 09}.

Definition 2 (Parallel Execution Set) Suppose node 1 2, , , and sn n n have parallel execution relation with

node 1 2, , , and tr r r , we call all nodes as parallel execution set, that is, 1 2 1 2{ , , , } { , , ,P sS n n n r r= }tr .

For some complex cases, there will be several can-didate parallel execution sets if branch statement exists in a parallel execution body. As shown in Figure 3, there are two choices (03 or 04) in the left parallel ex-ecution sequence. Accordingly, two parallel execution sets can be achieved by combining the possible syn-chronized execution paths, i.e., 1 {02, 03, 05, 06, PS = 07} and 2 {02, 03, 04, 06, 07}PS = .

In general, control dependence is usually defined in terms of post-dominance [4,9].

Definition 3 (Post-Dominance) A node in in the CFG (or ECFG) is post-dominated by a node jn if all execution paths from in to exit pass through jn .

Figure 3. Example parallel program segment with

branch condition in it It’s worth noting that, a path merely containing par-

tial nodes in parallel execution set is not a feasible ex-ecution path. Thus, we can deduce a theorem as below.

Theorem 1 If a node in parallel execution set has been executed, all nodes in it should be executed to-gether unless some exception has been thrown by one of them. Proof. It is a directed reflection from the parallel

execution behaviors of BPEL program. Theorem 2 Assume node n is a basic activity node,

and node cn is a concurrent node whose following two parallel execution nodes in two different sequences are

1p and 2p , respectively. If n is post-dominated by cn , it is also post-dominated by 1p and 2p . Proof. We can prove the above proposition in two

cases. If the proposition doesn’t hold, then (1) n does not depend on any node of 1p and 2p ,

but the concurrent node cn merely has these two suc-cedent nodes, so cn must be post-dominated by one of them. As a consequence, 1p or 2p must be executed while passing from n to the exit node. Accordingly, this kind of assumption is not tenable.

(2) n is post-dominated by either of two nodes 1p and 2p . According to the first and second definition,

1p has parallel execution relation with 2p . So if one of them has been executed, the other must be also ex-ecuted. Therefore, this case also does not hold.

In a word, the above negative assumption doesn’t conform to the fact, so the theorem is proved.

Definition 4 (Control Dependence [4,9]) A node jn is (direct) control dependent on a node in if:

(1) there exists a path P from in to jn such that any , k i jn n n≠ in P is post-dominated by jn , and (2) in is not post-dominated by jn . Determining the control dependences in programs

with arbitrary control flow is studied in [9]. Here, we should pay much attention on the control dependences caused by the parallel execution relation. In order to

facilitate the slicing (including backward and forward) on BPEL programs, the synchronized edge must be introduced into the traditional control dependence sub-graph. It’s a bidirectional edge, and connects the first node of one parallel sequence with the first node of the other. Similarly, it also appears between the last nodes of parallel sequences.

Based on the above analysis, BPEL control depen-dence sub-graph of the example can be constructed as shown in Figure 4. For the sake of simplicity, some non-execution nodes such as 10 and 14 are omitted here. Compared with the traditional control depen-dence sub-graph, the synchronized edges denoted via dot-and-dash line are added to express the parallel ex-ecution relation.

entry

01 02

03 04

05 11 15

06 08

07 09

12 13

Legend:traditional control

dependencesynchronizeddependence

Figure 4. BPEL control dependence sub-graph of the example process

3.2. Data dependence analysis

Apart from control dependence between program statements, data dependence is also a very important dependence form. In this subsection, we will put em-phasis on the data dependence analysis and representa-tion for BPEL programs. At first, the concept of defini-tion use relation is reviewed as below [4,9,10].

Definition 5 (Variable Definition) Let v be a varia-ble in program, the assignment of a value to variable v in statement dn is identified by a tuple ( , )ddef v n .

For BPEL programs, it mainly occurs in these activ-ities: (1) a receive activity, (2) outputVariable clause in invoking activity, and (3) in the element <to …/> of assign activity.

Definition 6 (Variable Use) The use of v is identi-fied by a tuple ( , )uuse v n , where the value of variable v is referenced to without modifying statement un .

The use of a variable can be divided into c-use and p-use. The former is used for computation purpose and mainly appears in (1) reply activity, (2) inputVaria-ble clause in invoking activity, and (3) in the element <from …/> of assign activity. A p-use is a variable used in a predicate statement, and can be found in the

switch condition of case or while statement, or in the transitionCondition of state transition.

Definition 7 (Def-Use Pair) A definition-use pair is an ordered pair ( , )d un n , where a statement called dn contains a definition of a variable v , which is used in a statement un in a program.

Definition 8 (Data Dependence) Suppose ( , )d un n is a def-use pair w.r.t. variable v , node un is data de-pendent on node dn if there doesn’t exist variable re-definition of v within the path from dn to un .

Since the message passing between Web services and portType of service interface perhaps have com-plex structure, there will exist inclusion relation be-tween variable and its parts. In the above example, the variable with TrvlReq with type of “TravelRequest-Message” has two parts as below. [Travel.bpel] ... <variables> <variable name=“TravelRequest” messa-geType=“trv:TravelRequestMessage“/>

... </variables> ... [Travel.wsdl] ... <message name="TravelRequestMessage"> <part name=“employee” type=“emp: Em-ployeeType” /> <part name=“flightData” type=“aln: FlightRequestType” />

</message> ...

For this special case existing in BPEL files, the fol-lowing def-use combinations will appear (as shown in Figure 5). It’s obvious that the first three def-use pairs are valid, but the last one is not right since var.partX and var.partY are two essential different variables.

Figure 5. The def-use combinations between a variable

and its part Based on the above definition, the variable defini-

tions (defs for short) and uses in the example BPEL program can be listed in Table 1. It’s worth noting that, the first column refers to the code line number in BPEL program, and the code lines which do not con-tain variable definition or use are omitted here.

Table 1. Variable defs and uses in each statement #Node Definition Use

01 TrvlReq 02 EmplTrvlStReq.employee TrvlReq.employee 03 EmplTrvlStResp EmplTrvlStReq

04 FlightDetails.flightData FlightDetails.travelClass

TrvlReq.flightData EmplTrvlStResp

06 FlightDetails 07 FlightRespAA 08 FlightDetails 09 FlightRespDA

11 FlightRespAA FlightRespDA

12 TrvlResp FlightRespAA 13 TrvlResp FlightRespDA 15 TrvlResp According to the above data dependence analysis,

the data dependence relations of all variables are pro-duced as shown in Table 2. Table 2. Data dependences of variables in the example

BPEL programs Variable Data Dependences TrvlReq (01, 02) (01, 04)

EmplTrvlStReq (02, 03) EmplTrvlStResp (03, 04)

FlightDetails (04, 06) (04, 08) FlightRespAA (07, 11) (07, 12) FlightRespDA (09, 11) (09, 13)

TrvlResp (12, 15) (13, 15) 3.3. Dependence graph construction

In general, a program dependence graph (PDG) is a directed graph with nodes corresponding to statements and control predicates, and edges corresponding to data and control dependences. It is mainly used for the tra-ditional procedural programs. In particular, it is usually to be extended in order to represent the dependence relations for some special software systems [11], such as concurrent programs, component-based software, and Web applications.

In this section, we mainly reform the ordinary PDG for BPEL programs according to the above control and data dependence analysis, and the corresponding de-pendence graph is called as BPDG here. The BPDG can be constructed in the following steps:

Step 1. Given a Web service-based software system, identify the BPEL process file for the main workflow. Then, build the ECFG for that BPEL file according to the notations in BPMN. Apart from the parallel execu-tion body, there is no obvious difference between it and the traditional CFG. For the parallel part, the em-phasis is to identify the concurrent node and synchro-

nized node. The parallel execution sequences can be viewed as branches in general CFG.

Step 2. In the ECFG, the elements such as parallel sequences, parallel execution set and the first (last) node of each parallel sequence, need to be identified for the usage in the forthcoming step.

Step 3. Take the ECFG built by step 1 to construct a control dependence sub-graph in the common way.

Step 4. Based on the above control dependence sub-graph, add a bi-directed synchronized edge between the first nodes of each parallel sequence pair, and per-form the same actions to the last node pair. As a con-sequence, all control dependences including parallel execution dependence have been worked out.

Step 5. Analyze the data dependences according to the method mentioned in Section 3.2.

Step 6. For each data dependence relation, com-plement a data dependence edge into the control de-pendence sub-graph. Finally, the whole BPDG is yielded.

It is not hard to find that, three kinds of edges exist in the final BPDG, i.e., common control dependence edge, synchronized edge and data dependence edge. For the BusinessTravelProcess example in this paper, the corresponding BPDG can be constructed via the above steps and is shown in Figure 6.

Figure 6. The BPDG of the example WSCs

4. Slicing Web services 4.1. Static slicing algorithm

A program slice consists of the parts of a program that potentially affect the values computed at some point of interest [12], referred to as a slicing criterion. Typically, a slicing criterion is denoted with a 2-tuple C = ( _ , )node number variable . The parts of a program which have a direct or indirect effect on the values computed at a slicing criterion C are called the pro-gram slice w.r.t. criterion C [4]. The original concept

of program slicing is static slicing, and another impor-tant form called dynamic slicing is introduced in the latter stage. Given a slicing criterion, the statements and control predicates which will affect the variable in it can be computed by means of a backward traversal of the program from the node_number in criterion. Naturally, these slices are referred to as backward slic-es. In contrast, the other form is to trace dependences in the forward direction, and the corresponding slices are called as forward slices.

In the paper, we mainly focus on how to generate static slices for BPEL programs in WSCs. Since the backward and forward slices are computed in a similar way, the algorithm about backward slicing will be ad-dressed in details at first, and the results of forward slicing can be easily achieved without much modifica-tion for slicing algorithm.

Based on the BPDG, the static slices can be pro-duced by performing a backward traversal on BPDG, starting at the slicing criterion. The details about Web service slicing algorithm are shown in the following pseudo-code.

Algorithm. StaticFSlicingBPDG Input: BPDG G for BPEL program in WSCs; Slicing criterion ( , )C lno var= . Output: Static slice set S . 01 Begin 02 marked_list = { }lno ; 03 work_list ={ }lno ; 04 while work_list ≠ ∅ do 05 select a node u from work_list; 06 work_list = work_list { }u− ; 07 for each node ( )v V G∈ and ( , ) ( )v u E G∈ do 08 if marked_listv ∉ then 09 work_list = work_list { }v ; 10 marked_list = marked_list { }v ; 11 endif 12 endfor 13 endwhile 14 marked_listS = ; 15 return S ; 16 End

According to the static backward slicing algorithm as shown in the above, the slices of the example Busi-nessTravelProcess program can be easily yielded. Here, we choose (15, )C TrvlResp= as a slicing criterion, then the slices can be computed as illustrated in Figure 7. As shown, the slice results are denoted via the grayed shapes.

Figure 7. The static backward slices of the example

BPEL program w.r.t. the criterion (15, )C TrvlResp= While considering the static forward slicing, it is

necessary to perform a minor change on the above backward algorithm. The main difference is to convert the backward traversal into forward form. For the space reason, the formal code of forward slicing algo-rithm is omitted here. For instance, if (01, )TrvlReq is viewed as a slicing criterion, the corresponding static forward slices can be computed as below:

{01, 02, 03, 04,fS = 06, 08} . 4.2. In-depth analysis

At the current research stage, we merely focus on the static slicing for Web service-based software sys-tem, so there are many issues needing to be deeply explored. Here, the following two important expan-sions are addressed as the typical representations of the on-going research work.

(1) Dynamic slicing for Web services Although the static slicing can produce the state-

ment subset for a specific program, the slice set is still too large and unpractical for the software maintainers. When a maintainer debugs a program, he/she will mainly concern on the impact range of a variable with a fixed value at a specific statement. Therefore, the concept of dynamic slicing [13] is introduced to settle this difficulty.

Dynamic slicing can also be used for Web service compositions, but one point should be not be ignored. SOA permits the dynamic composition mechanism of services, so the main workflow can choose different service units according to the variable value at the call point. As a consequence, it should consider the feature of service dynamic invoking when performing the slic-ing operation, both static and dynamic slicing, espe-cially the dynamic slicing.

(2) Precise slicing for unfolding service invoking At present, we only consider the main BPEL

process of the Web service compositions. In the exam-ple, there are other three BPEL files such as Em-ployee. bpel, AmericanAirline.bpel and DeltaAirline.bpel except the main BPEL file Travel. bpel. In fact, the sub-process of the in-voked service unit should also be taken into considera-tion so as to achieve more precise slices. To tackle this problem, the method of slicing inter-procedure pro-gram [14] can be used for reference.

As demonstrated in Figure 8, at first, it needs to construct BPDG for the main BPEL and invoked BPEL programs separately. Then, add the actual para-meter nodes for the service calling site. Similarly, the formal parameter nodes can also be added to the entry of called service. Finally, the parameter edges are im-ported to connect the actual and formal parameter nodes. Subsequently, more precise slices can be com-puted according to the extended (inter-service) BPDG.

entry

... service invoke node

...

A1_in A2_in A1_out

calledS

F1_in F2_in F1_out ...

BPEL PDG of the main process

BPEL PDG of the invoked service Figure 8. The unfolding representation of the service

invoking 5. Related work

To the best of our knowledge, this is the first at-tempt of slicing the BPEL programs in Web service compositions. Below, we mainly present the researches that are most close to ours, i.e., control (data) flow analysis and dependence analysis.

Control flow and its dependence analysis. Com-pared with the traditional program, BPEL program imports quite a few activity elements such as flow and pick, so it is not an easy task to construct the represen-tation of control flow for that program. As mentioned in Section 2, the most popular three representative forms are UML activity diagram, Petri Net [6] and BPMN [7]. Besides, Li et al. developed a RDF [15]

entailment mechanism and applied it to RDF graphs to determine the control flow relation between operations [16]. In order to model the concurrency and synchroni-zation characters of WS-BPEL, Liu et al. [17] adapted the BPMN notation to depict the possible process ex-ecution flow. Although our work also adopts the simi-lar way to represent control flow of Web services, it is mainly used for dependence analysis but not for gene-rating test cases as shown in [17].

The automaton is also an important tool to describe the behaviors of Web services [18]. In [19], Keum et al. suggested a procedure to derive an EFSM model from WSDL description of a service. In EFSM, each node represents a state. While in the Extended Control Flow Graph (XCFG) model [20], proposed by Yan et al. to represent a BPEL program, a state of an execution may correspond to more than one node.

Data flow and its dependence analysis. Message passing is an important interaction between Web ser-vice units, so data flow and its dependence analysis is critical for understanding Web service compositions. Studies in [3,5] essentially adapts data flow coverage criteria conceived for CFG or its extension to generate test cases to validate WSCs. In [21], Choy et al. pre-sented a data dependency based approach to alleviate the effort needed in generating test cases. In this ap-proach, data dependencies are defined by using XPath expression, and type definitions in WSDL documents are then leveraged to automatically generate indepen-dent data. Since XML is fundamental to many service-oriented workflow applications, the paper [22] also studies XPath at a concept level and has developed an algorithm to construct XPath Rewriting Graph (XRG) and a novel family of data flow testing criteria to test WS-BPEL applications. Recently, reference [23] iden-tified and discussed various usages of data in WS-BPEL. The contribution of their work is that a method is proposed to abstract the data flow information of various WS-BPEL constructs with the considerations of the concurrency and synchronization semantics.

In our work, we mainly adopt the traditional con-cept of data flow and dependence. Its key merit lies in its simplicity, for example, it doesn’t need so complex queries on XML documents as shown in [22]. More importantly, four possible dependences between the basic data item (i.e. part) and its complex composi-tion (i.e., message or portType) are discussed in our data dependence analysis. 6. Concluding remarks

In general, Web services are composed together in a collaborative way to create complex and distributed software system. However, its new features bring great

pressure to latter maintenance activities such as com-prehension and debugging. In the paper, a static (backward/forward) slicing algorithm for BPEL pro-grams in Web service compositions is proposed based on the control and data dependences analysis. The ex-periment results on a real-world Web service applica-tion show that the presented method can reduce the number of statements needed to be checked. In the future, we plan to make in-depth analysis on the dy-namic and precise slicing for Web service composi-tions. Acknowledgments

This work was supported in part by the National Natural Science Foundation of China (NSFC) under Grant No. 60803046, China Postdoctoral Science Foundation under Grant No.20070410946, the Science Foundation of Jiangxi Educational Committee under Grant No.GJJZ-2007-267, and the Youth Foundation of Jiangxi University of Finance and Economics. References [1] G. Canfora and M. D. Penta, “Service-Oriented Architec-

tures Testing: A Survey”, Proc. of ISSSE 2006-2008, LNCS 5413, 2009, pp. 78-105.

[2] OASIS WSBPEL Technical Committee, Web Services Business Process Execution Language Version 2.0, avail-able at http://docs.oasis-open.org/wsbpel/2.0/wsbpel-v2.0.pdf

[3] J. Hou, B. Xu, L. Xu, D. Wang, and J. Xu, “A Testing Method for Web Services Composition Based on Data-Flow”, Wuhan University Journal of Natural Sciences, 2008, Vol.13, No.4, pp. 455-460.

[4] F. Tip, “A Survey of Program Slicing Techniques”, Pro-gramming Languages, 1995, Vol.3, No. 3, pp. 121-189.

[5] C. Bartolini, A. Bertolino, E. Marchetti, and I. Parissis, “Data Flow-Based Validation of Web Services Composi-tions: Perspectives and Examples”, Architecting Depend-able Systems V, LNCS 5135, 2008, pp.298-325.

[6] R. Hamadi and B benatallah, “A Petri Net-based Model for Web Service Composition”, Proc. of the 14th Austra-lasian Database Conference (ADC’03), Adelaide, Aus-tralia, 2003, pp.191-200.

[7] S. A. White, Introduction to BPMN, available at http:// www.bpmn.org/Documents/Introduction to BPMN.pdf

[8] M. B. Juric, “A Hands-on Introduction to BPEL”, availa-ble at http://www.oracle.com/technology/pub/articles/ matjaz_bpel1.html

[9] J. Ferrante, K. J. Ottenstein, and J. D. Warren, “The Pro-gram Dependence Graph and Its Use in Optimization”, ACM Transactions on Programming Languages and Sys-tems, 1987, Vol.9, No.3, pp. 319-349.

[10] K. J. Ottenstein, “Data-Flow Graphs as an Intermediate Program”, Ph.D. Dissertation, Computer Sciences De-partment, Purdue University, Lafayette, IN, Aug. 1978.

[11] B. Xu, J. Qian, X. Zhang, Z. Wu, and L. Chen, “A Brief Survey of Program Slicing”, ACM SIGSOFT Software Engineering Notes, 2005, Vol.30, No.2, pp.1-36.

[12] M. Weiser, “Program Slicing”, IEEE Transactions on Software Engineering, 1984, Vol.10, No.4, pp.352-357.

[13] B. Korel and J. Laski, “Dynamic Slicing of Computer Programs”, Journal of Systems and Software, 1990, Vol.13, pp.187-195.

[14] S. Horwitz, T. Reps, and D. Binkley, “Interprocedural Slicing using Dependence Graphs”, ACM Transactions on Programming Language and Systems, 1990, Vol.12, No.1, pp.26-61.

[15] D. Beckett, RDF/XML Syntax Specification (Revised), W3C Recommendation, February 2004.

[16] L. Li, W. Chou, and W. Guo, “Control Flow Analysis and Coverage Driven Testing for Web Services”, Proc. of 2008 IEEE Int’l Conf. on Web Services (ICWS’08), Beijing, China, 2008, pp.473-480.

[17] C.-H. Liu, S.-L. Chen, and X.-Y. Li, “A WS-BPEL Based Structural Testing Approach for Web Service Compositions”. Proc. of the 4th IEEE Int’l Symp. on Service-Oriented System Engineering (SOSE’08), Jhon-gli, Taiwan, 2008, pp.135-141.

[18] X. Fu, T. Bultan, and J. Su, “Analysis of Interacting BPEL Web Services”, Proc. of the 13th Int’l Conf. on World Wide Web, New York, USA, 2004, pp.621-630.

[19] C. Keum, S. Kang, I. Ko, J. Baik, and Y.-I. Choi, “Ge-nerating Test Cases for Web Services Using Extended Finite State Machine”, Proc. of TestCom 2006, LNCS 3964, 2006, pp.103-117.

[20] J. Yan, Z. Li, Y. Yuan, W. Sun, and J. Zhang, “BPEL4WS Unit Testing: Test Case Generation using a Concurrent Path Analysis Approach”, Proc. of the 17th Int’l Symp. on Soft. Reliability Eng. (ISSRE’06), Raleigh, NC, USA, 2006, pp.75-84.

[21] K. Y. Choy, T. Ishio, M. Matsushita, and et al., “Data Dependency based Test Case Generation for BPEL Unit Testing”, Technical Report 2008-SE-159, 2008, pp.163-170.

[22] L. Mei, W. K. Chan, and T. H. Tse, “Data Flow Testing of Service-oriented Workflow Applications”, Proc. of the 30th Int’l Conf. on Software Engineering (ICSE’08), Leipzig, Germany, 2008, pp.371-380.

[23] C.-H. Liu and S.-L. Chen, “Data Flow Analysis and Testing for Web Service Compositions Based on WS-BPEL”, Proc. of the 21st Int’l Conf. on Software Engi-neering & Knowledge Engineering (SEKE’09), Boston, USA, 2009, pp.306-311.