Bart Van Tee Seling

Embed Size (px)

Citation preview

  • 8/11/2019 Bart Van Tee Seling

    1/51

    Testing Service-oriented Architectures using asimulation

    Bart van Teeseling

    Rijksuniversiteit Groningen

    Supervisors: Alexander Lazovik

    Rijksuniversiteit Groningen

    Rix Groenboom

    Parasoft et!erlands bv

    "xternal Revie#er: Paris Avgeriou

    Rijksuniversiteit Groningen

  • 8/11/2019 Bart Van Tee Seling

    2/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    Contents

    CONTENTS ...................... ....................... ....................... ...................... ............... ...... ...... ...... 2

    1. ABSTRACT .................... ....................... ....................... ....................... ........ ...... ...... ...... ..... 4

    2. NTRO!"CT ON .................... ....................... ....................... .................. ...... ...... ...... ...... .. #

    $. %ROB&E' STATE'ENT ...................... ....................... ....................... ........ ...... ...... ..... ... (

    &'(' Simulated integration testing in servi$e%oriented ar$!ite$tures''''''''''''''''''''''''''')&'*' Resear$! +uestions'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''')

    4. RE&ATE! )OR* ...................... ....................... ....................... ....................... ........ ...... .... +

    ,'(' Test data generation'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''-,'*' Test automation frame#orks'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''-,'&' .ontra$t based testing'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/,',' .onforman$e Testing''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/,'0' 1o$k 2bje$ts''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/,')' Servi$e%oriented ar$!ite$tures and integration testing''''''''''''''''''''''''''''''''''''''''3

    #. BAC*,RO"N! ..................... ....................... ....................... ...................... ......... ...... ...... . 1

    0'(' 4eb Servi$es'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''(50'*' Servi$e%oriented Ar$!ite$ture''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''(50'&' Business Pro$ess''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''((0',' BP"L''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''((0'0' 6ntegration testing''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''(&

    (. E A'%&E/ )'O SER0 CE-OR ENTE! S STE' .................... ....... ...... ...... ...... .... 14

    )'(' T!e problem of integration testing a servi$e oriented ar$!ite$ture'''''''''''''''''''(,

    )'*' 412 business pro$ess'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''(0)'&' 412 ar$!ite$ture and s$enarios''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''()

    +. NTE,RAT ON TEST N, "S N, A )S-B%E& S '"&AT ON ........ ...... ...... ...... .... 1

    -'(' 7sing a simulation of t!e servi$e%oriented ar$!ite$ture''''''''''''''''''''''''''''''''''''(3-'*' BP"L for fun$tionalit8 and $reating test data and s$enarios'''''''''''''''''''''''''''''*5

    . CASE ST"! / '%&E'ENTAT ON O3 )'O E A'%&E ..................... ................ 24

    /'(' Tools and soft#are''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*,/'*' S2Atest''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''*,/'&' BP"L 1aestro'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*,

    *

  • 8/11/2019 Bart Van Tee Seling

    3/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    /',' 9esign'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*,/'0' Presentation of soft#are''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*-/')' GG9 BP"L simulation''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*3/'-' 6nsuran$e $ompan8 BP"L silmulation''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&(/'/' 2rder supplier BP"L simulation'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&*

    /'3' 1uni$ipalit8 2ffi$e re$eiving 412%support re+uests'''''''''''''''''''''''''''''''''''''&,/'(5' Adding "xternal servi$es for data a$$ess''''''''''''''''''''''''''''''''''''''''''''''''''''''''&-/'((' ava%based #eb servi$e stubs''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&-/'(*' "xample S$enarios''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&3

    . E0A&"AT ON ...................... ...................... ....................... ....................... ...... ...... ...... ..... 42

    3'(' on%fun$tional testing''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''',*3'*' 6nterfa$e testing''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''',*3'&' ;un$tional testing of s$enarios'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''',&

    3',' Simulation $omplexit8'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''',,3'0' Test $overage''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''',,3')' 2verall de$rease of integration testing $osts

  • 8/11/2019 Bart Van Tee Seling

    4/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    1. AbstractT!e testing of a ne# $omponent for an alread8 running servi$e%oriented s8stem $an

    often involve !ig! $osts= sin$e it is !ard to !alt a servi$e%oriented s8stem #it! its oftendistributed $omponents' Performing testing #!ile t!e s8stem is running $an $ause a

    performan$e de$rease= pollution of t!e s8stem #it! test data= and some servi$e$omponents mig!t $ost mone8 per invo$ation'6n t!is paper #e propose a met!od for using 4S%BP"L to simulate a servi$e%orientedar$!ite$ture' An8 ne# $omponents t!at re+uire integration testing $an first be testedusing su$! a simulation' Su$! a simulation uses lo$all8 deplo8ed #eb servi$es= andea$! #eb servi$e $an !ave simulated fun$tionalit8 for exe$uting test s$enarios' 4S%BP"L is #ell suited for #orking #it! #eb servi$es= and it allo#s some simple

    programming $onstru$ts= and t!erefore is a good $andidate for being t!e programminglanguage to $reate su$! a simulation in'6n t!is paper #e $reate a simulation of a business pro$ess for a 9ut$! !ealt! la#$alled 412' B8 doing t!at= #e s!o# t!at it is feasible to $reate su$! a simulation=and #e evaluate !o# #ell suited 4S%BP"L is for t!e job'

    ,

  • 8/11/2019 Bart Van Tee Seling

    5/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    2. Introduction9uring a test session in *553 at Pink Ro$$ade test data #as sent out b8 t!e servi$e%

    oriented s8stem #!ile it s!ouldn>t !ave been' As a result= t#ent8 five people living in?aag en Braassem in t!e et!erlands re$eived noti$e t!at t!e8 #ere married= a$ertifi$ate for t!eir ne#born= and some even re$eived noti$e about t!eir de$easing'

    one of t!is #as true= but be$ause t!e test data !ad propagated t!roug! t!e servi$e%oriented s8stem= t!e noti$es #ere sent out @*)=*3 ' T!is small stor8 is just an exampleof #!at $an !appen #!en 8ou perform testing on an up and running servi$e%orienteds8stem' To prevent t!ese kinds of t!ings from !appening= it is desirable to !ave aseperate testing environment' 6n t!is paper #e evaluate a simulation implemented in4S%BP"L as su$! an environment'S8stems #it! a servi$e%oriented ar$!ite$ture $an be made up out of man8 differentsub%s8stems and servi$es t!at $an be !osted in different pla$es= and $an be s!ared b8man8 different users' 4!en integrating a ne# entit8 or sub%s8stem into an existings8stem #it! an servi$e%oriented ar$!ite$ture= it $an be diffi$ult to test t!is ne# entit8#it! respe$t to its use of ot!er entities= servi$es= and sub%s8stems integration anda$$eptan$e testingC'4!en t!e s8stem is used b8 multiple organizations it is not desirable to !alt t!es8stem and to test t!e integration of t!e ne# sub%s8stem' Dalting t!e s8stem #ould$ost time and mone8= sin$e t!e organizations $anEt make use of t!e existing s8stem' 6ft!e s8stem involves monitoring or operating $riti$al real%life s8stems like a po#er

    plant= testing in t!e real%life environment $ould be dangerous tooFSome servi$e providers $!arge mone8 for servi$e invo$ation' Also= sin$e testingservi$e%oriented appli$ations often involves multiple invo$ations @* = t!e burdon ont!e s8stem mig!t $ause a servi$e provider not to meet its Servi$e Level Agreements

    SLAC= and ot!er users of t!e servi$e mig!t be bot!ered'6n $!apter & #e #ill furt!er define t!e resear$! +uestions of t!is t!esis'6n $!apter , #e #ill look into related resear$!= and explain !o# our #ork relates tot!at resear$!'6n $!apter 0 #e explain important ba$kground $on$epts and te$!ni+ues t!at pla8 a bigrole in our #ork'.!apter ) presents a real life business pro$ess= and possible s$enarios t!at $an o$$urin t!at pro$ess' T!e business pro$ess of $!apter ) #il serve a $ase stud8 for our

    poroposed solution in $!apter /' A 4S%BP"L simulation for t!e use of integration

    testing #it!out burdoning t!e real servi$e%oriented s8stem'6n $!apter - #e #ill present our proposed solution in a general form= #it!out relatingit to an8 spe$ifi$ examples'.!apter / presents an implementation of t!e example business pro$ess presented in$!apter )' 4e use t!e out$ome of t!is implementation for our evaluation of t!e

    porposed solution'6n $!apter 3 #e perform an evaluation of our solution and t!e role of 4S%BP"L in it'.!apter (5 s!o#s points related to our solution t!at are interesting for furt!erresear$!';inall8= $!apter (( presents a summar8 of our findings and some final $on$lusions'

    0

  • 8/11/2019 Bart Van Tee Seling

    6/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    3. Problem statementTo redu$e t!e testing $osts time=effort= and mone8C for integrating an appli$ation into

    a servi$e%oriented s8stem= it #ould be desirable to find a solution for simulating t!eexisting servi$e%oriented s8stem= so t!at t!e ne# $omponent to be integrated $an betested using t!is simulation' T!is #a8= as mu$! of t!e testing as possible $an be

    performed lo$all8 in a simulation' B8 doing t!is #e !ave to do less of t!e testing ont!e a$tual s8stem'

    3.1. Simulated integration testing in service-oriented architectures6n t!is t!esis #e propose t!e use of 4S%BP"L for simulating a servi$e%orienteds8stem'

    4e t!ink t!at 4S%BP"L #ould be an appropriate language for #riting and exe$utingtest s$enarios' 4S%BP"L $an exe$ute +uite $ompli$ated pro$esses and $an be used tosimulate t!e fun$tionalit8 be!ind t!e #eb%servi$es of t!e existing servi$e orienteds8stem' Sin$e 4S%BP"L #orks #ell in $ombination #it! #eb servi$es= #e t!ink it ist!e ideal $andidate for t!is simulation task' Do#ever= #e expe$t t!at 4S%BP"L as a

    programming language also !as limits' T!erefore #e #ant to assess !o# #ell 4S%BP"L is suitable for t!is job= and #!at t!e important limitations of 4S%BP"L are int!is $ontext'

    3.2. Research questionsT!e general resear$! +uestions #e are interested in are How can we simulate

    integration and acceptance testing for new entities to be hooked up to an existing system with a service-oriented architecture using WS-BPE !" and #What are possible limitations of WS-BPE we encounter in this context!" ' 4e #ill evaluate t!e possibilit8 of using BP"L b8 #orking out and simulating a s$enario provided b8 lo$almuni$ipalities $on$erning a 412 la# implementation= and b8 looking at t!e

    problems and limitations of BP"L #e en$ounter' T!is leads us to t!e follo#ingspe$ifi$ resear$! +uestions:

    (' Do# $an #e $reate a simulation of a given servi$e oriented ar$!ite$ture using4S%BP"L'

    *' 4!at are t!e problems and limitations of BP"L #e en$ounter #!en #e

    implement a s8stem t!at ans#ers +uestions ('

    4e #ill tr8 to ans#er +uestion ( b8 implementing a protot8pe for a given s$enarioand a given soft#are%oriented ar$!ite$ture' 4e #ill ans#er +uestion * b8 evaluatingour implementation in t!e $!apter $alled "valuationH'

    )

  • 8/11/2019 Bart Van Tee Seling

    7/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    4. Related workT!ere is a lot of existing resear$! on t!e testing of #eb servi$es' T!ere is not a lot of

    #ork t!oug! on de$reasing t!e $osts and problems of integration testing in an alread8fun$tional servi$e%oriented s8stem' 4e dis$uss t!e major areas of #eb servi$e testing=and !o# t!e8 relate to our #ork in t!is $!apter'

    4.1. Test data generationT!ere are resear$!ers #!o fo$us on t!e generation of test data for #eb servi$es' Someuse t!e 4S9L to test #eb servi$es @,=- ' 2t!ers fo$us more on a spe$ifi$ $lass ofinput data for test generation= like for instan$e data t!at !a$kers mig!t produ$eata$king a #eb servi$e @0 = or re+uest messages t!at lead to exe$ution failure @*, '2ur resear$! differs from t!is in t!at #e fo$us more on $omposite #eb servi$es= someof #!i$! are simulations of #!i$! #e alread8 assume t!e8 fun$tion $orre$tl8'

    T!ere is also resear$! on test data generation for #eb servi$e $ompositions@) ' T!is isa$tuall8 +uite related to our resear$!' T!is met!od generates test data for a BP"L

    pro$ess of $omposite #eb servi$es' 4e also use BP"L= but #e use it to simulateexisting #eb servi$es to $ooperate #it! a ne# #eb servi$e t!at #e #is! to test'A$tuall8 t!e data generation met!od proposed in @) mig!t be used in $ombination#it! our resear$!'

    4.2. Test automation frameworksT!ere are a lot of resear$!ers t!at propose to use some sort of met!od for test

    automation #!ile testing #eb servi$e or $ompositions of #eb servi$es'

    2ften servi$es> 4S9L>s are used to test servi$es seperatel8' ;or instan$e @/ proposesto generate grammars from 4S9L>s as an intermediate step in generating a #ebservi$e stub and a #eb servi$e invo$ation generator' T!is #a8 $alls to a #eb servi$e$an be tested as #ell as t!e #eb servi$e itself using generated #eb servi$e $alls' 2t!ermet!ods= like proposed in @(5=((=(*=(& = anal8ze t!e 4S9L to automati$all8 generate#eb servi$e $alls= and $!e$k t!e #eb servi$e>s response'

    6n @3 = t!e 4S9L is anal8zed in order to dete$t in$ompleteness or in$onsistensies in a#eb servi$e'

    2t!er resear$! fo$usses on spe$ial t8pes of testing to un$over more $omplex t8pe oferrors= like for instan$e @(, = #!ere invariants are anal8zed to see if t!e8 are violated'T8pes of errors un$overed !ere mig!t be design errors instead of implementationerrors' A servi$e mig!t need more $!e$ks= for pre$onditions for instan$e= t!an it !as'2t!er resear$! t!at fo$usses more on testing t!e #eb servi$e model and not just t!ingslike t!e data format is @(0 = #!ere ontolog8 properties are tested #it! positive andnegative test $ases'

    @() Proposes a met!od to automati$all8 determine t!e $ompatibilit8 of #eb servi$es'@(- proposes to en!an$e servi$e $ompatibilit8 b8 testing a servi$e living up to itsspe$ifi$ations before letting it register at a servi$e dis$over8 me$!anism'2ur resear$! also tests #eb servi$es= but instead of using just t!e 4S9L spe$ifi$ationto anal8ze input and output= #e anal8ze t!e #eb servi$e>s $ooperation #it! its

    -

  • 8/11/2019 Bart Van Tee Seling

    8/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    simulated environment to see if it #orks #ell' ext to just performing $orre$t $allsand anal8ze responses= #e also anal8ze t!e fun$tional be!aviour b8 !aving oursimulation en$orporate some semanti$all8 usefull be!aviour'

    4.3. Contract based testing @(/ and @(3 propose to add $ontra$ts to a #eb servi$e spe$ifi$ation= to better express#!at $an be expe$ted of a #eb servi$e= and #!at is needed to use t!at #eb servi$e' B8using t!e $ontra$ts one $an test a servi$e>s validit8' Sin$e t!e $ontra$ts provideinformation about t!e inner be!aviour of a #eb servi$e= it $ould also be !elpful insimulating a #eb servi$e for a testing environment'

    6nstead of providing $ontra$ts= our met!od proposed to provide a simulation t!at a#eb servi$e s!ould $ooperate #it!' 6f t!e simulation is good enoug!= a tester s!ould

    be able to anal8ze t!e be!aviour of ot!er #eb servi$es b8 #at$!ing t!e response of t!e

    simulated environment= and make sure t!at t!e tested servi$e responses #ell to t!is be!aviour' 2f $ourse $ontra$ts $ould be used in $ombination #it! our met!od= todes$ribe t!e environment>s be!aviour more formall8'

    4.4. Conformance Testing Some resear$!ers propose met!ods of $onforman$e testing #eb servi$es' T!e idea isto in$rease t!e $!an$e of su$$esful $ooperation of #eb servi$es= b8 ensuring t!at a#eb servi$e be!aves a$$ording to its spe$ifi$ation= and b8 ensuring #eb servi$esabide $ertain rules= like pre% and post$onditions or invariants'@(-=*(=*/ propose #a8s to perform $onforman$e testing= #!ile @*5 proposes toextend 4S9L #it! information about a servi$e>s be!aviour= #!i$! $ould be used in$onforman$e testing'

    2ur #ork also performs a kind of $onforman$e testing= in t!at #e provide a simulatedenvironment a set of BP"L pro$essesC of servi$es= in #!i$! a servi$e s!ouldsu$$esfull8 operate' 6nstead of testing a servi$e for follo#ing its spe$ifi$ation= #e testit for interoperabilit8 #it! t!e provided environment'

    4.5. Mock Objects1o$k obje$ts are a #ell%kno#n te$!ni+ue to substitute parts of a program #!i$! areirrelevant for a parti$ular unit test @**=*& ' 6n @*& a te$!ni+ue is presented= t!at adds

    be!aviour to mo$k obje$ts' T!e be!aviour is based on anal8zing unit test $ases' @&also proposes t!e use of mo$k obje$ts #it! be!aviour= and !ere t!e mo$k obje$tste$!ni+ue is a$tuall8 applied to servi$e%oriented appli$ations' T!e mo$k obje$ts in @&are semanti$ servi$e stubs= t!at are used to test $onformation to pre% and post$onditions= and $an generate ex$eptions'

    2ur #ork is ver8 mu$! related to t!e mo$k obje$t resear$! des$ribed above' Basi$all8#e use BP"L pro$esses as mo$k obje$ts' 6n @& semanti$ servi$e stubs= implementedin ava= are used instead of BP"L' 4e use BP"L to implement meaningful test $ases=#!ile @& is more suited for automated testing of pre% and post$onditions$onformation'

    /

  • 8/11/2019 Bart Van Tee Seling

    9/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    4.6. Service-oriented architectures and integration testing T!ere is resear$! t!at fo$usses on integration testing for #eb servi$es' 2ne $ouldargue t!at mo$k obje$ts= and to a lesser degree also $ontra$t based testing and

    $onforman$e testing= also falls under integration testing' Sin$e t!e8 are su$! spe$ifi$met!ods= #e de$ided to mention t!em speratel8 from general integration testing'

    @*/ presents a testbed for servi$e%oriented ar$!ite$tures' ext to experimenting andtesting ideas= su$! a testbed $ould be used ver8 #ell for simulating an existing s8stemand t!en integration testing of a part of t!at s8stem' T!is is basi$all8 #!at #e propose#it! our met!od using BP"L'

    3

  • 8/11/2019 Bart Van Tee Seling

    10/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    5. BackgroundA lot of $on$epts in t!is paper !ave to do #it! #eb servi$es and te$!ni+ues related to

    #eb servi$es' 6n t!is $!apter #e explain some of t!e $on$epts and te$!ni+ues t!at areinvolved in using #eb servi$es and servi$e%oriented appli$ations'

    5.1. Web Services4!at exa$tl8 are #eb servi$es< Per!aps t!e most $lear and abstra$t definition $an befound on @&( :

    Web services are typically application programming interfcaes $%P&' or Web %P&(sthat are accessable through H))P and executed in a remote system hosting there*uested services H

    Anot!er formal definition given b8 @&5 is:

    % Web service is a software system designed to support interoperable machine-to-machine interaction over a network+ &t has an interface described in a machine-

    processable format $specifically WS, '+ ther systems interact with the Web servicein a manner prescribed by its description using S %P messages. typically conveyedusing H))P with an /0 seriali1ation in con2unction with other Web-related

    standards+ H

    Anot!er #a8 of looking at #eb servi$es is as a $olle$tion of standards= of #!i$! t!e

    most important ones are S2AP= I1L= 4S9L= and 7996 @*/ 'So !o# do #eb servi$es #ork< 9ifferent platforms and programming languages $anex$!ange messages like fun$tion $alls and repliesC t!roug! a language $alled I1L'T!e pres$ribed format of t!ese messages is $alled t!e Simple b2ect %ccess

    Protocol H S2APC'A #eb servi$e !as a des$ription of its interfa$e= so t!at $lients $an see !o# to$onsume a #eb servi$e' T!is interfa$e is #ritten in an I1L%based language $alledWeb Service ,escription anguage H 4S9LC'

    T!ere is a #a8 for $entrall8 registering 8ou #eb servi$e so ot!ers $an find it= #!i$! is$alled 3niversal ,escription. ,iscovery and &ntegration H 7996C'

    6n t!is paper it is important to kno# t!e $on$epts 4eb Servi$e= I1L= S2AP= and4S9L'

    5.2. Service-oriented rchitecture4!at is servi$e%oriented ar$!ite$ture< A formal definition $an be found in @&& :

    6n $omputing= a servi$e%oriented ar$!ite$ture S2AC is a flexible set of design prin$iples used during t!e p!ases of s8stems development and integration' A deplo8edS2A%based ar$!ite$ture #ill provide a loosel8%integrated suite of servi$es t!at $an beused #it!in multiple business domains'H

    6n @&5 a Servi$e 2riented Ar$!ite$ture is defined as a form of a distributed s8stemsar$!ite$ture t!at:

    (5

  • 8/11/2019 Bart Van Tee Seling

    11/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    is an abstra$ted= logi$al vie# of t!e a$tual program= and is defined interms of #!at it does= and t8pi$all8 $arries out a business%level operation'

    is message orientatedJ T!ere is no need for kno#ledge about t!e internal#orkings of a seperate servi$e' uses servi$es t!at !ave a formal des$ription t!at $an be pro$essed b8 a

    ma$!ine= and t!e servi$e semanti$s s!ould be do$umented b8 t!isdes$ription'

    tends to use servi$es over a net#ork' is platform neutral' 1essages !ave a platform%neutral format= usuall8

    I1L'

    Less formall8 defined= #e $an sa8 t!at a servi$e%oriented ar$!ite$ture is a form ofdistributed $omputing= #!ere an appli$ation is made up of several servi$es' T!e

    business logi$ of an appli$ation is divided into different servi$es t!at make up t!etotal ar$!ite$ture of t!e appli$ation' T!e servi$es t!at make up t!e appli$ation areusuall8 distributed over different servers and #ork toget!er over t!e internet or anintranet'

    An important $!ara$teristi$ is t!at t!e servi$es used in a servi$e%oriented ar$!ite$tureare loosel8 $oupled' T!e interfa$es of t!e servi$es are independent of t!eimplementation @&* ' Programmers $an build an appli$ation b8 $ombining severalservi$es= #it!out !aving to kno# t!e inner #orkings or exa$t implementation of t!eseservi$es'

    1ost often servi$e%oriented ar$!ite$tures use t!e #eb servi$e standards des$ribed int!e previous se$tion on #eb servi$esH' 6n t!e remainder of t!is paper= #!en #e referto a servi$e%oriented ar$!ite$ture= #e assume it used t!e #eb servi$e standards= likeS2AP and 4S9L'

    5.3. !usiness "rocess6n t!is paper #e mention t!e term business pro$essH' Alt!oug! it is !ard to assign anexa$t universal definition to t!e term= t!e $on$ept is not ver8 $ompli$ated' ;ormaldefinitions $ould be KT!e set of internal a$tivities performed to serve a $ustomerE @&, =or KSet of partiall8 ordered a$tivities intended to rea$! a goalE @&0 '

    4e #ould like to define a business pro$ess as a set of related a$tivities t!at toget!erserve a goal like a servi$e or a produ$tC for a $ustomer or $ustomersH' A business

    pro$ess $an often be visualized #it! a flo#$!art' 4e derived t!is definition from @&) '

    5.4. !"#$BP"L stands stands for business pro$ess exe$ution languageH= and it is s!ort for 4S%BP"L= #!i$! stands for #eb servi$e business pro$ess exe$ution languageH'

    4S%BP"L is used to des$ribe !o# a business pro$ess be!aves' T!is in$ludes intera$tions bet#een a pro$ess and its partners' An intera$tion #it! a partner onl8 o$$urs b8 means of

    4eb Servi$e interfa$es' 4S%BP"L or$!estrates t!e servi$e intera$tions of a pro$ess #it!its partners to a$!ieve some sort of business goal @&- '

    ((

  • 8/11/2019 Bart Van Tee Seling

    12/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    Less formall8 put= BP"L is a language used to or$!estrate #eb servi$es' 6t defines !o#t!e #eb servi$es used #ill #ork toget!er to $omplete t!e desired business pro$ess'BP"L is a programming language based on I1L' 2ften programming in BP"L is doneusing a grap!i$al editor= and not just b8 t8ping in BP"L b8 !and @&/ ' 6n t!is paper also agrap!i$al interfa$e tool is used to progrma in 4S%BP"L' T!e tool used is BP"L 1aestro'

    ;or t!is paper it suffi$ient to understand t!at BP"L defines pro$esses t!at or$!estrate #ebservi$es= and t!at information import and export in BP"L is a$!ieved ex$lusivel8 t!roug!#eb servi$e interfa$es'

    To give a better idea= belo# 8ou #ill find a s$reens!ot of a grap!i$al representation of aBP"L pro$ess implementing a marketpla$e pro$ess'

    Part of t!e $ode for t!is pro$ess looks like:

    (*

    3igure 1/ ,ra5hical re5resentation o6 a B%E& 5rocess in B%E& 'aestro so6t7are.

  • 8/11/2019 Bart Van Tee Seling

    13/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    A t8pi$al BP"L file #ill $ontain t!e follo#ing: A section o6 5artnerlin8s : Dere t!e relations!ips are defined' 4!at #eb servi$es

    does t!e pro$ess #ork #it!= and #!at is t!eir role and our role in t!e business pro$ess'

    A section 7ith varia9les : T!e data stru$tures t!at #ill be used t!roug!out t!e pro$ess a$tivities'

    3aulthandlers : Dandlers t!at be$ome a$tive #!en an8 errors o$$ur' A se:uence : T!e program logi$ for t!e business pro$ess= in$luding servi$e $alls=

    replies= loops= parallel flo#s et $etera'

    5.5. %ntegration testing 6n t!is paper #e fo$us on t!e problem of integration testing of $omponents t!at arene#l8 added to an alread8 existing servi$e%oriented s8stem' To be $lear and $omplete#e give our definition of integration testing !ere'

    6ntegration testing is t!e problem of putting a s8stem toget!er out of seperate$omponents and testing t!e resulting s8stems for an8 problems t!at are a result of t!eintera$tion bet#een t!e seperate $omponents @&3 ' 6n t!is paper #e !ave t!e problemof a fun$tioning servi$e%oriented s8stem and #e #ant to add a ne# $omponent to it'After t!at #e #ant to test if t!e ne# $omponent #orks #ell toget!er #it! t!e alread8existsing servi$e%oriented s8stem'

    (&

    3igure 2/ E;am5le o6 B%E& code.

  • 8/11/2019 Bart Van Tee Seling

    14/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    6. !am"le# $%& ser'ice(oriented s)stemTo illustrate our problem and #!8 #e propose to evaluate our parti$ular solution #e!ave $!osen an example of a servi$e%oriented to simulate #it! BP"L' 6n t!is se$tion=first #e #ill explain #!at t!e problem is #it! integration testing of a servi$e%orienteds8stem= and #!8 t!is $annot be solved #ell in a traditional #a8 of testing'

    After t!is #e #ill explain some ba$kground on t!e business pro$ess be!ind t!eexample servi$e%oriented s8stem' Also= #e #ill des$ribe t!e servi$e%orientedar$!ite$ture t!at is to be simulated itself' Based on t!is ar$!ite$ture a set of s$enarios#ill be defined'

    After t!at #e #ill des$ribe t!e design and implementation of t!e a$tual protot8pe t!atimplements t!e simulation of t!e servi$e oriented ar$!ite$ture in t!e next $!apter'

    6.1. The &roblem of integration testing a service orientedarchitecture6n a non%servi$e%oriented s8stem #e $an solve t!e problem of integration testing in atraditional #a8' 6n a servi$e%oriented s8stem #e $annot' T!is is be$ause a servi$e%oriented s8stem is alread8 running'

    6n a traditional s8stem= #e $ontrol t!e #!ole s8stem' 4e integrate a ne# $omponent=#e test t!e s8stem #it! test data= and #e $an look t!roug!out t!e #!ole s8stem #!at!appens' 4e $an make t!e test data not go into t!e database= to prevent our realdatabase from getting polluted #it! test data'

    6n a servi$e%oriented s8stem= #e !ave problems t!at #e don>t !ave in ot!er t8pe ofs8stems:

    2ur s8stem $omponents are distributed among different servers at differentlo$ations'

    2ur s8stem $omponents mig!t be maintained b8 different o#ners or$ompanies'

    2ur s8stem $omponents mig!t be #ritten in $ompletel8 different programming languages t!an #e use ourselves= running on $ompletel8different platforms'

    2ur s8stem $omponents are a$ting as an a$tive $omponent in an up andrunning s8stem= #!ile #e perform t!e integration testing'

    So #e $an>t just stop our s8stem to perform t!e integration testing of a ne#$omponent= sin$e #e don>t $ontrol all t!e $omponents' 4e also $annot put our s8stemin some sort of debug state to prevent our database and pro$esses from getting

    polluted #it! test data'6magine t!at #e are #orking on integrating a $omponent for a !ospital s8stem' 4e$an>t just insert test data sa8ing t!at someone is dead or si$k #!ile t!e s8stem isrunning in t!e mean time' T!is #ould $ause major in$onsistensies and problems #it!a persons insuran$e' T!is is just one small example of #!at $ould !appen #!en #etest a $omponent after integrating it in a servi$e%oriented environment'

    (,

  • 8/11/2019 Bart Van Tee Seling

    15/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    T!e problems des$ribed above $an>t be solved $ompletel8' 4e #ill !ave to some!o#test a ne# $omponent after integrating it in a servi$e%oriented environment' 4e $an!o#ever tr8 to make sure t!at our $omponent !as t!e least amount of errors possible=

    before #e integrate it= and tr8 to perform as mu$! of t!e testing offlineH not in t!ereal s8stemC= before #e integrate t!e $omponent and do t!e final testing' 6f #e $ankeep t!e integration testing to a minimum at least #e minimize t!e problems' To t!isend= #e #ant to simulate t!e servi$e%oriented environment for t!e $omponent= and

    perform as mu$! of t!e integration testing as possible in t!is simulated environment'6n t!is paper #e #ill #ork out su$! a simulation in 4S%BP"L to assess !o# #ell 4S%BP"L #ould be suited for t!is job' 6n t!e next se$tion #e introdu$e an example of aservi$e%oriented s8stem' T!is s8stem #ill be simulated using 4S%BP"L in t!e $!apterafter t!at' 7sing t!e implementation of t!at simulation #e #ill tr8 to evaluate !o##ell 4S%BP"L is suited for simulating servi$e%oriented s8stems for t!e goal of

    offlineH integration testing'

    6.2. WMO business &rocessTo evaluate t!e use of 4S%BP"L as a means for simulating a servi$e%oriented s8stem#e #ill implement a simulation of t!e 412 business pro$ess'412 4et 1aats$!appelijke 2ndersteuningC is a 9ut$! la# for supporting peoplet!at !ave a $!roni$ disease or disabilit8= so t!at t!ese people $an independentl8 live int!eir o#n !omes and a$tivel8 take part in ever8da8 life despite t!eir p!8si$al problem'Support provided b8 t!e 412 are t8pi$all8 t!ings like transportation e'g' taxitransportationC= a #!eel$!air= or a !ome modifi$ation e'g' removing door posts for

    people in a #!eel$!airC' T!e responsibilit8 for a 412 re+uest lies #it! t!e 9ut$!muni$ipalities= t!e8 !andle t!e $omplete business pro$ess' T!e pro$ess does a$$essexternal parties like for instan$e insuran$e $ompanies and do$tors for medi$al advi$e'

    6n t!e figure belo# 8ou see a des$ription of t!e servi$e%oriented ar$!ite$ture forre+uesting 412' 6t is a simplifi$ation of a real life situation based on t!e situation int!e to#n of Daren in t!e et!erlands @( '

    T!e various a$tivities in t!e business pro$ess are represented b8 #eb servi$es= asdes$ribed in our definition of servi$e%oriented ar$!ite$tures in t!e se$tion

    Ba$kgroundH' ;irst= a muni$ipalit8 is $onta$ted b8 a $itizen re+uesting some kind ofsupport= like a #!eel$!air for instan$e' 6f t!e re+uest is $orre$t a medi$al advi$e isre+uested from a do$tor b8 means of a servi$e invo$ation' 6f t!e do$tor>s offi$e GG9in t!is 9ut$! business pro$essC replies #it! a positive advi$e= t!e business pro$ess is$arried on' 2t!er#ise= t!e re+uest is de$lined' After a positive advi$e= depending ont!e t8pe of $are re+uested= t!e insuran$e $ompan8 is $onta$ted t!roug! a servi$e todetermine t!e amount of t!e $ost of t!e re+uested $are t!at is $overed b8 t!e $itizen>sinsuran$e' T!e insured amount is dedu$ted from t!e pri$e= if t!e $osts are not$ompletel8 $overed t!e rest of t!e $ost are billed to t!e $itizen'T!e implementation or $are suppl8 is re+uested t!oug! a servi$e= #!i$! replies#!et!er or not t!e $are #ill be delivered su$$esfull8'

    T!is t8pe of ar$!ite$ture allo#s for ne# $omponents to be !ooked up' ;or example a

    ne# $are supplier= a ne# do$tor>s offi$e GG9C= a ne# insuran$e $ompan8= or a$omplete ne# muni$ipalit8 offi$e $ould be !ooked up' T!is ne# $omponent #ould!ave to be integrated #it! t!e $urrent a$tive servi$e%oriented s8stem= and t!at is #!ere

    (0

  • 8/11/2019 Bart Van Tee Seling

    16/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    our integration testing problem arises' 6n t!e next $!apter #e #ill implement asimulation of t!e servi$e%oriented 412 s8stem t!at #as des$ribed above= and #e#ill explain !o# t!at $ould be used for offlineH integration testing' T!e $!apters

    after t!at #ill evaluete !o# #ell suited t!is met!od is'6.3. WMO architecture and scenarios6n t!e previous se$tion #e des$ribed t!e 412 business pro$ess= in t!is se$tion #e#ill depi$t t!e 412 business pro$ess and des$ribe t!e possible s$enarios t!at $anarise in t!at business pro$ess'

    ()

    Exit

    Noconcretequestion

    Intake (includingquestion

    clarfification) (byFrontoffice)

    Support request

    Medical advice(performed by

    !)

    "ualified forapplication#

    No ($e%ection)

    &es

    'ersonalbudget orinsurance

    'ersonal udget

    'ayment (c eckfor correctness is

    done later)

    Insurance

    * icprovisions#

    !omestic elp

    * eelc air+,ransportation+

    Minor ome modificationSupply order

    -dvise andinformation

    provision aboutsuppliers

    !elivery (byexternal party)

    $eceive invoice

    'ayment

    -pplication isentered into t e

    system (byackoffice)

    !

    .ity +overnment

    .aresupplier

    .iti/en

    $equestingsupport

    0E EN!

    Insurancecompany

    3igure $/ Business 5rocess 6or the !utch )'O la7

  • 8/11/2019 Bart Van Tee Seling

    17/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    6n t!e ar$!ite$ture $ommuni$ation bet#een different parties indi$ated b8 different$olorsC is done t!roug! #eb servi$es' ;or ea$! of t!ese parties #e $an defineintegration testing s$enarios'

    ,overnment integration testing scenarios Re$eiving 412 re+uest from $itizen= $are is supplied= $are is $ompletel8

    $overed b8 insuran$e Re$eiving 412 re+uest from $itizen= $are is supplied= $are is not or partl8

    $overed b8 insuran$e Re$eiving 412 re+uest from $itizen= negative do$tors advi$e= $are not

    supplied' Re$eiving 412 re+uest from $itizen= bsn unkno#n= $are not supplied' Re$eiving 412 re+uest from $itizen= $are is unkno#n b8 suppl8er $are not

    supplied'

    ,,! integration testing scenarios

    Sending medi$al advi$e to Government Re$eiving medi$al advi$e re+uest from Government

    Care su55lier integration testing scenarios

    Re$eive suppl8 order from Government Send result to government= suppl8 $are'

    Citi

  • 8/11/2019 Bart Van Tee Seling

    18/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    *. Integration testing using a $+(BP , simulation6n general #e $an define t!e problem #e !ave #!en #e #ant to perform integration

    testing after integrating a ne# $omponent into an alread8 exisiting and a$tivel8running servi$e%oriented s8stem as follo#s:

    .urrent situation:

    (C 4e !ave a servi$e%oriented s8stem= #!i$! means #e !ave a s8stem t!at is$omposed of different $omponents represented b8 #eb servi$es' T!e different$omponents of t!e servi$e%oriented s8stem are distributed over differentlo$ations= and are in $ontrol of different stake!olders= parties= or even different$ompanies' T!e s8stem is up and running and a$tivel8 used bu users'

    *C 4e !ave a ne# $omponent t!at must be $onne$ted to t!e running servi$e%oriented s8stem' Assuming t!e $omponent !as been tested seperatel8 e'g' b8unit testingC= integration testing !as to be performed'

    Problems:

    (C T!e s8stem is running and it>s a$tivel8 being used' 4!en test data is used#!ile performing t!e integration testing= t!e s8stem $an get polluted #it! testdata' Test data $ould be saved in files or data bases #!ere it #ould get mixed#it! real data' T!e users of t!e s8stem $an>t see t!e differen$e bet#eenlegitimate s8stem a$tivit8= and integration test a$tivit8'

    *C 6f during t!e integration testing a lot of errors are un$overed= or if it is not$lear #!at #as t!e $ause of a parti$ular error= a lot of runs of t!e integrationtests mig!t be re+uired' T!is $an $ause a de$rease in overall s8stem

    performan$e= #!i$! #ill be a problem for all s8stem users' Also= someservi$es $ost mone8 per invo$ation= so t!e more $alls t!at are needed duringt!e performan$e of t!e integration testing= t!e !ig!er t!e $ost of t!e integrationtesting $an turn out to be'

    6n order to de$rease t!e amount of live testing a ne# servi$e #!en integrating it intoan existing servi$e%oriented s8stem= #e propose to $reate a simulation of t!e existingservi$e%oriented s8stem t!at $an serve as an initial testing environment' T!e idea is

    t!at #!en 8ou test a servi$e in t!is simulated environment first= 8ou minimize t!eamount of testing errors during live testing= !ereb8 saving t!e $osts of servi$einvo$ation= emplo8ees> #asted time= and minimizing t!e overall s8stem performan$edegradation' 6n ot!er #ords t!e goal is to de$rease t!e overall $ost of t!e pro$ess ofintegration testing'

    So #!at do #e mean b8 a 4S%BP"L simulation of a servi$e%oriented ar$!ite$ture< To be pre$ise= #e mean to simulate bot! t!e business pro$ess as #ell as t!e servi$es it is$omposed of' 4e #ant to implement su$! a simulation using 4S%BP"L files' 2ne4S%BP"L file to or$!estrate all t!e servi$es to implement t!e business pro$ess= andone 4S%BP"L file for ea$! #eb servi$e $omponent' 4e #ant to give ea$! #eb

    servi$e $omponent #!i$! is a 4S%BP"L file in t!e simulationC !ard$odedfun$tionalit8= so t!at #e $an perform some usefull a$tions during integration testing=using our simulation'

    (/

  • 8/11/2019 Bart Van Tee Seling

    19/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    To illustrate t!e solution lets first define t!e general situation'

    4e !ave a live s8stem #it! a servi$e%oriented ar$!ite$ture' T!e s8stem is made up of several servi$es= and multiple parties $an providet!e same servi$e for instan$e= multiple do$tors $an be !ooked up to be $alledfor medi$al advi$e= or a to#n $ould !ave multiple offi$e>s #!ere one $ould goto for 412 re+uests= et $eteraC'

    A ne# part8 #ants t!eir servi$e to be $onne$ted to t!e servi$e%orienteds8stem' T!is servi$e needs to be tested before it $an be integrated su$$esfull8'

    *.1. 'sing a simulation of the service-oriented architecture o# #!en a ne# part8 #ants to $onne$t its servi$e to t!e s8stem it !as to be tested'To do t!is $alls !ave to be made to t!e ne# servi$e from t!e s8stem= and t!e ot!er#a8 around' T!e more errors t!e ne# servi$e appli$ation !as= t!e more t!e tests !aveto be repeated= and t!e live s8stem gets burdonned #it! test data= mixed #it! real datafrom t!e alread8 running servi$es' To minimize t!is= #e $an simulate t!e servi$e%oriented s8stem= test t!e ne# servi$e appli$ation in t!is simulated s8stem= and #!iledoing t!is $at$!ing as mu$! errors as #e $an= before #e move on to t!e a$tual livetesting #it! t!e real servi$e%oriented s8stem'

    So no# #e need a simulation of t!e #!ole s8stem:

    (3

    3igure 4/ ,eneral structure o6 a service-oriented s=stem.

  • 8/11/2019 Bart Van Tee Seling

    20/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    T!e s8stem administrator of t!e live servi$e%oriented s8stem $an no# distribute aversion of t!e simulated s8stem among ever8one #!o #ants to !ook up a ne# servi$eto t!e live servi$e%oriented s8stem'

    ;or instan$e= #!en a part8= lets $all t!em $ompan8 A= #ants to $onne$t animplementation of servi$e number *= t!e8 first test t!eir appli$ation b8 taking t!esimulation of t!e s8stem= taking out t!e simulation of servi$e number *= and repla$ingit #it! t!eir o#n appli$ation'

    *.2. !"#$ for functionalit( and creating test data and scenarios4e propose to use BP"L for implementing t!e s8stem simulation' B8 using BP"L #e

    $an add simple program logi$ to or$!estrate t!e #eb servi$e' Also #e $an add somesimple be!aviour to ea$! of t!e simulated servi$es' To illustrate t!is $onsider anexample:

    ;or simulating servi$e = part of t!e #!ole simulated servi$e%oriented s8stem= #e usea seperate BP"L file' Lets sa8 for instan$e= servi$e is a servi$e t!at returnssomeone>s name and address #!en 8ou $all it #it! t!at person>s so$ial se$urit8number' T!e servi$e returns eit!er t!e name and address #!en t!e person is a kno#n$itizen in t!e database= or some sort of ex$eption #!en t!e so$ial se$urit8 number isunkno#n'

    o# #e $an !ard$ode t!e simulation of servi$e to return a $ertain name and

    address #!en #e $all it #it! so$ial se$urit8 number (5555(H= for instan$e o!n9oe= 4illo#road (= ip $ode (*&= 1an$!esterH' 4e $an additionall8 !ard$ode t!e

    *5

    3igure #/ ,eneral structure o6 a simulation o6 service-oriented s=stem.

  • 8/11/2019 Bart Van Tee Seling

    21/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    servi$e simulation to return eit!er an ex$eption or a person%not%foundH%message#!en #e $all it #it! so$ial se$urit8 number (5555*H'4e $an do somet!ing like t!is for ea$! of t!e servi$e simulations' T!is #a8 #e $an

    provide an8 testers #it! test data for all kinds of s$enarios' T!e8 $an $all t!esimulation of servi$e #it! (5555(H as an argument to test a s$enario involving asu$$esful name and addressH%retrieval= or t!e8 $an $all it #it! (5555*H to test as$enario involving an unsu$$esful name and addressH%retrieval'

    6n addition to t!e adding of test data in t!e #a8 des$ribed above= BP"L also provideseas8 means for $!e$king t!e format of arguments involved in servi$e invo$ations' So#e $an easil8 $!e$k #!et!er an argument is of t!e $orre$t format string= integer= et$eteraC= and return an ex$eption or error message ot!er#ise'

    Also no#= t!e s8stem administrator $ould distribute t!e simulation #it! a BP"L

    engine t!at $an run t!e BP"L files t!at implement t!e simulation' 7sing su$! anengine a tester $ould just start t!e engine and !e !as an a$tual simulation runninglo$all8= #it!out !aving to $onfigure or program somet!ing' T!is brings us to t!efollo#ing situation for t!e simulation:

    *(

    Simulation of t e service 1oriented system

    (System logic simulated in'E0)

    'ort,ype 2

    'ort,ype N

    Simulation of Service 3 in 'E04ardcoded be aviour depending on input

    argument values5

    Simulation of Service N in 'E04ardcoded be aviour depending on input

    argument values5

    'ort,ype 2Simulation of Service 2 in 'E0

    4ardcoded be aviour depending on inputargument values5

    3 6

    3 6

    3 6

    .

    .

    .

    .

    'E0 Engine

    3igure (/ ,eneral structure o6 a B%E& simulation o6 a service-oriented s=stem.

  • 8/11/2019 Bart Van Tee Seling

    22/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    So lets assume some part8 #ants to $reate an implementation of servi$e number *=and #ants to !ook it up to t!e servi$e%oriented s8stem' 4!at are t!e steps t!e8 !ave togo troug!s 4S9L:

    BSN : T!e so$ial se$urit8 number of a person'CARE : T!e t8pe of $are t!e person re+uested'

    *3

    3igure 11/ ,,! 'edical advice simulation in B%E&.

    3igure 12/ The gra5hical descri5tion o6 the service?s )S!&.

  • 8/11/2019 Bart Van Tee Seling

    30/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    A!0 CE : 4!et!er t!e do$tor t!inks t!e 412 s!ould be given M8esNnoNunkno#nO'

    4e !ave implemented t!e do$tor as a medi$al advi$eH servi$e in BP"L';irst of all #e validate t!e input using t!e BP"L validate tag' T!is #a8 #e make suret!e servi$e is $alled #it! t!e $orre$t data t8pes'B8 adding some simple fun$tionalit8 #e #ere able to simulate some s$enarios' B8using some simple if%statements= #e #ere able to make t!e medi$alAdvi$e%servi$e

    be!ave in different #a8s depending on t!e input' 4e s!o# t!e servi$e be!aviourusing a simple table:

    BSN Care Advice

    ( transportation 8es

    ( aspirine 8es

    ( 2t!er t!an >transportation>or >aspirine>

    no

    * #!eel$!air 8es

    * 2t!er t!an >#!eel$!air> 8es

    2t!er t!an >(> or >*> An8 string unkno#n

    6n t!is table 8ou $an see #e $an exe$ute part ofC different s$enarios b8 sending t!eservi$e different input values'

    &5

  • 8/11/2019 Bart Van Tee Seling

    31/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    -.*. %nsurance com&an( !"#$ silmulationT!e BP"L servi$e for t!e insuran$e $ompan8 is $alled get6nsuran$eH' 6t takes t!e

    BS of a person and returns t!e maximum amount t!at person is insured for'

    T!e grap!i$al des$ription of t!e servi$e>s 4S9L:

    BSN : T!e so$ial se$urit8 number of a person'A'O"NT : T!e amount of mone8 a person is insured for'

    &(

    3igure 1$/ nsurance com5an= simulation in B%E&.

    3igure 14/ The gra5hical descri5tion o6 the service?s )S!&.

  • 8/11/2019 Bart Van Tee Seling

    32/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    BSN A'O"NT

    ( (555* -55

    2t!er t!an >(> or >*> 5

    T!e get6nsuran$e BP"L simulation test t!e input argument>s format of t!e servi$e$alls' 9epending on t!e BS t!e servi$e returns an amount of mone8'

    -.-. Order su&&lier !"#$ simulationT!e BP"L simulation for an order supplier is $alled suppl82rderH' 9epending on t!eBS number and t!e re+uest $are it gives a response $ontaining a des$ription of t!e$are deliver8 and t!e pri$e'

    &*

  • 8/11/2019 Bart Van Tee Seling

    33/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    Grap!i$al des$ription of t!e suppl82rder 4S9L:

    BSN : Person>s so$ial se$urit8 number'CARE : T!e t8pe of $are t!at needs to be supplied'S"%%& !ETA &S : T!e details of t!e $are suppl8'%R CE: T!e $ost of t!e suppl8 of t!e $are'

    &&

    3igure 1#/ Simulation o6 su55l= order service in B%E&.

    3igure 1(/ The gra5hical descri5tion o6 the service?s )S!&.

  • 8/11/2019 Bart Van Tee Seling

    34/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    T!e follo#ing table des$ribed t!e servi$e>s be!aviour depending on t!e inputre$eived:

    BSN CARE S"%%& !ETA &S %R CE

    ( #!eel$!air 8es /55

    ( transportation 8es /55

    ( 1inor !ome modifi$ation 8es /55

    ( 2t!er t!an above T8pe of re+uested $are notsupported

    5

    * #!eel$!air 8es /55

    * transportation 8es /55

    * 1inor !ome modifi$ation 8es /55

    * 2t!er t!an above T8pe of re+uested $are notsupported

    5

    ot!er An8 string .lient bsn not re$ognized 5

    4e $an simulate t!at t!e $are is a$tuall8 delivered= t!at t!e #rong t8pe of $are #asre+uested= or t!at t!e $lient bsn is not re$ognized'

    -./. Munici&alit( Office receiving WMO-su&&ort requestsAll t!e servi$e in our simulated servi$e%oriented ar$!ite$ture $ome toget!er in t!eoffi$e re$eiving a$tual $lient>s 412%support re+uests' 4!en an offi$e re$eives a412%re+uest= it $!e$ks t!e medi$al advi$e given b8 t!e do$tor= $!e$ks t!e amount

    b8 #!i$! a person is insured= and it tries to order t!e $are re+uested' After doing allt!is it reports t!e result of t!e 412%re+uest and t!e pri$e' T!e servi$e t!at represents

    t!e offi$e is $alled get412H'

    &,

  • 8/11/2019 Bart Van Tee Seling

    35/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    T!e grap!i$al des$ription of t!e get412 4S9L:

    &0

    3igure 1+/ B%E& simulation o6 )'O SOA.

  • 8/11/2019 Bart Van Tee Seling

    36/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    BSN : Person>s so$ial se$urit8 number'CARE : T8pe of $are re+uested'!octerRe6erral : 9oes t!e $lient !ave a do$tors referral< T!is $an be used b8 t!eoffi$e emplo8ees as extra information= for instan$e not to make unne$essar8 servi$e$alls'

    NS"RANCE : 9oes t!e person !ave insuran$e< T!is $an be used b8 t!e offi$eemplo8ees as extra information= for instan$e not to make unne$essar8 servi$e $alls'7moResult : 4!at #as t!e result of t!e 412%re+uesttransportation>or >aspirine>

    no

    * #!eel$!air 8es

    * 2t!er t!an >#!eel$!air> 8es

    2t!er t!an >(> or >*> An8 string unkno#n

    ,&

  • 8/11/2019 Bart Van Tee Seling

    44/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    T!e above data in t!e table provides a tester #it! data !e $an use to see !o# !is

    or !er appli$ation rea$ts to t!e expe$ted out$ome' T!is t8pe of !ard$oding ofs$enarios $an be done for as mu$! s$enarios as 8ou #ant= but it $an be$ome+uite $ompli$ated' So !o# $omplex does t!is a$tuall8 be$ome< 4e !avefound experimentall8 from our $ase stud8C= t!at t!e number of bran$!es if%=elseif%= or else%bran$!esC needed is proportional to t!e number of s$enarios8ou #ant to implement' T!is means:

    ;or n test s$enarios #e need O n bran$!es in our !ard$oded 4S%BP"L simulation'

    4!en #e add #eb servi$e stubs t!at provide us #it! data= like #e introdu$ed in

    se$tion /'(5= t!en #e don>t need to !ard$ode test s$enarios an8more' "vent!oug! t!is is not a !undred per$ent BP"L an8more= it is of $ourse a mu$! better solution'

    4!en #e introdu$e #eb servi$e stubs for data a$$ess= our BP"Lsimulation doesn>t need an8 !ard$oding an8more for $overing n tests$enarios'

    /.4. Simulation com&le+it( So !o# $omplex #ill our simulation be #it! respe$t to t!e original simulationve s!o#n !o# #e $an use a simulated environment for performing

    offlineH integration testing to de$rease t!e amount of real integration testing

    t!at needs to be done= t!e +uestion arises of !o# mu$! $an #e a$tuall8 save b8t!is on t!e $ost of integration testing< T!is +uestion is !ard to ans#er usingt!e #ork in t!is paper' 4e propose some experiments in t!e future #orkse$tion= t!at $ould be done in $ombination #it! our #ork= but are be8ond t!es$ope of t!is proje$t #it! respe$t to time and assets' Do#ever= #e $an derivesome $on$lusions from ot!er #ork= sin$e it s!o#s some resemblan$e #it! our#ork' 0ani. Sinha. Sinha. ,hoolia. 0ukher2ee. and 4hakraborty $laim int!eir #ork t!at t!e8 $an redu$e t!e amount of test $ases t!at !ave to be

    performed on t!e live servi$e%oriented s8stem b8 &(U @& ' Sin$e t!e8 use anapproa$! t!at is partl8 similar to ours= #e $an expe$t our simulation to

    perform alike' 6n fa$t= our solution adds fun$tional s$enario exe$ution to t!esimulation= #!ile 0ani. Sinha. Sinha. ,hoolia. 0ukher2ee. and 4hakrabortyonl8 use mo$k obje$ts #it! pre% and post$ondition and data format tests' 6tmig!t be possible t!at t!e added fun$tionalit8 of our solution $ould performeven better' 2f $ourse= #!ile possible= t!is is based on ot!er resear$!= and #e$an>t tell for sure t!at it #ill #ork' 4e #ill dis$uss in future #ork !o# #e$ould set up an experiment to get more definitive numbers' But for no# #e$an sa8:

    2t!er resear$! suggests t!at #e $an de$rease t!e amount of test $asest!at !ave to be performed on t!e a$tual running servi$e%orientedservi$e b8 at least &5U' alt!oug! t!is is b8 no means proof= #e t!inkt!ere is a strong indi$ation t!at t!is $an be a$!ieved'

    ,0

  • 8/11/2019 Bart Van Tee Seling

    46/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    10. uture work

    10.1. utomation of !"#$ filesA good addition to t!is #ork #ould be to automate t!e generation of t!e simulation in4S%BP"L and t!e re+uired #eb servi$e stubs' T!e 4S%BP"L file and #eb servi$estubs $ould be generated from t!e original 4S9L files of t!e servi$e%orientedar$!ite$ture' T!is $ould $ontribute a lot to t!e usefullnes and usabilit8 of t!e solution'

    10.2. utomation of test data generation6n t!e se$tion on evaluation #e also mentioned !o# interfa$e testing $an be a$!ieved#it! t!e proposed solution' 6t turned out t!at t!is $ould be a$!ieved in doing O 2n

    test $alls= or in 2 n C if #e #ould do it less ex!austivel8' Sin$e t!ese test $alls involvesimple and predi$table $alls= derivable from t!e 4S9L%files= #e t!ink it #ould bever8 #ell possible to automate t!e test $alls and t!e argument values to go #it! it';uture resear$! $ould tr8 to s!o# t!at t!is is possible and $reate some sort ofimplementation of it along t!e #a8'

    10.3. .urther e+&erimentsTo give a stronger argumentation for using t!e proposed solution or some sortextended or improved version of it= it #ould be ni$e to !ave more numbers to supportt!e t!eor8' 4e propose an experiment set up t!at $ould be used in future #ork' ;ort!e s$ope of t!is #ork it is unfeasable to set up su$! an experiment= t!at>s #!8 #e

    propose it in t!is se$tion'

    4e propose to find a simple servi$e%oriented ar$!ite$ture t!at is up and running= anda$$essible t!roug!t t!e internet' 4e build a simulation of t!is servi$e%orientedar$!ite$ture using our proposed solution' o# t#o groups of programmers areneeded' Bot! groups of programmers implement a $omponent t!at !as to be !ookedup to t!e servi$e%oriented ar$!ite$ture' T!e8 get t!e same do$umentation= but onl8one group gets t!e instru$tion to use t!e simulation and use it for testing= until t!e8find no more errors #it! it before going to live testing' T!e ot!er group s!oulddire$tl8 go on to live testing= #it!out using t! simulation at all' 6t #ill be interesting tosee t!e testing time and amount of tests t!at #ill be saved b8 t!e group using oursolution' 4e mig!t also find less expe$ted side effe$ts' ;or instan$e= t!e group of

    programmers t!at perform dire$t live testing mig!t turn out to program more

    pre$isel8= going over t!eir #ork more often before testing= be$ause t!e8 kno#unsu$$esful tests #ill bring extra $osts'

    ,)

  • 8/11/2019 Bart Van Tee Seling

    47/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    11. Conclusion4!en $onne$ting a ne# $omponent to a servi$e%oriented s8stem= integration testing

    !as to be performed' A servi$e%oriented s8stem $an>t be taken offline easil8 for testingsin$e s8stem $omponents are distributed over different lo$ations= and different$omponents are o#ned b8 different parties' T!is means t!at a servi$e%oriented s8stemoften !as to keep running during integration testing' 6t ma8 be$ome polluted #it! testdata= and s8stem performan$e $an de$rease b8 t!e load of test $alls' Also= if t!eservi$e%oriented s8stem uses paid servi$es= test $alls $ost extra mone8'6n t!is paper #e !ave $reated a simulation of a servi$e%oriented ar$!ite$ture' T!e ideais #!en a ne# servi$e $omponent needs to be $onne$ted to t!e servi$e%orientedar$!ite$ture= #e first perform as mu$! of t!e integration testing as possible on t!esimulation' B8 doing t!is #e tr8 to find as man8 errors as possible offline before

    pro$eeding to performing integration testing onto t!e a$tual servi$e%oriented s8stem'T!is #a8 #e minimize t!e burdon of integration testing on a running servi$e%orienteds8stem'T!e simulation #e made #as made in 4S%BP"L' 4e $!ose to use 4S%BP"L be$ause#e suspe$ted it #as #ell suited be$ause of t!e servi$e%oriented nature of t!e language'4e #anted to evaluate !o# #ell suited 4S%BP"L #ould be for t!e job'4e managed to $reate t!e simulation using 4S%BP"L' ;or ea$! #eb servi$e in t!esimulation #e also managed to !ard$ode some fun$tionalit8 t!at simulate somes8stem fun$tionalit8' B8 doing t!at #e $reated t!e possibilit8 of exe$uting tests$enarios using t!e simulation' 4e also $reated an alternative version #!i$! #orks

    better= but uses #eb servi$e stubs t!at $an a$$ess data= and are not pure BP"Lan8more'9uring our evaluation t!e simulation of a servi$e%oriented ar$!ite$ture #e $reated in4S%BP"L= #e found out t!e follo#ing:

    4e $an test a #eb servi$e $omponents interfa$e t!at !as n parameters #it!O 2n test $alls' 6f #e are less pre$ise #e $ould do it in O n test $alls' T!iss!o#s us t!at our solution $an be used for interfa$e $ompatibilit8 testing= butalso t!at automati$ test data generation is an interesting option for future #ork'

    4e $an !ard$ode n testing s$enarios using O n bran$!es in our simulation'4!en #e extend our solution #it! #eb servi$e stubs t!at $an a$$ess test data#e don>t !ave to !ard$ode testing s$enarios an8more= and t!e solution

    be$omes suited for an8 number of testing s$enarios' 6f #e !ave a servi$e%oriented ar$!ite$ture $onsisting of n #eb servi$e

    $omponents= and re+uiring t!e exe$ution of m test s$enarios for a (55U test$overage= #e $an a$!ieve a (55U test $overage #it! a simulation $onsisting ofO n $omponents 4S%BP"L files or servi$e stubsC' T!is means #e $ana$!ieve (55U test $overage for an8 number of test s$enarios #it! oursimulation'

    4e !ave found ot!er resear$! suggesting t!at testing using a simulation $ana$!ieve a de$rease of &(U in tests t!at !ave to be exe$uted on t!e a$tualrunning servi$e%oriented s8stem'

    Given t!e indi$ations #e !ave found t!at our solution #ould be better suitedfor smaller less $ompli$ated servi$e%oriented ar$!ite$tures= #e t!ink it #ould

    be #ell #ort! to do furt!er resear$! for finding #a8s to automation of $reating

    ,-

  • 8/11/2019 Bart Van Tee Seling

    48/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    our solution' 7sing test data and expe$ted responses to t!ose test data toget!er#it! t!e a$tual s8stem>s 4S9L files it ma8 be able to full8 automate oursolution of $reating a simulation' T!is #ould make our solution better suited

    for large and $ompli$ated s8stems' Anot!er good subje$t for future #ork #ould be experiments t!at #ould furt!ervalidate t!e benefits of our proposed met!od of using a 4S%BP"L simulationof a servi$e%oriented ar$!ite$ture for performing offline integration testing'

    Alltoget!er #e t!ink t!at 4S%BP"L is suited for t!e job of simulating servi$e%oriented ar$!ite$tures= and its use $an $ontribute to t!e de$rease of integrationtesting $osts for ne# $omponents on running servi$e%oriented ar$!ite$tures'4e !ave also found out t!at it is ver8 important to !ave some sort of a$$ess toa database or text files #it! test data' Sin$e t!is is not possible #it! pureBP"L #e t!ink it is ne$essar8 to extend t!e BP"L solution #it! #eb servi$e

    stubs t!at $an a$$ess data' 6n our $ase #e used ava for t!ese stubs= but itdoesn>t reall8 matter #!at kind of language is be!ind t!ese servi$es= as long ast!e8 are #eb servi$es t!at $an be used in a BP"L implementation' 4e alsot!ink t!at extensive furt!er resear$! is needed to furt!er validate t!e met!od=and to improve and if possible even automate it'

    ,/

  • 8/11/2019 Bart Van Tee Seling

    49/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    12. Re erencesD1 Provided b8 dr' Alexander Lazovik= assistant professor at t!e RijksuniversiteitGroningen'

    D2 5erardo 4anfora and 0assimiliano ,i Penta ' FTesting services and service-centric s=stems/ Challenges and o55urtunities.G ' 6T Pro= *55)'

    D$ 0ani.sinha.Sinha.,hoolia.0ukher2ee.4hakraborty+ FE66icient Testing o6Service-Oriented A55lications "sing Semantic Service Stu9sG '

    D4 /iaoying Bai. Wenli ,ong. Wei-)ek )sai. 6inong 4hen+ F)S!&-BasedAutomatic Test Case ,eneration 6or )e9 Services TestingG. 6n Proc+ of the &ntl+Workshop on Service- riented Syst+ Eng+ = pages *5-V*(*= 2$t' *550'

    D# 7ikolai )illmann. 8onathan de Halleu+ F)hite-Bo; Testingo6 Behavioral )e9 Service Contracts 7ith %e;G ' 6nternational S8mposium onSoft#are Testing and Anal8sis *55/'

    D( 9a*uel Blanco. 8os: 5arc;a-

  • 8/11/2019 Bart Van Tee Seling

    50/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    D14 %mit Paradkar and %vik Sinha> S5eci6= Once Test Ever=7here/ Anal=5/'

    D1+ 9eiko Heckel and eonardo 0ariani> Automatic Con6ormance Testing o6

    )e9 Services HJ ;undamental Approa$!es to Soft#are "ngineering' Le$ture otes in.omputer S$ien$e= *550'

    D1 5uilan ,ai. /iaoying Bai. 6ongbo Wang. FContract-BasedTesting 6or )e9 ServicesG J &(st Annual 6nternational .omputer Soft#are andAppli$ations .onferen$e= *55-'

    D1 9eiko Heckel. 0arc ohmann> FTo7ards Contract-9ased Testing o6 )e9ServicesG J "le$troni$ otes in T!eoreti$al .omputer S$ien$e " T.SC= anuar8*550'

    D2 )sai. W+)+> Paul. 9+> 6amin Wang> 4hun ,ong Wang> FE;tending )S!&to 3acilitate )e9 Services TestingG J -t! 6""" 6nternational S8mposium on Dig!Assuran$e S8stems "ngineering= *55*'

    D21 i i. Wu 4hou> FAn A9stract ,3S' 'odel 6or O5timal and ncrementalCon6ormance Testing o6 )e9 ServicesGI 6""" 6nternational .onferen$e on 4ebServi$es= *553' 6.4S *553'

    D22 )im 0ackinnon. Steve FEndo-Testing/ "nit Testing7ith 'oc8 O9@ectsGI eItreme Programming and ;lexible Pro$esses in Soft#are"ngineering V IP*555J

    D2$ )illmann. 7+> Schulte. W+> 'oc8-o9@ect generation 7ith 9ehaviorG J *(st6""" A.1 6nternational .onferen$e on Automated Soft#are "ngineering= *55)'AS" >5)'

    D24 0asahiro )anaka and )oru &shida> F%redicting and &earning E;ecuta9ilit= o6Com5osite )e9 ServicesGI 6nternational $onferen$e on servi$e oriented $omputing'

    D2# 4arsten Hentrich. 3we @dun> F%atterns 6or %rocess-Oriented ntegration inService-Oriented ArchitecturesG J

    !ttp: ###'infos8s'tu#ien'a$'at staff zdun publi$ations eplop5)'pdf

    05

  • 8/11/2019 Bart Van Tee Seling

    51/51

    Testing Servi$e%oriented Ar$!ite$tures using a simulation

    D2( S ystem and software engineering and distrbuted systems group. 9i2ksuniversiteit5roningen> FStessi research %ro5osalG J 6nternal R'7'G' 9o$ument= *553'

    D2+ Bertolino. %+> Polini. %+> FThe Audition 3rame7or8 6or Testing)e9 Servicesntero5era9ilit=G J &(st "7R216.R2 .onferen$e on Soft#are "ngineering andAdvan$ed Appli$ations= *550'

    D2 Peter Budny. Srihari 5ovindhara2 and =arsten Schwan> F)orldTravel/ ATest9ed 6or Service-Oriented A55licationsG J 6nternational $onferen$e on Servi$e%2riented .omputing= 6.S2. *55/'

    D2 htt5/JJ777.testdata.nlJinde;.5h5Ko5tionLcomMcontent vie7Larticle idL+1/cursus-9urger