You are on page 1of 51

Testing Service-oriented Architectures using a

simulation
Bart van Teeseling
Rijksuniversiteit Groningen
Supervisors: Alexander Lazovik
Rijksuniversiteit Groningen
Rix Groenboom
Parasoft et!erlands bv
"xternal Revie#er: Paris Avgeriou
Rijksuniversiteit Groningen
Testing Servi$e%oriented Ar$!ite$tures using a simulation
Contents
CONTENTS ........................................................................................................................... 2
1. ABSTRACT ........................................................................................................................ 4
2. NTRO!"CTON .............................................................................................................. #
$. %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'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''(5
0'*' Servi$e%oriented Ar$!ite$ture''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''(5
0'&' Business Pro$ess''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''((
0',' BP"L'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''((
0'0' 6ntegration testing''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''(&
(. E.A'%&E/ )'O SER0CE-ORENTE! S1STE' ................................................. 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,RATON TESTN, "SN, A )S-B%E& S'"&ATON .............................. 12
-'(' 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
2. CASE ST"!1/ '%&E'ENTATON O3 )'O E.A'%&E ..................................... 24
/'(' Tools and soft#are''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*,
/'*' S2Atest'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*,
/'&' BP"L 1aestro'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*,
*
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
4. E0A&"ATON ................................................................................................................. 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<''''''''''''''''''''''''''''''''''''''''''''''''''',0
1-. 3"T"RE )OR* ............................................................................................................ 4(
(5'(' Automation of BP"L files''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''',)
(5'*' Automation of test data generation''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''',)
(5'&' ;urt!er experiments''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''',)
11. CONC&"SON ............................................................................................................... 4+
12. RE3ERENCES ................................................................................................................ 44
&
Testing Servi$e%oriented Ar$!ite$tures using a simulation
1. Abstract
T!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 often
distributed $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%oriented
ar$!ite$ture' An8 ne# $omponents t!at re+uire integration testing $an first be tested
using su$! a simulation' Su$! a simulation uses lo$all8 deplo8ed #eb servi$es= and
ea$! #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 programming
language 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'
,
Testing Servi$e%oriented Ar$!ite$tures using a simulation
2. Introduction
9uring 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 @*)=*3A' T!is small stor8 is just an example
of #!at $an !appen #!en 8ou perform testing on an up and running servi$e%oriented
s8stem' To prevent t!ese kinds of t!ings from !appening= it is desirable to !ave a
seperate testing environment' 6n t!is paper #e evaluate a simulation implemented in
4S%BP"L as su$! an environment'
S8stems #it! a servi$e%oriented ar$!ite$ture $an be made up out of man8 different
sub%s8stems and servi$es t!at $an be !osted in different pla$es= and $an be s!ared b8
man8 different users' 4!en integrating a ne# entit8 or sub%s8stem into an existing
s8stem #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 Bintegration and
a$$eptan$e testingC'
4!en t!e s8stem is used b8 multiple organizations it is not desirable to !alt t!e
s8stem 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' 6f
t!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 tooF
Some servi$e providers $!arge mone8 for servi$e invo$ation' Also= sin$e testing
servi$e%oriented appli$ations often involves multiple invo$ations @*A= t!e burdon on
t!e s8stem mig!t $ause a servi$e provider not to meet its Servi$e Level Agreements
BSLAC= 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 to
t!at resear$!'
6n $!apter 0 #e explain important ba$kground $on$epts and te$!ni+ues t!at pla8 a big
role in our #ork'
.!apter ) presents a real life business pro$ess= and possible s$enarios t!at $an o$$ur
in 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 relating
it 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!er
resear$!'
;inall8= $!apter (( presents a summar8 of our findings and some final $on$lusions'
0
Testing Servi$e%oriented Ar$!ite$tures using a simulation
3. Problem statement
To redu$e t!e testing $osts Btime=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!e
existing servi$e%oriented s8stem= so t!at t!e ne# $omponent to be integrated $an be
tested 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 on
t!e a$tual s8stem'
3.1. Simulated integration testing in service-oriented architectures
6n t!is t!esis #e propose t!e use of 4S%BP"L for simulating a servi$e%oriented
s8stem'
4e t!ink t!at 4S%BP"L #ould be an appropriate language for #riting and exe$uting
test s$enarios' 4S%BP"L $an exe$ute +uite $ompli$ated pro$esses and $an be used to
simulate t!e fun$tionalit8 be!ind t!e #eb%servi$es of t!e existing servi$e oriented
s8stem' Sin$e 4S%BP"L #orks #ell in $ombination #it! #eb servi$es= #e t!ink it is
t!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 in
t!is $ontext'
3.2. Research questions
T!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$al
muni$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#ing
spe$ifi$ resear$! +uestions:
(' Do# $an #e $reate a simulation of a given servi$e oriented ar$!ite$ture using
4S%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$enario
and a given soft#are%oriented ar$!ite$ture' 4e #ill ans#er +uestion * b8 evaluating
our implementation in t!e $!apter $alled G"valuationH'
)
Testing Servi$e%oriented Ar$!ite$tures using a simulation
4. Related work
T!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 alread8
fun$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 generation
T!ere are resear$!ers #!o fo$us on t!e generation of test data for #eb servi$es' Some
use t!e 4S9L to test #eb servi$es @,=-A' 2t!ers fo$us more on a spe$ifi$ $lass of
input data for test generation= like for instan$e data t!at !a$kers mig!t produ$e
ata$king a #eb servi$e @0A= or re+uest messages t!at lead to exe$ution failure @*,A'
2ur resear$! differs from t!is in t!at #e fo$us more on $omposite #eb servi$es= some
of #!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@)A' T!is is
a$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 simulate
existing #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 @)A mig!t be used in $ombination
#it! our resear$!'
4.2. Test automation frameworks
T!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 @/A proposes
to generate grammars from 4S9L>s as an intermediate step in generating a #eb
servi$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!er
met!ods= like proposed in @(5=((=(*=(&A= anal8ze t!e 4S9L to automati$all8 generate
#eb servi$e $alls= and $!e$k t!e #eb servi$e>s response'
6n @3A= 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 of
errors= like for instan$e @(,A= #!ere invariants are anal8zed to see if t!e8 are violated'
T8pes of errors un$overed !ere mig!t be design errors instead of implementation
errors' 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!ings
like t!e data format is @(0A= #!ere ontolog8 properties are tested #it! positive and
negative test $ases'
@()A Proposes a met!od to automati$all8 determine t!e $ompatibilit8 of #eb servi$es'
@(-A proposes to en!an$e servi$e $ompatibilit8 b8 testing a servi$e living up to its
spe$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$ation
to anal8ze input and output= #e anal8ze t!e #eb servi$e>s $ooperation #it! its
-
Testing Servi$e%oriented Ar$!ite$tures using a simulation
simulated environment to see if it #orks #ell' ext to just performing $orre$t $alls
and anal8ze responses= #e also anal8ze t!e fun$tional be!aviour b8 !aving our
simulation en$orporate some semanti$all8 usefull be!aviour'
4.3. Contract based testing
@(/A and @(3A 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' B8
using t!e $ontra$ts one $an test a servi$e>s validit8' Sin$e t!e $ontra$ts provide
information about t!e inner be!aviour of a #eb servi$e= it $ould also be !elpful in
simulating 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= to
des$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 is
to 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$es
abide $ertain rules= like pre% and post$onditions or invariants'
@(-=*(=*/A propose #a8s to perform $onforman$e testing= #!ile @*5A proposes to
extend 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 simulated
environment Ba set of BP"L pro$essesC of servi$es= in #!i$! a servi$e s!ould
su$$esfull8 operate' 6nstead of testing a servi$e for follo#ing its spe$ifi$ation= #e test
it for interoperabilit8 #it! t!e provided environment'
4.5. Mock Objects
1o$k obje$ts are a #ell%kno#n te$!ni+ue to substitute parts of a program #!i$! are
irrelevant for a parti$ular unit test @**=*&A' 6n @*&A 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' @&A
also proposes t!e use of mo$k obje$ts #it! be!aviour= and !ere t!e mo$k obje$ts
te$!ni+ue is a$tuall8 applied to servi$e%oriented appli$ations' T!e mo$k obje$ts in @&A
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 @&A semanti$ servi$e stubs= implemented
in :ava= are used instead of BP"L' 4e use BP"L to implement meaningful test $ases=
#!ile @&A is more suited for automated testing of pre% and post$onditions
$onformation'
/
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 $ould
argue 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'
@*/A presents a testbed for servi$e%oriented ar$!ite$tures' ext to experimenting and
testing ideas= su$! a testbed $ould be used ver8 #ell for simulating an existing s8stem
and 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
Testing Servi$e%oriented Ar$!ite$tures using a simulation
5. Background
A 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 are
involved in using #eb servi$es and servi$e%oriented appli$ations'
5.1. Web Services
4!at exa$tl8 are #eb servi$es< Per!aps t!e most $lear and abstra$t definition $an be
found on @&(A:
GWeb services are typically application programming interfcaes $%P&' or Web %P&(s
that are accessable through H))P and executed in a remote system hosting the
re*uested servicesH
Anot!er formal definition given b8 @&5A is:
G% 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 service
in a manner prescribed by its description using S-%P messages. typically conveyed
using 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 @*/A'
So !o# do #eb servi$es #ork< 9ifferent platforms and programming languages $an
ex$!ange messages Blike fun$tion $alls and repliesC t!roug! a language $alled I1L'
T!e pres$ribed format of t!ese messages is $alled t!e GSimple -b2ect %ccess
ProtocolH BS2APC'
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 $alled
GWeb Service ,escription anguageH B4S9LC'
T!ere is a #a8 for $entrall8 registering 8ou #eb servi$e so ot!ers $an find it= #!i$! is
$alled G3niversal ,escription. ,iscovery and &ntegrationH B7996C'
6n t!is paper it is important to kno# t!e $on$epts 4eb Servi$e= I1L= S2AP= and
4S9L'
5.2. Service-oriented rchitecture
4!at is servi$e%oriented ar$!ite$ture< A formal definition $an be found in @&&A:
G6n $omputing= a servi$e%oriented ar$!ite$ture BS2AC is a flexible set of design
prin$iples used during t!e p!ases of s8stems development and integration' A deplo8ed
S2A%based ar$!ite$ture #ill provide a loosel8%integrated suite of servi$es t!at $an be
used #it!in multiple business domains'H
6n @&5A a Servi$e 2riented Ar$!ite$ture is defined as a form of a distributed s8stems
ar$!ite$ture t!at:
(5
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 in
terms 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!is
des$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 of
distributed $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!e
total ar$!ite$ture of t!e appli$ation' T!e servi$es t!at make up t!e appli$ation are
usuall8 distributed over different servers and #ork toget!er over t!e internet or an
intranet'
An important $!ara$teristi$ is t!at t!e servi$es used in a servi$e%oriented ar$!ite$ture
are loosel8 $oupled' T!e interfa$es of t!e servi$es are independent of t!e
implementation @&*A' Programmers $an build an appli$ation b8 $ombining several
servi$es= #it!out !aving to kno# t!e inner #orkings or exa$t implementation of t!ese
servi$es'
1ost often servi$e%oriented ar$!ite$tures use t!e #eb servi$e standards des$ribed in
t!e previous se$tion on G#eb servi$esH' 6n t!e remainder of t!is paper= #!en #e refer
to a servi$e%oriented ar$!ite$ture= #e assume it used t!e #eb servi$e standards= like
S2AP and 4S9L'
5.3. !usiness "rocess
6n t!is paper #e mention t!e term Gbusiness pro$essH' Alt!oug! it is !ard to assign an
exa$t universal definition to t!e term= t!e $on$ept is not ver8 $ompli$ated' ;ormal
definitions $ould be KT!e set of internal a$tivities performed to serve a $ustomerE @&,A=
or KSet of partiall8 ordered a$tivities intended to rea$! a goalE @&0A'
4e #ould like to define a business pro$ess as Ga set of related a$tivities t!at toget!er
serve a goal Blike 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 @&)A'
5.4. !"#$
BP"L stands stands for Gbusiness pro$ess exe$ution languageH= and it is s!ort for 4S%
BP"L= #!i$! stands for G#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 @&-A'
((
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 done
using a grap!i$al editor= and not just b8 t8ping in BP"L b8 !and @&/A' 6n t!is paper also a
grap!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 #eb
servi$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 a
BP"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.
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 are
ne#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!e
intera$tion bet#een t!e seperate $omponents @&3A' 6n t!is paper #e !ave t!e problem
of 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 alread8
existsing servi$e%oriented s8stem'
(&
3igure 2/ E;am5le o6 B%E& code.
Testing Servi$e%oriented Ar$!ite$tures using a simulation
6. !am"le# $%& ser'ice(oriented s)stem
To 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%oriented
s8stem= 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!e
example servi$e%oriented s8stem' Also= #e #ill des$ribe t!e servi$e%oriented
ar$!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!at
implements 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 oriented
architecture
6n a non%servi$e%oriented s8stem #e $an solve t!e problem of integration testing in a
traditional #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 real
database 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 of
s8stems:
2ur s8stem $omponents are distributed among different servers at different
lo$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 $ompletel8
different platforms'
2ur s8stem $omponents are a$ting as an a$tive $omponent in an up and
running 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 s8stem
in 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 is
running 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 #e
test a $omponent after integrating it in a servi$e%oriented environment'
(,
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 GofflineH Bnot in t!e
real s8stemC= before #e integrate t!e $omponent and do t!e final testing' 6f #e $an
keep t!e integration testing to a minimum at least #e minimize t!e problems' To t!is
end= #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 a
servi$e%oriented s8stem' T!is s8stem #ill be simulated using 4S%BP"L in t!e $!apter
after 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
GofflineH integration testing'
6.2. WMO business &rocess
To 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 B4et 1aats$!appelijke 2ndersteuningC is a 9ut$! la# for supporting people
t!at !ave a $!roni$ disease or disabilit8= so t!at t!ese people $an independentl8 live in
t!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 Be'g' taxi
transportationC= a #!eel$!air= or a !ome modifi$ation Be'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$$ess
external 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 for
re+uesting 412' 6t is a simplifi$ation of a real life situation based on t!e situation in
t!e to#n of Daren in t!e et!erlands @(A'
T!e various a$tivities in t!e business pro$ess are represented b8 #eb servi$es= as
des$ribed in our definition of servi$e%oriented ar$!ite$tures in t!e se$tion
GBa$kgroundH' ;irst= a muni$ipalit8 is $onta$ted b8 a $itizen re+uesting some kind of
support= like a #!eel$!air for instan$e' 6f t!e re+uest is $orre$t a medi$al advi$e is
re+uested from a do$tor b8 means of a servi$e invo$ation' 6f t!e do$tor>s offi$e BGG9
in 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 on
t!e t8pe of $are re+uested= t!e insuran$e $ompan8 is $onta$ted t!roug! a servi$e to
determine t!e amount of t!e $ost of t!e re+uested $are t!at is $overed b8 t!e $itizen>s
insuran$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 BGG9C= 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
Testing Servi$e%oriented Ar$!ite$tures using a simulation
our integration testing problem arises' 6n t!e next $!apter #e #ill implement a
simulation 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 GofflineH integration testing' T!e $!apters
after t!at #ill evaluete !o# #ell suited t!is met!od is'
6.3. WMO architecture and scenarios
6n 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 $an
arise in t!at business pro$ess'
()
Exit
No
concrete
question
Intake (including
question
clarfification) (by
Frontoffice)
Support request
Medical advice
(performed by
!)
"ualified for
application#
No ($e%ection)
&es
'ersonal
budget or
insurance
'ersonal (udget
'ayment (c)eck
for correctness is
done later)
Insurance
*)ic)
provisions#
!omestic )elp
*)eelc)air+
,ransportation+
Minor )omemodification
Supply order
-dvise and
information
provision about
suppliers
!elivery (by
external party)
$eceive invoice
'ayment
-pplication is
entered into t)e
system (by
(ackoffice)
!
.ity +
overnment
.are
supplier
.iti/en
$equesting
support
0EEN!
Insurance
company
3igure $/ Business 5rocess 6or the !utch )'O la7
Testing Servi$e%oriented Ar$!ite$tures using a simulation
6n t!e ar$!ite$ture $ommuni$ation bet#een different parties Bindi$ated b8 different
$olorsC is done t!roug! #eb servi$es' ;or ea$! of t!ese parties #e $an define
integration 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<ien integration testing scenarios
412 re+uest to Government BT!roug! #eb form for exampleC
Re$eive result and instru$tions from government
6n a servi$e%oriented ar$!ite$ture like t!is= made up of different independent parties= it
mig!t !appen t!at a ne# part8 needs to be $onne$ted to t!e s8stem'
;or instan$e= imagine a ne# to#n offi$e to be opened for a ne# $it8= or a $it8 t!at
#asn>t !ooked up to t!e 412 servi$e s8stem 8et' 6n order for t!e to#n offi$e to be
!ooked up to t!e 412 s8stem it #ould !ave to test its soft#are' To do t!is= it #ould
!ave to $all t!e servi$es for Gmedi$al advi$eH and Gsuppl8 orderH repeatedl8' 4!en
t!ese servi$e $alls $ost mone8 per seperate $all t!is $an $ost a lot of mone8' Also= t!e
overall performan$e of t!e 412 s8stem $an degrade' ext to t!at= emplo8ees at t!e
offi$es of t!e order suppliers and t!e medi$al advi$e offi$e need to #eed out t!e test
$ases from t!e real $ases' T!is $osts t!e emplo8ees time= and t!erefore t!is $osts t!eir
emplo8er mone8' So b8 testing a ne# part of a servi$e%oriented s8stem #e stand to
loose a lot of performan$e= time and mone8'
(-
Testing Servi$e%oriented Ar$!ite$tures using a simulation
*. Integration testing using a $+(BP, simulation
6n 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$tivel8
running 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 different
lo$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 Be'g' b8
unit 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! test
data' 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#een
legitimate 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 integration
tests 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= some
servi$es $ost mone8 per invo$ation= so t!e more $alls t!at are needed during
t!e performan$e of t!e integration testing= t!e !ig!er t!e $ost of t!e integration
testing $an turn out to be'
6n order to de$rease t!e amount of live testing a ne# servi$e #!en integrating it into
an existing servi$e%oriented s8stem= #e propose to $reate a simulation of t!e existing
servi$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!e
amount of testing errors during live testing= !ereb8 saving t!e $osts of servi$e
invo$ation= emplo8ees> #asted time= and minimizing t!e overall s8stem performan$e
degradation' 6n ot!er #ords t!e goal is to de$rease t!e overall $ost of t!e pro$ess of
integration 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' 2ne
4S%BP"L file to or$!estrate all t!e servi$es to implement t!e business pro$ess= and
one 4S%BP"L file for ea$! #eb servi$e $omponent' 4e #ant to give ea$! #eb
servi$e $omponent B#!i$! is a 4S%BP"L file in t!e simulationC !ard$oded
fun$tionalit8= so t!at #e $an perform some usefull a$tions during integration testing=
using our simulation'
(/
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 provide
t!e same servi$e Bfor instan$e= multiple do$tors $an be !ooked up to be $alled
for medi$al advi$e= or a to#n $ould !ave multiple offi$e>s #!ere one $ould go
to for 412 re+uests= et $eteraC'
A ne# part8 #ants t!eir servi$e to be $onne$ted to t!e servi$e%oriented
s8stem' 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 !ave
to be repeated= and t!e live s8stem gets burdonned #it! test data= mixed #it! real data
from 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 #!ile
doing t!is $at$!ing as mu$! errors as #e $an= before #e move on to t!e a$tual live
testing #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.
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 a
version of t!e simulated s8stem among ever8one #!o #ants to !ook up a ne# servi$e
to t!e live servi$e%oriented s8stem'
;or instan$e= #!en a part8= lets $all t!em $ompan8 A= #ants to $onne$t an
implementation of servi$e number *= t!e8 first test t!eir appli$ation b8 taking t!e
simulation of t!e s8stem= taking out t!e simulation of servi$e number *= and repla$ing
it #it! t!eir o#n appli$ation'
*.2. !"#$ for functionalit( and creating test data and scenarios
4e 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 some
simple be!aviour to ea$! of t!e simulated servi$es' To illustrate t!is $onsider an
example:
;or simulating servi$e = part of t!e #!ole simulated servi$e%oriented s8stem= #e use
a seperate BP"L file' Lets sa8 for instan$e= servi$e is a servi$e t!at returns
someone>s name and address #!en 8ou $all it #it! t!at person>s so$ial se$urit8
number' 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 is
unkno#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 G(5555(H= for instan$e G:o!n
9oe= 4illo#road (= Lip $ode (*&= 1an$!esterH' 4e $an additionall8 !ard$ode t!e
*5
3igure #/ ,eneral structure o6 a simulation o6 service-oriented s=stem.
Testing Servi$e%oriented Ar$!ite$tures using a simulation
servi$e simulation to return eit!er an ex$eption or a Gperson%not%foundH%message
#!en #e $all it #it! so$ial se$urit8 number G(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!e
simulation of servi$e #it! G(5555(H as an argument to test a s$enario involving a
su$$esful Gname and addressH%retrieval= or t!e8 $an $all it #it! G(5555*H to test a
s$enario involving an unsu$$esful Gname and addressH%retrieval'
6n addition to t!e adding of test data in t!e #a8 des$ribed above= BP"L also provides
eas8 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 Bstring= 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$! an
engine a tester $ould just start t!e engine and !e !as an a$tual simulation running
lo$all8= #it!out !aving to $onfigure or program somet!ing' T!is brings us to t!e
follo#ing situation for t!e simulation:
*(
Simulation of t)e service 1
oriented system
(System logic simulated in
('E0)
'ort,ype 2
'ort,ype N
Simulation of Service 3 in ('E0
4ardcoded be)aviour depending on input
argument values5
Simulation of Service N in ('E0
4ardcoded be)aviour depending on input
argument values5
'ort,ype 2
Simulation of Service 2 in ('E0
4ardcoded be)aviour depending on input
argument values5
3 6
3 6
3 6
.
.
.
.
('E0 Engine
3igure (/ ,eneral structure o6 a B%E& simulation o6 a service-oriented s=stem.
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 to
go troug!<
(' .onta$t t!e s8stem administrator= #!o sends over a simulation of t!e s8stem=
toget!er #it! test data'
*' Take t!e simulation= take out t!e simulation of t!e part t!e8 #ant to test for=
and repla$e it #it! t!eir o#n servi$e appli$ation'
**
3igure +/ Send a simulation to those 7ho 7ant to connect their com5onent to the SOA.
3igure 2/ n the simulation re5lace 5art o6 the simulation 9= =our im5lementation.
Testing Servi$e%oriented Ar$!ite$tures using a simulation
&' Test t!eir appli$ation integrated #it! t!e simulation= until it #orks #ell for all
t!e test data'
,' S!o# t!e results of t!e simulation tests to t!e s8stem administrator and get
a$$ess for live testing'
*&
Testing Servi$e%oriented Ar$!ite$tures using a simulation
-. Case +tud)# Im"lementation o. $%& e!am"le
To give a demonstration of our approa$!= #e give an implementation of t!e business
pro$ess for 412 la#= as dis$ussed in $!apter 0' 4e #ill use t!is implementation for
demonstrating our proposed solution= and to evaluate t!at solution'
;irst #e #ill des$ribe t!e tools #e used for implementing t!e $ase stud8= and t!en #e
#ill des$ribe t!e design of t!e implementation= along #it! a des$ription of t!e final
resulting soft#are'
-.1. Tools and software
4e use t!e Parasoft tool S2Atest and BP"L 1aestro' BP"L 1aestro is used as t!e
BP"L engine= and S2Atest is a testing tool among #!i$! #eb servi$e $alls $an be
generated' T!e reasons t!ese tools #ere $!osen are t!e follo#ing:
S2Atest and BP"L 1aestro #ork #ell toget!er'
BP"L 1aestro is a BP"L "ngine #it! an eas8%to%use grap!i$al user interfa$e'
Bot! tools #ere provided for free b8 Parasoft et!erlands b'v'
S2Atest $an generate #eb servi$e $alls #!i$! is ver8 useful during testing of
t!e BP"L s$ripts'
Belo# #e #ill give a more elaborate des$ription of t!e used tools= S2Atest and BP"L
1aestro'
-.2. SOtest
S2Atest is developed b8 a $ompan8 $alled Parasoft= and it is a testing tool for servi$e%
oriented ar$!ite$tures' 6t $ontains features su$! as #eb servi$e stubbing= me$!anisms
for regression testing of #eb servi$es= and man8 ot!er features t!at are be8ond t!e
s$ope of t!is implementation'
6n our approa$! #e onl8 use S2Atest to test our separate BP"L files= b8 $alling it and
examining t!e response' So #e use it to test our servi$e%oriented s8stem simulation or
parts of it'
-.3. !"#$ Maestro
BP"L 1aestro is integrated #it! S2Atest= and also developed b8 Parasoft' BP"L
1aestro is t!e tool #e !ave used t!e most for t!is protot8pe implementation' 4e use
it as a BP"L engine'
4it! BP"L 1aestro #e !ave a grap!i$al editor for $reating and editing 4S%BP"L
files' T!e tool allo#s us to s#it$! ba$k and fort! bet#een 4S%BP"L $ode files and a
grap!i$al represntation of t!e 4S%BP"L files' Besided editing and debugging= BP"L
1aestro also provide BP"L engine= #!i$! allo#s us to a$tuall8 run our BP"L files=
so #e $an a$tivel8 use t!em'
-.4. )esign
4e #ant to implement a BP"L simulation of t!e 412 business pro$ess= as depi$ted
in figure ('
4e #ant to $reate seperate 4S%BP"L files for ea$! entit8 t!at #ould be a #eb
servi$e in real life' T!is #a8 ea$! $omponent B#eb servi$eC $an be tested #it! t!e
protot8pe' 6f 8ou #ant to perform integration testing for a parti$ular $omponent= just
*,
Testing Servi$e%oriented Ar$!ite$tures using a simulation
ex$!ange t!e 4S%BP"L file for t!e real implementation in t!e simulation' T!e
seperate #eb servi$e $omponents #ill be or$!estrated using one BP"L file t!at #ill
$ontain all t!e $omponents' T!is #a8 a BP"L%simulation as a #!ole $an be
distributed= and testers $an $!oose #!i$! part of t!e simulation t!e8 #ant to repla$e
b8 t!eir o#n appli$ation' 6n figure 3 8ou $an see t!e !ig! level design for t!e
simulation of t!e implementation of t!e 412 business pro$ess 4S%BP"L
simulation'
To illustrate t!e use of t!e solution lets sa8 #e #ant to implement an appli$ation for a
muni$ipalit8 offi$e taking in re+uests of $itizens for 412%support' 4e #ould go
t!roug!t t!e follo#ing steps'
(C Re$eive t!e 4S%BP"L%simulation of t!e #!ole s8stem'
*C Repla$e part of t!e simulation t!at represents t!e muni$ipalit8 offi$e
b8 our o#n appli$ation of t!e muni$ipalit8 offi$e servi$e'
*0
3igure 4/ >igh level design 6or the )S-B%E& simulation o6 the !utch )'O 9usiness 5rocess.
Testing Servi$e%oriented Ar$!ite$tures using a simulation
&C Lo$all8 test our appli$ation using t!e simulation= improve our
appli$ation based on t!ese results= until #e find no more errors in our
appli$ation using t!e simulation'
,C 6ntegrate our appli$ation of t!e muni$ipalit8 offi$e servi$e #it! t!e real
s8stem'
*)
Testing Servi$e%oriented Ar$!ite$tures using a simulation
-.5. "resentation of software
;or ea$! of t!e seperate servi$es= t!e 2ffi$e re$eiving 412%support re+uests= t!e
GG9= t!e 6nsuran$e $ompan8= and t!e 2rder supplier #e $reated a BP"L file' T!ese
*-
3igure 1-/ >o7 to use the 5ro5osed solution 6or integration testing o6 a munici5alit= o66ice
im5lementation.
Testing Servi$e%oriented Ar$!ite$tures using a simulation
4S%BP"L files are $ontained in an overall 4S%BP"L file #!i$! serves as t!e
or$!estrating file of t!e overall business pro$ess= like explained in t!e previous
se$tion on design'
;or ea$! of t!e 4S%BP"L files= #e #ill give a grap!i$al representation of t!e file=
#!i$! is a s$reens!ot of t!e a$tual implementation= taken from t!e BP"L 1aestro
BP"L engine' Also #e #ill give a grap!i$al representation of t!e 4S9L interfa$e=
#!i$! des$ribes t!e #eb servi$e interfa$e of t!e 4S%BP"L file' ;or ea$! BP"L file
#e give an inpunt and output table= to des$ribe input and output data for test
s$enarios' T!e input data $an be used to exe$ute test s$enarios= and t!e output data
des$ribes #!at response to expe$t'
4e #ill start #it! t!e seperate servi$es t!at pla8 a role in t!e business pro$ess= and
end #it! t!e des$ription of t!e BP"L file t!at represents t!e overall business pro$ess'
*/
Testing Servi$e%oriented Ar$!ite$tures using a simulation
-.6. **) !"#$ simulation
T!e GG9 is a do$tor>s offi$e t!at $an give medi$al advi$e about #!et!er or not a
$lient needs a $ertain kind of 412 support'
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'
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!&.
Testing Servi$e%oriented Ar$!ite$tures using a simulation
A!0CE: 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 Gmedi$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 sure
t!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' B8
using 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!aviour
using 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 Bpart ofC different s$enarios b8 sending t!e
servi$e different input values'
&5
Testing Servi$e%oriented Ar$!ite$tures using a simulation
-.*. %nsurance com&an( !"#$ silmulation
T!e BP"L servi$e for t!e insuran$e $ompan8 is $alled Gget6nsuran$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!&.
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 !"#$ simulation
T!e BP"L simulation for an order supplier is $alled Gsuppl82rderH' 9epending on t!e
BS 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'
&*
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"%%&1!ETA&S: T!e details of t!e $are suppl8'
%RCE: 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!&.
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 input
re$eived:
BSN CARE S"%%&1!ETA&S %RCE
( #!eel$!air 8es /55
( transportation 8es /55
( 1inor !ome modifi$ation 8es /55
( 2t!er t!an above T8pe of re+uested $are not
supported
5
* #!eel$!air 8es /55
* transportation 8es /55
* 1inor !ome modifi$ation 8es /55
* 2t!er t!an above T8pe of re+uested $are not
supported
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 #as
re+uested= or t!at t!e $lient bsn is not re$ognized'
-./. Munici&alit( Office receiving WMO-su&&ort requests
All t!e servi$e in our simulated servi$e%oriented ar$!ite$ture $ome toget!er in t!e
offi$e re$eiving a$tual $lient>s 412%support re+uests' 4!en an offi$e re$eives a
412%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 all
t!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 Gget412H'
&,
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.
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!e
offi$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$e
emplo8ees 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+uest<
%RCE: T!e $ost of t!e re+uest after dedu$ting insuran$e mone8' 6f t!is amount is
zero or less t!an all t!e $are is $overed b8 insuran$e= ot!er#ise part !as to be paid b8
t!e $lient'
T!e follo#ing table des$ribes t!e be!aviour of t!e Gget412H BP"L simulation:
BSN Care Advice insurance 7moResult 5rice
( transportation 8es An8 string 2rder #ill be
delivered
%*55
( aspirine 8es An8 string T8pe of re+uested
$are not supported
5
( 2t!er no An8 string egative advi$e 5
* #!eel$!air 8es An8 string 2rder #ill be
delivered
(55
* 2t!er t!an
>#!eel$!air>
8es An8 string egative advi$e 5
2t!er t!an
>(> or >*>
An8 string unkno#n An8 string 9o$tors advi$e
unkno#n be$ause
!e does not
re$ognize bsn
5
&)
3igure 12/ The gra5hical descri5tion o6 the get)'O )S!&.
Testing Servi$e%oriented Ar$!ite$tures using a simulation
-.10. dding #+ternal services for data access
4!en #e allo# ourselves to go one step be8ond BP"L= #e $an a$!ieve a mu$! better
simulation tool t!an #e !ave rig!t no#' Sin$e #e $an>t perform dire$t data a$$ess= e'g'
to databases= #e !ave to !ard $ode all t!e options of our simulation' T!is is of$ourse
not desirable' 4!at #e $an do in BP"L is $alling #eb servi$es' T!erefore #e propose
to use some simple #eb servi$e stubs= t!at allo# for a$$ess to test data'
6n t!e previous se$tions= ea$! invo$ation in t!e simulation #as made to a #eb servi$e
t!at #as implemented b8 anot!er BP"L file' 6n t!e remaining se$tions of t!is $!apter
#e s!o# a solution #!ere ea$! invo$ation b8 t!e simulation is made to a #eb servi$e
stub t!at $an a$$ess data' ;irst #e #ill explain t!e #eb servi$e stubs= and t!en #e>ll
s!o# t!e main simulation BP"L file t!at or$!estrates t!e servi$e stubs'
-.11. ,ava-based web service stubs
4e #ant to build java stubs t!at $an a$$ess data' Sin$e t!is is a protot8pe #e keep it
lig!t and simple= and #e #ill use text files for t!e data storage'
4e #ill need data for all t!e $omponents in t!e 412 simulation: medi$al advi$e
data= insuran$e data= and order supll8 data' 4e #ill seperate t!e data $olumns in t!e
text file b8 t!e >=>%sign' Belo# is t!e data file for t!e examples= of $ourse 8ou $ould
add as man8 ro#s as 8ou like' Above t!e data are t!e $olumn definitions:
&-
3igure 14/ The im5roved solution 7ith @ava-9ased 7e9 service stu9s that can access the test data.
Testing Servi$e%oriented Ar$!ite$tures using a simulation
BS= .AR" R"P7"ST"9= 1"96.AL A9Q6."= 6S7RA."BRC= S7PPLS
PR6."
(= transportation= 8es= &55555= (555
(= aspirine= 8es= &55555= &&&
*= #!eel$!air= 8es= 05555= &055
&= valium= 8es= (55555= (55
&= #!eel$!air= no= (55555= &055
o# #e need t!e stubs to read in t!e data and respond to an8 invo$ations made' T!e
stubs are made in :ava'
T!e medicalAdvice #eb servi$e !as an operation $alled getAdviceA9snBcareC= and it
returns a string #it! t!e advi$e= meaning #!et!er or not t!e person reall8 s!ould get
t!e $are'
T!e getnsurance #eb servi$e !as an operation $alled getAdviceAmountA9snC' 6t
returns t!e amount a person is insured for'
T!e su55l=Order #eb servi$e !as an operation $alled getOrder%riceA9snBcareC' 6t
returns t!e pri$e of t!e order if it exists= ot!er#ise it returns %('
"a$! of t!ese #eb servi$es $!e$k t!e data file and respond a$$ording to t!e $ontents
of t!e data file'
o# #e !ave d8nami$ #eb servi$e stubs= and #e need t!e BP"L file to or$!estrate
t!em to $omplete t!e 412 simulation' T!e :ava%based #eb servi$e stubs #ere
developed in 2pen "SB= and #e #ill do t!e same for our final BP"L simulation= to
keep t!e number of running programs to a minimum'
Belo# 8ou see t!e BP"L simulation= toget!er #it! t!e #eb servi$e stubs on t!e rig!t'
4e $an no# use as mu$! test data as #e like= #it!out furt!er $ompli$ating t!e BP"L
simulation' 4e simpl8 edit t!e text files if #e #ant to add ne# test s$enarios' 4!en
someone no# #ants to test t!eir implementation of a medi$al advi$e #eb servi$e or
an insuran$e #eb servi$e !e or s!e $an simpl8 ex$!ange t!eir appli$ation #it! t!e
$orresponding #eb servi$e stub' 2f $ourse t!eir implementation s!ould use t!e same
data set as t!e stub t!at #as removed'
&/
Testing Servi$e%oriented Ar$!ite$tures using a simulation
-.12. #+am&le Scenarios
7sing our ne# solution #e $an exe$ute test s$enarios' T!e possibilities are endless of
$ourse= but to give an idea #e>ll s!o# t!ree s$enarios t!at #e used #it! our demo of
t!e solution:
&3
3igure 2-/ The com5lete B%E& )'O simulation in O5en ESB together 7ith on the right the
7e9 service stu9s that can access data.
Testing Servi$e%oriented Ar$!ite$tures using a simulation
Scenario 1/ Su$$essful re+uest and $ost $overed b8 insuran$e'
Re+uest:
Response:
Scenario 2/ 412 denied be$ause $are $ould not be supplied'
Re+uest:
Response:
,5
Testing Servi$e%oriented Ar$!ite$tures using a simulation
Scenario $/ 412 denied be$ause of negative medi$al advi$e'
Re+uest:
Response:
o# #!en #e test our implementation of a $ertain $omponent using t!e simulation=
#e simpl8 run t!e s$enario>s= and see if ever8t!ing be!aves as expe$ted'
,(
Testing Servi$e%oriented Ar$!ite$tures using a simulation
/. 'aluation
6n t!is se$tion #e dis$uss t!e result of t!e BP"L%simulation of t!e 412 servi$e%
oriented s8stem #e $reated' Bot! t!e implementation of t!e BP"L%simulation and
t!e details of t!e servi$e%oriented 412 s8stem are des$ribed in t!e previous
$!apters'
4e #ill dis$uss !o# #ell #e $an perform different t8pes of testing using our
solution' 4e #ill start #it! t!e evaluation of non%fun$tional testing' After t!at #e
#ill dis$uss interfa$e testing= s$enario testing= t!e $omplexit8 of t!e
implementation= and #e #ill dis$uss test $overage'
/.1. -on-functional testing
2ur BP"L%simulation is more suited for some t8pes of non%fun$tional testing t!an
ot!ers' 4e evaluate t!e non%fun$tional testing $apabilities of our solution !ere t!at
stand out'
Com5ati9ilit= Testing and integration testing: 2ur solution is ver8 #ell
suited for $ompatibilit8 testing' 6t $an be used for testing a $omponent>s
$ompatibilit8 #it! t!e rest of a servi$e%oriented s8stem #it! respe$t to t!e #eb
servi$e interfa$e defined in t!e 4S9L>sof t!e s8stem $omponents' 4e #ill get
ba$k to t!is in t!e se$tion belo# on interface testing' 2ne mig!t also $onsider
t!is part of integration testing = but integration testing also involves fun$tional
aspe$ts= testing #!et!er t!e s8stem still fun$tions $orre$tl8 after integration of
seperate $omponents' 4e #ill dis$uss more on fun$tional testing #it! our
solution in t!e se$tion on functional testing of scenarios belo#'
&oad testing or 5er6ormance testing: Alt!oug! it #ould be possible to $reate
some sort of BP"L pro$ess t!at #ould $all a servi$e t!at is to be tested
repeatedl8= t!is #ould make little sense' T!e performan$e limit of t!e BP"L%
simulation doing t!e #ebservi$e invo$ation mig!t be #orse t!an t!e
performan$e of t!e tested servi$e for re$eiving invo$ations' 6t #ould be better
to use a spe$ial performan$e testing tool for t!is Be'g' Load test or S2AtestC'
/.2. %nterface testing
4S%BP"L is ver8 #ell suited for testing argument formats of #eb servi$e
invo$ation' 4s%BP"L !as a spe$ial validate-tag defined for t!is= t!at $!e$ks t!e
format of t!e arguments used in a #eb servi$e invo$ation against t!e paramater
data t8pe definition' ;or instan$e #!en an argument s!ould be an integer= t!e
validate%tag ensures t!at t!e argument used in a #eb servi$e $all is indeed an
integer= ot!er#ise t!e 4S%BP"L file representing t!e #eb servi$e #ill t!ro# an
ex$eption'
4e $an define extra properties for variables t!at aren>t alread8 definined using
IS9 BI1L S$!ema 9efinitionC @&-A= but most #ell kno#n primitive data t8pes=
su$! as boolean= string= float= et $etera= are alread8 prefefined'
;or ea$! parameter #e $an provide eit!er a $orre$t or an in$orre$t data t8pe= #!en
#e perform an invo$ation' 4!en #e define t!e number of parameters for a #eb
servi$e invo$ation as n= #e $ould test all $ombinations of $orre$t and in$orre$t
parameter data t8pe values in OA 2
n
C test invo$ations'
,*
Testing Servi$e%oriented Ar$!ite$tures using a simulation
6f #e t!ink testing a $ombination of fault8 paramaters doesn>t add an8 value #it!
respe$t to testing t!e fault8 parameters seperatel8= #e $ould just $all a #eb servi$e
on$e for ea$! parameter= $alling #it! one in$orre$t t8pe parameter= #!ile #e use
$orre$t data t8pes for t!e ot!er paramaters' 6n t!at $ase #e $ould suffi$e #it! OA n
C $alls' "it!er #a8= it #ould be interesting to look at automated test data
generation for t!is' 4e #ill get ba$k to t!at in t!e se$tion on future #ork'
Summarizing t!is $on$lusion:
T!e proposed solution $an be used for interfa$e testing' 6f #e #is! to test all
possible $ombinations of a #eb servi$e $omponent #it! n parameters= t!is
#ould take OA 2
n
C test $alls' 6f #e are satisfied #it! just testing for ea$!
parameter one test $all #it! a $orre$t parameter value and one test $all for a
parameter value of an in$orre$t data t8pe= #e $an a$!ieve t!is in OA n C test
$alls'
/.3. .unctional testing of scenarios
4e #ere able to !ard$ode an example of a positive test $ase= a negative test
$ase= and a unde$isive test $ase Be'g' 412 support re+uest for person #it! an
unkno#n bsn numberC for ea$! s$enario #e looked at' 4e !ard$oded t!e
examples using simple statements Be'g' if%else%statementsC' ;or instan$e= #e
!ard$oded t!e GG9 $omponent BP"L simulation BT!e do$tors t!at give
medi$al advi$eC to give a positive medi$al advi$e for people t!at eit!er G!ave
a BS B9ut$! so$ial se$urit8 numberC of ( and re+uest for transportation or
aspirineH or for people t!at G!ave a BS of * and re+uest a #!eel$!airH'
People #it! a BS of ( or * t!at re+uest an8 ot!er $are t!an defined in t!e
previous senten$e get a negative medi$al advi$e= and people #it! an8 ot!er
BS t!an ( or * are $onsidered unkno#n'
4orking like t!is allo#s us to provide t!e testers #it! data for exe$uting test
s$enarios for positive medi$al advi$e Bpositive test $aseC= negative medi$al
advi$e Bnegative test $aseC= and person unkno#n Bunde$isiveTnegative test
$aseC' 4e repeat t!e input and output table !ere from t!e implementation
se$tion for $larit8:
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
,&
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 of
s$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 !ave
found Bexperimentall8 from our $ase stud8C= t!at t!e number of bran$!es Bif%=
elseif%= or else%bran$!esC needed is proportional to t!e number of s$enarios
8ou #ant to implement' T!is means:
;or n test s$enarios #e need OA n C 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' "ven
t!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"L
simulation doesn>t need an8 !ard$oding an8more for $overing n test
s$enarios'
/.4. Simulation com&le+it(
So !o# $omplex #ill our simulation be #it! respe$t to t!e original simulation<
7nfortunatel8= t!e simulation #ill !ave to !ave as mu$! BP"L files implementing
servi$e $omponents= as t!e original servi$e%oriented s8stem !as #eb servi$es' T!is
means t!at for ver8 $omplex s8stems it mig!t not be feasable to $reate a simulation
using our proposed solution= espe$iall8 if t!e s8stem #ill $!ange a lot over time'
;or simulating a servi$e%oriented ar$!ite$ture #it! n servi$es= #e need OA n C
servi$es BBP"L files or #eb servi$e stubsC in our simulation'
/.5. Test coverage
So !o# do #e do #!en #e #ant to use t!e proposed solution to a$!ieve a (55U test
$overage< To evaluate t!is= first let us assume t!e follo#ing:
(C 4e sa8 t!at #e !ave a (55U test $overage #!en ea$! feature is tested b8 at
least one s$enario'
*C A feature is usuall8 tested using at most OA 1 C s$enarios Be'g' s$enarios for a
su$$esful test $ase= and a test $ase for ex$eptions like unkno#n data or
in$orre$t data formatC'
7sing t!ese fa$ts #e $an derive t!at:
;or simulating a servi$e%oriented ar$!ite$ture #it! n #eb servi$e $omponents=
and (55U of t!e feature testing being $overed b8 m test s$enarios= #e $an
a$!ieve a (55U test $overage using t!e proposed solution #it! OA n C
$omponents B4S%BP"L files or #eb servi$e stubsC'
,,
Testing Servi$e%oriented Ar$!ite$tures using a simulation
/.6. Overall decrease of integration testing costs/
o# t!at #e>ve s!o#n !o# #e $an use a simulated environment for performing
GofflineH 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 b8
t!is on t!e $ost of integration testing< T!is +uestion is !ard to ans#er using
t!e #ork in t!is paper' 4e propose some experiments in t!e future #ork
se$tion= t!at $ould be done in $ombination #it! our #ork= but are be8ond t!e
s$ope of t!is proje$t #it! respe$t to time and assets' Do#ever= #e $an derive
some $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 in
t!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 @&A' Sin$e t!e8 use an
approa$! 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!e
simulation= #!ile 0ani. Sinha. Sinha. ,hoolia. 0ukher2ee. and 4hakraborty
onl8 use mo$k obje$ts #it! pre% and post$ondition and data format tests' 6t
mig!t be possible t!at t!e added fun$tionalit8 of our solution $ould perform
even 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 $ases
t!at !ave to be performed on t!e a$tual running servi$e%oriented
servi$e b8 at least &5U' alt!oug! t!is is b8 no means proof= #e t!ink
t!ere is a strong indi$ation t!at t!is $an be a$!ieved'
,0
Testing Servi$e%oriented Ar$!ite$tures using a simulation
10. 1uture work
10.1. utomation of !"#$ files
A good addition to t!is #ork #ould be to automate t!e generation of t!e simulation in
4S%BP"L and t!e re+uired #eb servi$e stubs' T!e 4S%BP"L file and #eb servi$e
stubs $ould be generated from t!e original 4S9L files of t!e servi$e%oriented
ar$!ite$ture' T!is $ould $ontribute a lot to t!e usefullnes and usabilit8 of t!e solution'
10.2. utomation of test data generation
6n 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 OA 2
n
C
test $alls= or in 2B n C if #e #ould do it less ex!austivel8' Sin$e t!ese test $alls involve
simple and predi$table $alls= derivable from t!e 4S9L%files= #e t!ink it #ould be
ver8 #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 of
implementation of it along t!e #a8'
10.3. .urther e+&eriments
To give a stronger argumentation for using t!e proposed solution or some sort
extended or improved version of it= it #ould be ni$e to !ave more numbers to support
t!e t!eor8' 4e propose an experiment set up t!at $ould be used in future #ork' ;or
t!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= and
a$$essible t!roug!t t!e internet' 4e build a simulation of t!is servi$e%oriented
ar$!ite$ture using our proposed solution' o# t#o groups of programmers are
needed' Bot! groups of programmers implement a $omponent t!at !as to be !ooked
up to t!e servi$e%oriented ar$!ite$ture' T!e8 get t!e same do$umentation= but onl8
one group gets t!e instru$tion to use t!e simulation and use it for testing= until t!e8
find no more errors #it! it before going to live testing' T!e ot!er group s!ould
dire$tl8 go on to live testing= #it!out using t! simulation at all' 6t #ill be interesting to
see t!e testing time and amount of tests t!at #ill be saved b8 t!e group using our
solution' 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'
,)
Testing Servi$e%oriented Ar$!ite$tures using a simulation
11. Conclusion
4!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 testing
sin$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 s8stem
often !as to keep running during integration testing' 6t ma8 be$ome polluted #it! test
data= and s8stem performan$e $an de$rease b8 t!e load of test $alls' Also= if t!e
servi$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 idea
is #!en a ne# servi$e $omponent needs to be $onne$ted to t!e servi$e%oriented
ar$!ite$ture= #e first perform as mu$! of t!e integration testing as possible on t!e
simulation' 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%oriented
s8stem'
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!e
simulation #e also managed to !ard$ode some fun$tionalit8 t!at simulate some
s8stem fun$tionalit8' B8 doing t!at #e $reated t!e possibilit8 of exe$uting test
s$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"L
an8more'
9uring our evaluation t!e simulation of a servi$e%oriented ar$!ite$ture #e $reated in
4S%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!
OA 2
n
C test $alls' 6f #e are less pre$ise #e $ould do it in OA n C test $alls' T!is
s!o#s us t!at our solution $an be used for interfa$e $ompatibilit8 testing= but
also t!at automati$ test data generation is an interesting option for future #ork'
4e $an !ard$ode n testing s$enarios using OA n C 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 of
OA n C $omponents B4S%BP"L files or servi$e stubsC' T!is means #e $an
a$!ieve (55U test $overage for an8 number of test s$enarios #it! our
simulation'
4e !ave found ot!er resear$! suggesting t!at testing using a simulation $an
a$!ieve a de$rease of &(U in tests t!at !ave to be exe$uted on t!e a$tual
running servi$e%oriented s8stem'
Given t!e indi$ations #e !ave found t!at our solution #ould be better suited
for 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
,-
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 our
solution 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!er
validate t!e benefits of our proposed met!od of using a 4S%BP"L simulation
of 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 integration
testing $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 to
a database or text files #it! test data' Sin$e t!is is not possible #it! pure
BP"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 it
doesn>t reall8 matter #!at kind of language is be!ind t!ese servi$es= as long as
t!e8 are #eb servi$es t!at $an be used in a BP"L implementation' 4e also
t!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'
,/
Testing Servi$e%oriented Ar$!ite$tures using a simulation
12. Re.erences
D1E Provided b8 dr' Alexander Lazovik= assistant professor at t!e Rijksuniversiteit
Groningen'
D2E 5erardo 4anfora and 0assimiliano ,i Penta' FTesting services and service-
centric s=stems/ Challenges and o55urtunities.G' 6T Pro= *55)'
D$E 0ani.sinha.Sinha.,hoolia.0ukher2ee.4hakraborty+ FE66icient Testing o6
Service-Oriented A55lications "sing Semantic Service Stu9sG'
D4E /iaoying Bai. Wenli ,ong. Wei-)ek )sai. 6inong 4hen+ F)S!&-Based
Automatic 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#E 7ikolai )illmann. 8onathan de Halleu+ F)hite-Bo; Testing
o6 Behavioral )e9 Service Contracts 7ith %e;G' 6nternational S8mposium on
Soft#are Testing and Anal8sis *55/'
D(E 9a*uel Blanco. 8os: 5arc;a-<an2ul. 8avier )uya+ GA 6irst a55roach to test case
generation 6or B%E& com5ositions o6 7e9 services using Scatter SearchH'
6nternational .onferen$e on Soft#are Testing= Qerifi$ation= and Qalidation *553'
D+E 4hangSup =eum. Sungwon =ang. &n-6oung =o+ G,enerating Test Cases 6or
)e9 Services "sing E;tended 3inite State 'achineH' Pro$' of t!e ()t! 6;6P 6ntl'
.onf' on Testing .ommuni$ating S8stems= pages (5&V((-= 1a8 *55)'
D2E Sylvain Halle. 5raham Hughes. )evfik Bultan. and 0uath %lkhalaf> G,enerating
nter6ace ,rammars 6rom )S!& 6or Automated 0eri6ication o6 )e9 ServicesHJ
6nternational $onferen$e on servi$e oriented $omputing *553= i$so$53'
D4E Tsai= 4'T' = 4ei= I' = .!en= S' = Paul= RJ GA Ro9ust Testing 3rame7or8 6or
0eri6=ing )e9 Services 9= Com5leteness and Consistenc= Anal=sisHJ Servi$e%
2riented S8stem "ngineering= *550' S2S" *550' 6""" 6nternational 4orks!op'
D1-E D' 1' Sneed and S' DuangJ F)S!&Test H A Tool 6or Testing )e9 ServicesGI
6n Proc+ of the &ntl+ Symp+ on Web Site Evolution= pages (,V*(= Sept' *55)'
D11E Evan 0artin. Suran2ana Basu. )ao /ie> GAutomated Testing and Res5onse
Anal=sis o6 )e9 ServicesHJ .onferen$e on 4eb Servi$es= *55-' 6.4S *55-'
D12E /iaoying Bai. Wenli ,ong. Wei-)ek )sai. 6inong 4hen> G)S!&-Based
Automatic Test Case ,eneration 6or )e9 Services TestingHJ Servi$e%2riented
S8stem "ngineering= *550' S2S" *550' 6""" 6nternational 4orks!op'
D1$E 4esare Bartolini. %ntonia Bertolino. Eda 0archetti and %ndrea Polini>
GTo7ards Automated )S!&-Based Testing o6 )e9 ServicesHJ Servi$e%2riented
.omputing= 6.S2. *55/'
,3
Testing Servi$e%oriented Ar$!ite$tures using a simulation
D14E %mit Paradkar and %vik Sinha> GS5eci6= Once Test Ever=7here/ Anal=<ing
nvariants to Augment Service !escri5tions 6or Automated Test ,enerationHJ
Servi$e%2riented .omputing= 6.S2. *55/'
@(0A D' Duang= 4'%T' Tsai= R' Paul= and S' .!en' GAutomated 'odel Chec8ing and
Testing 6or Com5osite )e9 ServicesH 6n Proc+ of the ?th &ntl+ Symp+ on -b2ect-
-riented 9eal-)ime ,istributed 4omputing= pages &55V&5-= 1a8 *550'
D1(E Becker. =+. opes. %+. 0ilo2icic. ,+S+. Pruyne. 8+. Singhal. S+> GAutomaticall=
!etermining Com5ati9ilit= o6 Evolving ServicesHJ 6""" 6nternational .onferen$e
on 4eb Servi$es= *55/' 6.4S >5/'
D1+E 9eiko Heckel and eonardo 0ariani> GAutomatic Con6ormance Testing o6
)e9 ServicesHJ ;undamental Approa$!es to Soft#are "ngineering' Le$ture otes in
.omputer S$ien$e= *550'
D12E 5uilan ,ai. /iaoying Bai. 6ongbo Wang. <eng2un ,ai> FContract-Based
Testing 6or )e9 ServicesGJ &(st Annual 6nternational .omputer Soft#are and
Appli$ations .onferen$e= *55-'
D14E 9eiko Heckel. 0arc ohmann> FTo7ards Contract-9ased Testing o6 )e9
ServicesGJ "le$troni$ otes in T!eoreti$al .omputer S$ien$e B"T.SC= :anuar8
*550'
D2-E )sai. W+)+> Paul. 9+> 6amin Wang> 4hun <an> ,ong Wang> FE;tending )S!&
to 3acilitate )e9 Services TestingGJ -t! 6""" 6nternational S8mposium on Dig!
Assuran$e S8stems "ngineering= *55*'
D21E i i. Wu 4hou> FAn A9stract ,3S' 'odel 6or O5timal and ncremental
Con6ormance Testing o6 )e9 ServicesGI 6""" 6nternational .onferen$e on 4eb
Servi$es= *553' 6.4S *553'
D22E )im 0ackinnon. Steve <reeman. Philip 4raig> FEndo-Testing/ "nit Testing
7ith 'oc8 O9@ectsGI eItreme Programming and ;lexible Pro$esses in Soft#are
"ngineering V IP*555J
D2$E )illmann. 7+> Schulte. W+> 'oc8-o9@ect generation 7ith 9ehaviorGJ *(st
6"""TA.1 6nternational .onferen$e on Automated Soft#are "ngineering= *55)'
AS" >5)'
D24E 0asahiro )anaka and )oru &shida> F%redicting and &earning E;ecuta9ilit= o6
Com5osite )e9 ServicesGI 6nternational $onferen$e on servi$e oriented $omputing'
D2#E 4arsten Hentrich. 3we @dun> F%atterns 6or %rocess-Oriented ntegration in
Service-Oriented ArchitecturesGJ
!ttp:TT###'infos8s'tu#ien'a$'atTstaffTzdunTpubli$ationsTeplop5)'pdf
05
Testing Servi$e%oriented Ar$!ite$tures using a simulation
D2(E System and software engineering and distrbuted systems group. 9i2ksuniversiteit
5roningen> FStessi research %ro5osalGJ 6nternal R'7'G' 9o$ument= *553'
D2+E Bertolino. %+> Polini. %+> FThe Audition 3rame7or8 6or Testing)e9 Services
ntero5era9ilit=GJ &(st "7R216.R2 .onferen$e on Soft#are "ngineering and
Advan$ed Appli$ations= *550'
D22E Peter Budny. Srihari 5ovindhara2 and =arsten Schwan> F)orldTravel/ A
Test9ed 6or Service-Oriented A55licationsGJ 6nternational $onferen$e on Servi$e%
2riented .omputing= 6.S2. *55/'
D24E htt5/JJ777.testdata.nlJinde;.5h5K
o5tionLcomMcontentNvie7LarticleNidL+1/cursus-9urger<a8en-leidt-tot-
ge9oortesNcatidL$4/8no7ledge9aseNtemidL(-
D$-E 9' Boot! et al' F)e9 Service ArchitectureG !ttp:TT###'#&'orgTTRT#s%ar$!T
*55,'
D$1E F)e9 ServiceG !ttp:TTen'#ikipedia'orgT#ikiT4ebWservi$e'
D$2E =odali. 9+9+ G)hat is service-oriented architectureKH :ava4orld'$om B:une
*550C'
D$$E GService-oriented architectureH
!ttp:TTen'#ikipedia'orgT#ikiTServi$eW2rientedWAr$!ite$ture'
D$4E 8acobson. &+. GThe O9@ect AdvantageH (330 6SB 5 *5( ,**/3 (
@&0A &lia Bider+ GState-Oriented Business %rocess 'odeling/ %rinci5lesB Theor=
and %racticeGB *55*'
@&)A FBusiness 5rocessG' !ttp:TTen'#ikipedia'orgT#ikiTBusinessWpro$ess'
@&-A %lves et al+ )e9 Services Business %rocess E;ecution &anguage 0ersion 2.-
D$2E Panagiotis ouridas+ OOrchestrating )e9 Services 7ith B%E&BO 6"""
Soft#are= vol' *0= no' *= pp' /0%/-= 1ar$!TApril= *55/'
D$4E Sommerville+ GSo6t7are Engineering +
th
editionH Addison%4esle8 *55,'
0(

You might also like