Unifying Service Oriented Technologies for the Specification and - - PowerPoint PPT Presentation

unifying service oriented technologies for the
SMART_READER_LITE
LIVE PREVIEW

Unifying Service Oriented Technologies for the Specification and - - PowerPoint PPT Presentation

PhD Thesis Unifying Service Oriented Technologies for the Specification and Detection of their Antipatterns Francis PALMA Supervised by: Dr. Naouel Moha, Universit e du Qu ebec ` a Montr eal, Canada eneuc, Dr. Yann-Ga el Gu


slide-1
SLIDE 1

PhD Thesis

Unifying Service Oriented Technologies for the Specification and Detection of their Antipatterns

Francis PALMA

Supervised by:

  • Dr. Naouel Moha, Universit´

e du Qu´ ebec ` a Montr´ eal, Canada

  • Dr. Yann-Ga¨

el Gu´ eh´ eneuc, ´ Ecole Polytechnique de Montr´ eal, Canada

August 19, 2015

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 1 / 60

slide-2
SLIDE 2

Context: Adoption of Web Technologies and Styles

*Source: www.programmableweb.com Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 2 / 60

slide-3
SLIDE 3

Context: Service-based Systems (SBSs)

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 3 / 60

slide-4
SLIDE 4

Thesis

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 4 / 60

slide-5
SLIDE 5

Thesis

Service anpaerns hinder

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 4 / 60

slide-6
SLIDE 6

Thesis

ECSA '14 ICSOC '12 IJCIS '13

Service anpaerns hinder

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 4 / 60

slide-7
SLIDE 7

Thesis

Changed lines of code and code churns

ECSA '14 ICSOC '12 IJCIS '13

Service anpaerns hinder

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 4 / 60

slide-8
SLIDE 8

Thesis

Changed lines of code and code churns

ECSA '14 ICSOC '12 IJCIS '13

Service anpaerns hinder Proposing a unified approach to specify and detect service anpaerns by assessing the quality of design and quality of service of SBSs.

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 4 / 60

slide-9
SLIDE 9

Service Antipatterns Catalog: Books

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 5 / 60

slide-10
SLIDE 10

Tiny Service Antipattern in SOAP Web Services

<?xml version="1.0" encoding="UT <definitions name="AktienKurs">

WSDL WSDL

</definitions> <?xml version="1.0" encoding="UT <definitions name="AktienKurs">

WSDL WSDL

</definitions> <?xml version="1.0" encoding="UT <definitions name="AktienKurs">

WSDL WSDL

</definitions>

Web Service 2 Web Service 1 Web Service 3

  • Few Operations
  • Low Cohesion
  • High Coupling

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 6 / 60

slide-11
SLIDE 11

God Component Antipattern in SCA

Properes Component A E n c a p s u l a t e d S e r v i c e s References to Components Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 7 / 60

slide-12
SLIDE 12

Forgetting Hypermedia Antipattern in RESTful APIs

N

  • l

i n k s t

  • f
  • l

l

  • w

. . . N

  • l

i n k s t

  • f
  • l

l

  • w

. . . L i n k s t

  • f
  • l

l

  • w

. . .

2:

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 8 / 60

slide-13
SLIDE 13

Challenges and Problems

Changed lines of code and code churns

Service anpaerns hinder

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 9 / 60

slide-14
SLIDE 14

Challenges and Problems

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 9 / 60

slide-15
SLIDE 15

Challenges and Problems

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 9 / 60

slide-16
SLIDE 16

Challenges and Problems

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

REST Resource

  • Enty Endpoint (hosng server)
  • HTTP Method (GET, POST, PUT, DELETE,...)
  • Representaon (JSON, PDF, ...)

hps://api.twier.com/1.1/followers/ids.json Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 9 / 60

slide-17
SLIDE 17

Challenges and Problems

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

REST Resource

  • Enty Endpoint (hosng server)
  • HTTP Method (GET, POST, PUT, DELETE,...)
  • Representaon (JSON, PDF, ...)

hps://api.twier.com/1.1/followers/ids.json

Challenge 1

No unified abstracon

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 9 / 60

slide-18
SLIDE 18

Challenges and Problems

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

REST Resource

  • Enty Endpoint (hosng server)
  • HTTP Method (GET, POST, PUT, DELETE,...)
  • Representaon (JSON, PDF, ...)

hps://api.twier.com/1.1/followers/ids.json

Challenge 1

  • Only textual descripons
  • No specificaons

Challenge 2

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 9 / 60

slide-19
SLIDE 19

Challenges and Problems

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

REST Resource

  • Enty Endpoint (hosng server)
  • HTTP Method (GET, POST, PUT, DELETE,...)
  • Representaon (JSON, PDF, ...)

hps://api.twier.com/1.1/followers/ids.json

Challenge 1

  • Only textual descripons
  • No specificaons

Challenge 2

  • No dedicated unified approach
  • No unified framework

Challenge 3

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 9 / 60

slide-20
SLIDE 20

Challenges and Problems

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

REST Resource

  • Enty Endpoint (hosng server)
  • HTTP Method (GET, POST, PUT, DELETE,...)
  • Representaon (JSON, PDF, ...)

hps://api.twier.com/1.1/followers/ids.json

Challenge 1

  • Only textual descripons
  • No specificaons

Challenge 2

  • No dedicated unified approach
  • No unified framework

Challenge 3

  • No empirical evidence

Challenge 4

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 9 / 60

slide-21
SLIDE 21

Antipatterns Detection: Relevant Works in the Literature

Component-based Systems Object-Oriented Systems Service Component SOAP Web services RESTful Unified (CBS) (OO) Architecture (SCA) APIs Trubiani et al. (2014) Peiris et Hill (2014) Nayrolles et al. (2013) Ouni et al. (2015) Wert et al. (2014) Cortellessa et al. (2014) Anchuri et al. (2014) Zhang et al. (2012) Marco et Trubiani (2014) Torkamani et Bagheri (2014) Cortellessa et al. (2010) Ouni et al. (2013) Coscia et al. (2013) Garcia et al. (2009) Maiga et al. (2012) Tripathi et al. (2014) Parsons et Murphy (2008) Cortellessa et al. (2012) Rodriguez et al. (2013) Khomh et al. (2011) Mateos et al. (2011) Stoianov et Sora (2010) Rodriguez et al. (2010b) Moha et al. (2010) Kr´ al et ˇ Zemliˇ cka (2009) Salehie et al. (2006) Kr´ al et ˇ Zemliˇ cka (2008) Smith et Williams (2002) Kr´ al et ˇ Zemliˇ cka (2007) Smith et Williams (2000) Zheng et Krause (2006) Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 10 / 60

slide-22
SLIDE 22

Thesis Contributions

Changed lines of code and code churns

Service anpaerns hinder

ICSOC '12 IJCIS '13

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

REST Resource

  • Enty Endpoint (hosng server)
  • HTTP Method (GET, POST, PUT, DELETE,...)
  • Representaon (JSON, PDF, ...)

hps://api.twier.com/1.1/followers/ids.json

Challenge 1

No unified abstracon

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 11 / 60

slide-23
SLIDE 23

Thesis Contributions

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

REST Resource

  • Enty Endpoint (hosng server)
  • HTTP Method (GET, POST, PUT, DELETE,...)
  • Representaon (JSON, PDF, ...)

hps://api.twier.com/1.1/followers/ids.json

Challenge 1

A unified abstracon combining different SBSs technologies

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 11 / 60

slide-24
SLIDE 24

Thesis Contributions

Changed lines of code and code churns

Service anpaerns hinder

  • Only textual descripons
  • No specificaons

Challenge 2

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 11 / 60

slide-25
SLIDE 25

Thesis Contributions

Changed lines of code and code churns

Service anpaerns hinder

  • Only textual descripons
  • No specificaons

Challenge 2

Service DSL

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 11 / 60

slide-26
SLIDE 26

Thesis Contributions

Changed lines of code and code churns

Service anpaerns hinder

  • No dedicated unified approach
  • No unified framework

Challenge 3

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 11 / 60

slide-27
SLIDE 27

Thesis Contributions

Changed lines of code and code churns

Service anpaerns hinder

  • No dedicated unified approach
  • No unified framework

Challenge 3

Unified SODA Approach SOFA Framework Validaon of SODA

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 11 / 60

slide-28
SLIDE 28

Thesis Contributions

Changed lines of code and code churns

Service anpaerns hinder

  • No empirical evidence

Challenge 4

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 11 / 60

slide-29
SLIDE 29

Thesis Contributions

Changed lines of code and code churns

Service anpaerns hinder

  • No empirical evidence

Challenge 4

Empirical Evidence

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 11 / 60

slide-30
SLIDE 30

Thesis Contributions

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component S e r v i c e s Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

REST Resource

  • Enty Endpoint (hosng server)
  • HTTP Method (GET, POST, PUT, DELETE,...)
  • Representaon (JSON, PDF, ...)

hps://api.twier.com/1.1/followers/ids.json

Challenge 1

  • Only textual descripons
  • No specificaons

Challenge 2

  • No dedicated unified approach
  • No unified framework

Challenge 3

  • No empirical evidence

Challenge 4

Empirical Evidence Service DSL A unified abstracon combining different SBSs technologies

Unified SODA Approach SOFA Framework Validaon of SODA

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 11 / 60

slide-31
SLIDE 31

Contribution 1

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

ECSA '14

A unified abstracon combining different SBSs technologies

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 12 / 60

slide-32
SLIDE 32

Unified Abstraction

+name +targetNamespace Composite +name Component +name +value Property +source +target Wire Implementation +class ImplementationJava +process ImplementationBPEL +name ImplementationComposite +class ImplementationC++ +name Reference +name Interface (PortType) +name Service +name Operation +uri +name Binding Interface.Java Interface.WSDL +name +type Message (Parameter) +name Part +name +targetNamespace Definition Types SCAClient +name +location Port (EndPoint) WSClient Response

  • media-type

Representation +xmlSchemaURI +xsdElement XML +JavaScriptObject JSON WS-Style Binding SCA-style Binding +HTTPMethod : HTTPMethods +path : string Method

  • GET
  • POST
  • PUT
  • DELETE

<<enumeration>> HTTPMethods Request +URI : string Resource +baseURI +description : string RESTService RESTClient 1..* 0..1 0..* 0..* 1..* 1 1 0..1 0..* 0..* 1..* 1..* 1 1 1..* 0..1 1..* 1..* 0..* 1 1 1..* 0..* 0..* 0..1 1..* 0..1 0..* 0..* 0..1 1..* * 1 1..* 0..1 1..* 1..* 0..* 0..* 0..1 0..1 0..* <<invoke>> <<perform>> response

  • utput

input <<instantiate>> has Powered ByV i s ual P ar a di g m C

  • m

mu ni ty E di tio n

1 4 2 3 5

> < > < > < > < > < > < > < > < > < > < > < > <

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 13 / 60

slide-33
SLIDE 33

Meta-abstraction

Implementation +name Interface/PortType +name Operation +uri +name Binding +name +type Message +name +location Service Endpoint Representation Resource Client +name Service 1..* 1..* 1..* 1..* 0..1 0..* 1 1 1 1..* 0..1 1..* 0..1 1..*

invokes

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 14 / 60

slide-34
SLIDE 34

Contributions 2 and 3

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

ECSA '14

Service DSL

Unified SODA Approach SOFA Framework

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 15 / 60

slide-35
SLIDE 35

SODA (Service Oriented Detection for Antipatterns)

Specificaon

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 16 / 60

slide-36
SLIDE 36

SODA (Service Oriented Detection for Antipatterns)

Specificaon Generaon

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 16 / 60

slide-37
SLIDE 37

SODA (Service Oriented Detection for Antipatterns)

Specificaon Generaon Detecon

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 16 / 60

slide-38
SLIDE 38

Domain Analysis for Antipatterns Specifications

Specificaon Generaon Detecon

LowCohesion COH LOW TinyService NMD VERY_LOW FewMethod

INTER

HighCoupling CPL HIGH HighCouplingORLowCohesion

UNION

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 17 / 60

slide-39
SLIDE 39

Domain Analysis for Antipatterns Specifications

Specificaon Generaon Detecon

Service Antipatterns

DataService COH HIGH HighCohesion

INTER

HighDataAccerssor SmallParameter PrimitiveParameter ANPT HIGH ANP LOW ANAM VERY_HIGH ChattyService NMI VERY_HIGH TotalInvocation

INTER

SandPile COH HIGH ParentService

COMPOS from ONE to MANY

NRO >1 ContainedService

ASSOC from MANY

ChildService

to ONE

MultiService NMD VERY_HIGH MultiMethod

INTER

LowCohesion LowAvailability HighResponse RT VERY_HIGH A LOW COH VERY_LOW TinyService NMD VERY_LOW FewMethod

INTER

HighCoupling CPL HIGH TheKnot

INTER

LowPerformance

INTER

Bottleneck Service

INTER

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 18 / 60

slide-40
SLIDE 40

BNF Grammar of Rule Cards for SODA

Specificaon Generaon Detecon

1 rule card ::= RULE CARD:rule cardName { (rule)+ }; 2 rule ::= RULE:ruleName { content rule }; 3 content rule ::= metric | relationship | operator ruleType (ruleType)+ 4 | RULE CARD: rule cardName 5 ruleType ::= ruleName | rule cardName 6

  • perator

::= INTER | UNION | DIFF | INCL | NEG 7 metric ::= id metric ordi value 8 | id metric comparator num value 9 id metric ::= ALS | ANAM/ANAO | ANIM | ANP | ANPT | ARIM | ARIO | ARIP 10 | COH | CPL | NCO | NI | NIR | NMD/NOD | NOPT 11 | NOR | NPT | NSE | NUM | NVMS | NVOS | RGTS | TNP 12 | A | NMI | NTMI | RT 13

  • rdi value

::= VERY HIGH | HIGH | MEDIUM | LOW | VERY LOW 14 comparator ::= < | ≤ | = | ≥ | > 15 relationship ::= relationType FROM ruleName cardinality TO ruleName cardinality 16 relationType ::= ASSOC | COMPOS 17 cardinality ::= ONE | MANY | ONE OR MANY | num value NUMBER OR MANY 18 rule cardName, ruleName, ruleClass ∈ string 19 num value ∈ double Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 19 / 60

slide-41
SLIDE 41

List of 27 Static and Dynamic Metrics

Specificaon Generaon Detecon

Metrics Full Names Type A Availability of a Service dynamic NMI Number of Method Invocations dynamic NTMI Number of Transitive Methods Invoked dynamic RT Response Time of a Service dynamic ALS Average Length of Signatures static ANP Average Number of Parameters in Operations static ANPT Average Number of Primitive Type Parameters static ANIO Average Number of Identical Operations static ANAO Average Number of Accessor Operations static ARIP Average Ratio of Identical Port-Types static ARIO Average Ratio of Identical Operations static ARIM Average Ratio of Identical Messages static COH Service Cohesion static CPL Service Coupling static NCO Number of CRUD Operations static NOD Number of Operations Declared static NOPT Number of Operations in Port-Types static NI Number of Interfaces static NIR Number of Incoming References static NOR Number of Outgoing References static NPT Number of Port-Types static NSE Number of Services Encapsulated static NUM Number of Utility Methods static NVMS Number of Verbs in Message Signatures static NVOS Number of Verbs in Operation Signatures static RGTS Ratio of General Terms in Signatures static TNP Total Number of Parameters static

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 20 / 60

slide-42
SLIDE 42

Rule for Tiny Service Antipattern

Specificaon Generaon Detecon

1 RULE CARD: TinyService { 2 RULE: TinyService {INTER FewOperation HighCouplingORLowCohesion}; 3 RULE: FewOperation {NOD VERY LOW}; 4 RULE: HighCouplingORLowCohesion {UNION HighCoupling LowCohesion}; 5 RULE: HighCoupling {CPL HIGH}; 6 RULE: LowCohesion {COH LOW}; 7 };

*NOD = Number of Operations Defined; CPL = Coupling; COH = Cohesion; Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 21 / 60

slide-43
SLIDE 43

Rule for God Component Antipattern

Specificaon Generaon Detecon

1 RULE CARD: GodComponent { 2 RULE: GodComponent {INTER HighEncapsulation MultiMethod HighParameter}; 3 RULE: HighEncapsulation {NOSE HIGH}; 4 RULE: MultiMethod {NMD VERY HIGH}; 5 RULE: HighParameter {TNP VERY HIGH}; 6 };

*NOSE = Number of Services Encapsulated; NMD = Number of Methods Defined; TNP = Total Number of Parameters; Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 22 / 60

slide-44
SLIDE 44

Rule for Forgetting Hypermedia Antipattern

Specificaon Generaon Detecon

1 RULE CARD: ForgetHyperMedia { 2 RULE: ForgetHyperMedia { UNION GetRequestLink PostRequestLink }; 3 RULE: GetRequestLink { INTER HttpMethodGet NoLinkGet }; 4 RULE: HttpMethodGet { HM = ‘GET’ }; 5 RULE: NoLinkGet { UNION NoBodyLink NoHeaderLink }; 6 RULE: NoHeaderLink { HL = NULL }; 7 RULE: PostRequestLink { INTER HttpMethodPost NoLinkPost }; 8 RULE: NoLinkPost { INTER NoBodyLink NoLocationHeader }; 9 RULE: HttpMethodPost { HM = ‘POST’ }; 10 RULE: NoLocationHeader { ‘Location’ / ∈ ResponseHeader }; 11 RULE: NoBodyLink { TLB = 0 }; 12 };

*HM = HTTP Method; HL = Hyperlinks; TLB = Total Number of Links in Body; Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 23 / 60

slide-45
SLIDE 45

Detection Algorithms Generation Steps

Specificaon Generaon Detecon

Write Rules R u l e c a r d s ( . r c ) Step 2 E c

  • r

e m

  • d

e l ( . e c

  • r

e ) Create Meta-model Step 1 Parse and Validate Rules Step 3 Models

  • f rules

Templates Detection Algorithms (.java) Generation Step 4

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 24 / 60

slide-46
SLIDE 46

SOFA (Service Oriented Framework for Antipatterns)

Specificaon Generaon Detecon

Detection Algorithm Generation

SOFA Framework

Rule Specification Rule Operator Boxplot Metric SCA Handler Web Service Handler REST Handler Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 25 / 60

slide-47
SLIDE 47

Contribution 3

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

Validaon of SODA Approach

ECSA '14

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 26 / 60

slide-48
SLIDE 48

Validation

Research Question

Can we efficiently specify and detect service antipatterns in different development technologies and architectural styles of service-based systems? Four experimental assumptions:

  • A1. Generality
  • A2. Accuracy
  • A3. Extensibility
  • A4. Performance

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 27 / 60

slide-49
SLIDE 49

Subject: 31 Service Antipatterns

SCA SOAP Web Services REST

Sand Pile Forgetting Hypermedia Ignoring MIME T ypes Breaking Self-descriptiveness Ignoring Caching Ignorning Status Code Misusing Cookies T unelling Through GET T unelling Through POST Amorphous URI Contextless Resource Names Non-heirarchical Nodes Pluralised Nodes Ambiguous Name Nobody Home Bloated Service Multi Service Tiny Service Data Service Chatty service CRUDy Interface CRUDy URI The Knot Bottleneck Service Service Chain Duplicated Service God Component Stovepipe Service Low Cohesive Operations May be It's Not RPC Redundant Port-Types

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 28 / 60

slide-50
SLIDE 50

Objects: Service-based Systems

Service Component Architecture

Home-Automation (13 SCA components) FraSCAti OW2 (91 SCA components)

SOAP Web services

13 Weather SOAP Web services 109 Finance SOAP Web services

RESTful APIs

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 29 / 60

slide-51
SLIDE 51

Validation Process

Five steps

1 Specify service antipatterns Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 30 / 60

slide-52
SLIDE 52

Validation Process

Five steps

1 Specify service antipatterns 2 Generate detection algorithms

Implement REST clients and invoke 309 methods

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 30 / 60

slide-53
SLIDE 53

Validation Process

Five steps

1 Specify service antipatterns 2 Generate detection algorithms

Implement REST clients and invoke 309 methods

3 Apply detection algorithms automatically

On Home-Automation, FraSCAti, and Web services On REST requests-responses and on REST request URIs

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 30 / 60

slide-54
SLIDE 54

Validation Process

Five steps

1 Specify service antipatterns 2 Generate detection algorithms

Implement REST clients and invoke 309 methods

3 Apply detection algorithms automatically

On Home-Automation, FraSCAti, and Web services On REST requests-responses and on REST request URIs

4 Manually validate detection results Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 30 / 60

slide-55
SLIDE 55

Validation Process

Five steps

1 Specify service antipatterns 2 Generate detection algorithms

Implement REST clients and invoke 309 methods

3 Apply detection algorithms automatically

On Home-Automation, FraSCAti, and Web services On REST requests-responses and on REST request URIs

4 Manually validate detection results 5 Use precision, recall, and F1-measure as detection accuracy measure Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 30 / 60

slide-56
SLIDE 56

Validation of Detection Results

Service Component Architecture (SCA)

Home-Automation: 7 execution scenario; 3 undergraduate students FraSCAti: 5 execution scenario; Core development team

SOAP Web Services

2 graduate students

RESTful APIs

309 REST requests-responses 3 professionals and 1 graduate student

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 31 / 60

slide-57
SLIDE 57

Detection Results Detection results for Tiny Service God Component Forgetting Hypermedia

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 32 / 60

slide-58
SLIDE 58

Detection of Tiny Service Antipattern

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 33 / 60

slide-59
SLIDE 59

Example of Tiny Service Antipattern

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 34 / 60

slide-60
SLIDE 60

Detection of God Component Antipattern

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 35 / 60

slide-61
SLIDE 61

Example of God Component Antipattern

factory juliac tinfi-oo julia

  • sgi-provider

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 36 / 60

slide-62
SLIDE 62

Detection of Forgetting Hypermedia Antipattern

REST APIs (12)BestBuy (15)DropBox (29)Facebook (10)Twitter (9)YouTube (115) Total precision-recall Average Precision-Recall Detection Time REST Antipattern Forgetting Hypermedia 0/0 9/10 8/8 4/4 2/3 36/38 p 94.58% 19.54s 0/0 9/9 8/8 4/4 2/2 36/36 r 100%

Alchemy BestBuy Bitly CharlieHarvey DropBox Facebook Musicgraph Ohloh TeamViewer Twitter YouTube Zappos

No Detection Pattern Antipattern

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 37 / 60

slide-63
SLIDE 63

Example of Forgetting Hypermedia Antipattern

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 38 / 60

slide-64
SLIDE 64

Verifying Four Assumptions

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 39 / 60

slide-65
SLIDE 65

A1: Generality of DSL

SCA SOAP Web Services REST

Sand Pile Forgetting Hypermedia Ignoring MIME T ypes Breaking Self-descriptiveness Ignoring Caching Ignorning Status Code Misusing Cookies T unelling Through GET T unelling Through POST Amorphous URI Contextless Resource Names Non-heirarchical Nodes Pluralised Nodes Ambiguous Name Nobody Home Bloated Service Multi Service Tiny Service Data Service Chatty service CRUDy Interface CRUDy URI The Knot Bottleneck Service Service Chain Duplicated Service God Component Stovepipe Service Low Cohesive Operations May be It's Not RPC Redundant Port-Types

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 40 / 60

slide-66
SLIDE 66

A2: Accuracy of Detection Algorithms

Antipatterns Groups Average Average Average Precision Recall F-1 measure SCA ∩ REST ∩ Web services 93.33% 100% 96.3% SCA ∩ Web services 82.59% 95.83% 86.34% REST ∩ Web services 75% 100% 83.33% SCA 88.89% 100% 93.3% Web services 100% 100% 100% REST Req/Res Antipatterns 82.81% 90.4% 86.44% REST Req/Res Patterns 100% 99.76% 99.88% REST Linguistic Antipatterns 81.4% 78% 79.66% Average 88% 95.5% 90.66%

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 41 / 60

slide-67
SLIDE 67

A3: Extensibility of SOFA Framework

Detection Algorithm Generation

SOFA Framework

Operator Rule Specification Rule Metric Boxplot SCA Handler Web Service Handler REST Handler Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 42 / 60

slide-68
SLIDE 68

A4: Performance of Detection Algorithms

Antipatterns Groups Average Detection Times SCA ∩ REST ∩ Web services 0.511s SCA ∩ Web services 9.09s REST ∩ Web services 18.98s SCA 0.184s Web services 144.72s REST Syntactic Antipatterns 22.06s REST Syntactic Patterns 20.44s REST Linguistic Antipatterns 0.70s Average 27.09s

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 43 / 60

slide-69
SLIDE 69

Verifying Four Assumptions

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 44 / 60

slide-70
SLIDE 70

Answer to the Research Question

Research Question

Can we efficiently specify and detect service antipatterns in different development technologies and architectural styles of service-based systems? Answer: With our proposed unified SODA approach that encompasses the unified abstraction and the service DSL, we can effectively specify and detect service antipatterns in different SBSs technologies in terms of accuracy and performance.

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 45 / 60

slide-71
SLIDE 71

Contribution 4

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

ECSA '14

Empirical Evidence

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 46 / 60

slide-72
SLIDE 72

Impact of Service Antipatterns on SBSs

Research Question

What are the impact of service antipatterns and patterns on the maintenance and evolution of service-based systems? RQ2.1 - What is the relation between service antipatterns and change-proneness? RQ2.2 - What is the relation between particular kinds of service antipatterns and change-proneness?

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 47 / 60

slide-73
SLIDE 73

Study Subjects: Service Antipatterns

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 48 / 60

slide-74
SLIDE 74

Study Object: FraSCAti OW2

http://frascati.ow2.org/

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 49 / 60

slide-75
SLIDE 75

Study Approach

FraSCAti version control system D a t a P r e p a r a t i

  • n

invoke and execute FraSCAti services Service Antipatterns Detection Server-side artefacts analysis C l i e n t

  • s

i d e a r t e f a c t s a n a l y s i s

4 3

Source Changes Extractor number of changes per service code churns involved in ntipatterns a FraSCAti services

1

Import Mailing Data

2

Code Churns Extractor

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 50 / 60

slide-76
SLIDE 76

Study Variables

Independent variables

Eight service antipatterns

f1

i : file i involved in the implementation of any antipattern (RQ1)

f2

i,j: file i involved in the implementation of antipattern j (RQ2)

Dependent variables

Change-proneness of services’ source files

Total number of changes as ci Total number of code churns as di

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 51 / 60

slide-77
SLIDE 77

RQ2.1: Antipatterns are More Change-prone

50 100 150 200 250 300

Total Number Of Changes SOA Antipattern Implementation Others

1000 2000 3000 4000 5000 6000

T

  • t

a l N u m b e r O f C

  • d

e C h u r n s SOA Antipattern Implementation Others

Treatment Groups Treatment Types p-value Cliff’s δ antipatterns ∼ non-antipatterns total number of code churns 0.015 0.515 (large) antipatterns ∼ non-antipatterns total number of changes 0.011 0.496 (large)

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 52 / 60

slide-78
SLIDE 78

RQ2.2: Antipatterns are Not Equally Change-prone

God Component, Multi Service, and Service Chain antipatterns are more change-prone.

BlS BotS GC MS NH NoAP SC TK TS 50 100 150 200 250 300

T

  • t

a l N u m b e r O f C h a n g e s

BlS BotS GC MS NH NoAP SC TK TS 1000 2000 3000 4000 5000 6000

Total Number Of Code Churns

Treatment Groups p-value total number of code churns ∼ antipattern 0.0002 total number of changes ∼ antipattern 0.01003

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 53 / 60

slide-79
SLIDE 79

Answer to the Research Question

Research Question

What are the impact of service antipatterns and patterns on the maintenance and evolution of Service-based systems? Answer: The services involved in antipatterns, in terms of their implementations, are more change-prone than the services that are not involved in any antipattern.

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 54 / 60

slide-80
SLIDE 80

Conclusion: Our Challenges

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

REST Resource

  • Enty Endpoint (hosng server)
  • HTTP Method (GET, POST, PUT, DELETE,...)
  • Representaon (JSON, PDF, ...)

hps://api.twier.com/1.1/followers/ids.json

Challenge 1

  • Only textual descripons
  • No specificaons

Challenge 2

  • No dedicated unified approach
  • No unified framework

Challenge 3

  • No empirical evidence

Challenge 4

No unified abstracon

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 55 / 60

slide-81
SLIDE 81

Conclusion: Our Contributions

Changed lines of code and code churns

ICSOC '12 IJCIS '13

Service anpaerns hinder

An SCA Component Services Properties References

  • SOAP, REST, JMS, RMI
  • SCDL specificaons (local)
  • XML or SDO (Service Data Object)
  • One addional layer of components

Web Service Interface

Port Types Bindings Service Operations Input Output Port Types Messages <types> ... </types> <message> ... </message> <portType> ... </portType> <operation> ... </operation> <input> ... </input> <output> ... </output> <binding> ... </binding> <service> ... </service> <port> ... </port>

  • XML-based
  • SOAP-based
  • WS*-standards
  • WSDL specificaons (remote)
  • BPEL composion

REST Resource

  • Enty Endpoint (hosng server)
  • HTTP Method (GET, POST, PUT, DELETE,...)
  • Representaon (JSON, PDF, ...)

hps://api.twier.com/1.1/followers/ids.json

Challenge 1

  • Only textual descripons
  • No specificaons

Challenge 2

  • No dedicated unified approach
  • No unified framework

Challenge 3

  • No empirical evidence

Challenge 4

Empirical Evidence Service DSL A unified abstracon combining different SBSs technologies

Unified SODA Approach SOFA Framework Validaon of SODA

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 56 / 60

slide-82
SLIDE 82

Conclusion

Research Question 1

Can we efficiently specify and detect service antipatterns in different development technologies and architectural styles of service-based systems?

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 57 / 60

slide-83
SLIDE 83

Conclusion

Research Question 2

What are the impact of service antipatterns and patterns on the maintenance and evolution of service-based systems?

50 100 150 200 250 300

Total Number Of Changes SOA Antipattern Implementation Others

1000 2000 3000 4000 5000 6000

Total Number Of Code Churns SOA Antipattern Implementation Others

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 58 / 60

slide-84
SLIDE 84

Perspectives

Short-term perspectives

Replicate SODA: more RESTful APIs, more (anti)patterns Communicate the detection results with real developers Impact study on Web services and RESTful APIs Study the evolution of service antipatterns in SBSs

Long-term perspectives

More experiments and analyse results with industrial partners Propose a corrective approach Impact of refactored service antipatterns

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 59 / 60

slide-85
SLIDE 85

Thank You!

Changed lines of code and code churns

ECSA '14 ICSOC '12 IJCIS '13 ICSOC '14 ICSOC '15 SOCA '14 TSE '15

Service anpaerns hinder Proposing a unified approach to specify and detect service anpaerns by assessing the quality of design and quality of service of SBSs.

Francis PALMA (´ EPM, UQ` AM) Detection of Service Antipatterns August 19, 2015 60 / 60