Top Banner
Specification and Detection of SOA Antipatterns Francis Palma [email protected] Ptidej Team, DGIGL, École Polytechnique de Montréal Latece, Département d'informatique, Université du Québec à Montréal Supervisors: Dr. Naouel Moha and Dr. Yann-Gaël Guéhéneuc
83

Specification and Detection of SOA Antipatterns

Apr 13, 2017

Download

Technology

Francis Palma
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Specification and Detection of SOA Antipatterns

Specification and Detection of SOA Antipatterns

Francis Palma [email protected]

Ptidej Team, DGIGL, École Polytechnique de Montréal

Latece, Département d'informatique, Université du Québec à Montréal

Supervisors: Dr. Naouel Moha and Dr. Yann-Gaël Guéhéneuc

Page 2: Specification and Detection of SOA Antipatterns

B.Sc. in Computer Science and Engineering 2005

2

Page 3: Specification and Detection of SOA Antipatterns

B.Sc. in Computer Science and Engineering 2005

M.Sc. in Software Engineering 2010

2

Page 4: Specification and Detection of SOA Antipatterns

B.Sc. in Computer Science and Engineering 2005

M.Sc. in Software Engineering 2010

Research Collaborator 2011 Jan – 2011 Aug

2

Page 5: Specification and Detection of SOA Antipatterns

B.Sc. in Computer Science and Engineering 2005

M.Sc. in Software Engineering 2010

Research Collaborator 2011 Jan – 2011 Aug

PhD Candidate… 2011 Fall to present

2

Page 6: Specification and Detection of SOA Antipatterns

Good Things in Lille…

Page 7: Specification and Detection of SOA Antipatterns
Page 8: Specification and Detection of SOA Antipatterns
Page 9: Specification and Detection of SOA Antipatterns

Background

Page 10: Specification and Detection of SOA Antipatterns

Background

• Traditional architectural models vs. Service-Oriented Architecture (SOA)

• Service-based Systems (SBSs) [Palma et al. 2013]

• Different SOA technological/architectural choices:

o SOAP-based Web service

o SCA (Service Component Architecture)

o REST-style (REpresentational State Transfer), etc.

Specification and Detection of SOA Antipatterns 3

Page 11: Specification and Detection of SOA Antipatterns

SOA Technologies

XML-RPC-based Web services SOAP-based Web services

Service Component Architecture REST-style

Specification and Detection of SOA Antipatterns 4

Page 12: Specification and Detection of SOA Antipatterns

An Example

SBSs evolve to fit new user requirements, execution contexts:

- may degrade design and quality of service (QoS)

- may cause the appearance of common poor solutions: Antipatterns

Specification and Detection of SOA Antipatterns 5

Page 13: Specification and Detection of SOA Antipatterns

Motivation

• Maintenance and evolution phase consumes resources of more than 60%

(Harrison and Cook, 1990)

• SOA antipatterns:

- evolution may introduce antipatterns or

- existing antipatterns might hinder evolution

Main objective:

To ease the maintenance and evolution of SBSs by detecting SOA antipatterns

• Detection of SOA antipatterns

- assessing statically: the design quality

- assessing dynamically: the QoS

Specification and Detection of SOA Antipatterns 6

Page 14: Specification and Detection of SOA Antipatterns

Antipatterns Example

Tiny Service

Few Methods Low Cohesion Very High Coupling

Specification and Detection of SOA Antipatterns 7

Page 15: Specification and Detection of SOA Antipatterns

Antipatterns Example

Tiny Service Multi Service

Many Methods Very Low Cohesion High Response Time Low Availability

Few Methods Low Cohesion Very High Coupling

Specification and Detection of SOA Antipatterns 7

Page 16: Specification and Detection of SOA Antipatterns

More Examples… DropBox Server Response 1:

Header: { x-frame-options=[SAMEORIGIN], x-dropbox-request-id=[b9a25269beb2c75fa7d7e21e1638bb9d], Connection=[keep-alive], Server=[nginx], pragma=[no-cache], cache-control=[no-cache], x-server-response-time=[64], x-dropbox-http-protocol=[None], set-cookie=[gvc=MjExODUyMTE….. expires=Tue, 26 Mar 2019 18:34:14 GMT], Transfer-Encoding=[chunked], Date=[Thu, 27 Mar 2014 18:34:14 GMT], Content-Type=[application/json], X-RequestId=[c64da98881e565a90a5dd9aecea9f049] } Body: { "hash": "f9d780e7655fe43261b4de9ec9a926eb", "revision": 2, "rev": "21e8a5a19", "thumb_exists": false, "bytes": 0, "modified": "Tue, 28 Jan 2014 21:45:31 +0000", "path": "/test", "is_dir": true, "icon": "folder", "root": "dropbox", "contents": [ { "revision": 3, "rev": "31e8a5a19", "thumb_exists": false, "bytes": 4, "modified": "Tue, 28 Jan 2014 21:46:30 +0000", "client_mtime": "Tue, 28 Jan 2014 21:46:30", "path": "/test/test.txt", "is_dir": false, "icon": "page_white_text", "root": "dropbox", "mime_type": "text/plain", "size": "4 bytes“ } ], "size": "0 bytes“ } 8

Page 17: Specification and Detection of SOA Antipatterns

More Examples… DropBox Server Response 1:

Header: { x-frame-options=[SAMEORIGIN], x-dropbox-request-id=[b9a25269beb2c75fa7d7e21e1638bb9d], Connection=[keep-alive], Server=[nginx], pragma=[no-cache], cache-control=[no-cache], x-server-response-time=[64], x-dropbox-http-protocol=[None], set-cookie=[gvc=MjExODUyMTE….. expires=Tue, 26 Mar 2019 18:34:14 GMT], Transfer-Encoding=[chunked], Date=[Thu, 27 Mar 2014 18:34:14 GMT], Content-Type=[application/json], X-RequestId=[c64da98881e565a90a5dd9aecea9f049] } Body: { "hash": "f9d780e7655fe43261b4de9ec9a926eb", "revision": 2, "rev": "21e8a5a19", "thumb_exists": false, "bytes": 0, "modified": "Tue, 28 Jan 2014 21:45:31 +0000", "path": "/test", "is_dir": true, "icon": "folder", "root": "dropbox", "contents": [ { "revision": 3, "rev": "31e8a5a19", "thumb_exists": false, "bytes": 4, "modified": "Tue, 28 Jan 2014 21:46:30 +0000", "client_mtime": "Tue, 28 Jan 2014 21:46:30", "path": "/test/test.txt", "is_dir": false, "icon": "page_white_text", "root": "dropbox", "mime_type": "text/plain", "size": "4 bytes“ } ], "size": "0 bytes“ }

No hyperlinks to follow! No hyperlinks to follow!

No hyperlinks to follow! No hyperlinks to follow!

8

Page 18: Specification and Detection of SOA Antipatterns

More Examples…

No hyperlinks to follow! No hyperlinks to follow!

No hyperlinks to follow! No hyperlinks to follow!

DropBox Server Response 1:

Header: { x-frame-options=[SAMEORIGIN], x-dropbox-request-id=[b9a25269beb2c75fa7d7e21e1638bb9d], Connection=[keep-alive], Server=[nginx], pragma=[no-cache], cache-control=[no-cache], x-server-response-time=[64], x-dropbox-http-protocol=[None], set-cookie=[gvc=MjExODUyMTE….. expires=Tue, 26 Mar 2019 18:34:14 GMT], Transfer-Encoding=[chunked], Date=[Thu, 27 Mar 2014 18:34:14 GMT], Content-Type=[application/json], X-RequestId=[c64da98881e565a90a5dd9aecea9f049] } Body: { "hash": "f9d780e7655fe43261b4de9ec9a926eb", "revision": 2, "rev": "21e8a5a19", "thumb_exists": false, "bytes": 0, "modified": "Tue, 28 Jan 2014 21:45:31 +0000", "path": "/test", "is_dir": true, "icon": "folder", "root": "dropbox", "contents": [ { "revision": 3, "rev": "31e8a5a19", "thumb_exists": false, "bytes": 4, "modified": "Tue, 28 Jan 2014 21:46:30 +0000", "client_mtime": "Tue, 28 Jan 2014 21:46:30", "path": "/test/test.txt", "is_dir": false, "icon": "page_white_text", "root": "dropbox", "mime_type": "text/plain", "size": "4 bytes“ } ], "size": "0 bytes“ } 8

Page 19: Specification and Detection of SOA Antipatterns

More Examples… DropBox Server Response 2: Header: { x-frame-options=[SAMEORIGIN], x-dropbox-request-id=[cd12e1e844327464485842b11b530071], Connection=[keep-alive], Server=[nginx], pragma=[no-cache], cache-control=[no-cache], x-server-response-time=[110], x-dropbox-http-protocol=[None], set-cookie=[gvc=MzIwNTkxODQzNjQy.....; expires=Sat, 06 Apr 2019 22:11:47 GMT; Transfer-Encoding=[chunked], Date=[Mon, 07 Apr 2014 22:11:47 GMT], Content-Type=[application/json], X-RequestId=[d509463440ada422459335fd3c71d309] } Body: { "referral_link": "https://db.tt/AaWjP9HP", "display_name": "Francis Palma", "uid": 118690394, "country": "CA", "quota_info": { "datastores": 0, "shared": 293074019, "quota": 2147483648, "normal": 1661304356 }, "team": null, "email": "[email protected]" }

No hyperlinks to follow! No hyperlinks to follow!

No hyperlinks to follow! No hyperlinks to follow!

DropBox Server Response 1:

Header: { x-frame-options=[SAMEORIGIN], x-dropbox-request-id=[b9a25269beb2c75fa7d7e21e1638bb9d], Connection=[keep-alive], Server=[nginx], pragma=[no-cache], cache-control=[no-cache], x-server-response-time=[64], x-dropbox-http-protocol=[None], set-cookie=[gvc=MjExODUyMTE….. expires=Tue, 26 Mar 2019 18:34:14 GMT], Transfer-Encoding=[chunked], Date=[Thu, 27 Mar 2014 18:34:14 GMT], Content-Type=[application/json], X-RequestId=[c64da98881e565a90a5dd9aecea9f049] } Body: { "hash": "f9d780e7655fe43261b4de9ec9a926eb", "revision": 2, "rev": "21e8a5a19", "thumb_exists": false, "bytes": 0, "modified": "Tue, 28 Jan 2014 21:45:31 +0000", "path": "/test", "is_dir": true, "icon": "folder", "root": "dropbox", "contents": [ { "revision": 3, "rev": "31e8a5a19", "thumb_exists": false, "bytes": 4, "modified": "Tue, 28 Jan 2014 21:46:30 +0000", "client_mtime": "Tue, 28 Jan 2014 21:46:30", "path": "/test/test.txt", "is_dir": false, "icon": "page_white_text", "root": "dropbox", "mime_type": "text/plain", "size": "4 bytes“ } ], "size": "0 bytes“ } 8

Page 20: Specification and Detection of SOA Antipatterns

More Examples… DropBox Server Response 2: Header: { x-frame-options=[SAMEORIGIN], x-dropbox-request-id=[cd12e1e844327464485842b11b530071], Connection=[keep-alive], Server=[nginx], pragma=[no-cache], cache-control=[no-cache], x-server-response-time=[110], x-dropbox-http-protocol=[None], set-cookie=[gvc=MzIwNTkxODQzNjQy.....; expires=Sat, 06 Apr 2019 22:11:47 GMT; Transfer-Encoding=[chunked], Date=[Mon, 07 Apr 2014 22:11:47 GMT], Content-Type=[application/json], X-RequestId=[d509463440ada422459335fd3c71d309] } Body: { "referral_link": "https://db.tt/AaWjP9HP", "display_name": "Francis Palma", "uid": 118690394, "country": "CA", "quota_info": { "datastores": 0, "shared": 293074019, "quota": 2147483648, "normal": 1661304356 }, "team": null, "email": "[email protected]" }

DropBox Server Response 1: Header: { x-frame-options=[SAMEORIGIN], x-dropbox-request-id=[b9a25269beb2c75fa7d7e21e1638bb9d], Connection=[keep-alive], Server=[nginx], pragma=[no-cache], cache-control=[no-cache], x-server-response-time=[64], x-dropbox-http-protocol=[None], set-cookie=[gvc=MjExODUyMTE….. expires=Tue, 26 Mar 2019 18:34:14 GMT], Transfer-Encoding=[chunked], Date=[Thu, 27 Mar 2014 18:34:14 GMT], Content-Type=[application/json], X-RequestId=[c64da98881e565a90a5dd9aecea9f049] } Body: { "hash": "f9d780e7655fe43261b4de9ec9a926eb", "revision": 2, "rev": "21e8a5a19", "thumb_exists": false, "bytes": 0, "modified": "Tue, 28 Jan 2014 21:45:31 +0000", "path": "/test", "is_dir": true, "icon": "folder", "root": "dropbox", "contents": [ { "revision": 3, "rev": "31e8a5a19", "thumb_exists": false, "bytes": 4, "modified": "Tue, 28 Jan 2014 21:46:30 +0000", "client_mtime": "Tue, 28 Jan 2014 21:46:30", "path": "/test/test.txt", "is_dir": false, "icon": "page_white_text", "root": "dropbox", "mime_type": "text/plain", "size": "4 bytes“ } ], "size": "0 bytes“ }

No hyperlinks to follow! No hyperlinks to follow!

No hyperlinks to follow! No hyperlinks to follow!

8

Page 21: Specification and Detection of SOA Antipatterns

Alchemy Client Request: Header: { cache-control=[no-cache], content-type=[application/xml], connection=[keep-alive], host=[access.alchemyapi.com], accept=[application/xml], path=/calls/url/URLGetRankedNamedEntities?... get /calls/url/urlgetrankednamedentities?... user-agent=[Apache CXF 2.7.5], pragma=[no-cache] } Alchemy Server Response: Header: { content-type=[application/xml; charset=utf-8], cache-control=[no-cache], connection=[keep-alive], access-control-allow-origin=[*], content-length=[506], server=[nginx], date=[Fri, 15 Aug 2014 19:30:28 GMT] } Body: <?xml version="1.0" encoding="UTF-8"?> <results> <status>OK</status> <usage>By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use:http://www.alchemyapi.com/company/terms.html </usage> <url>http://www.cnn.com/2011/09/28/us/...</url> <language>english</language> <microformats> <a href="/cnn" rel="tag">cnn</a> </microformats> </results>

More Examples…

9

Page 22: Specification and Detection of SOA Antipatterns

Alchemy Client Request: Header: { cache-control=[no-cache], content-type=[application/xml], connection=[keep-alive], host=[access.alchemyapi.com], accept=[application/xml], path=/calls/url/URLGetRankedNamedEntities?... get /calls/url/urlgetrankednamedentities?... user-agent=[Apache CXF 2.7.5], pragma=[no-cache] } Alchemy Server Response: Header: { content-type=[application/xml; charset=utf-8], cache-control=[no-cache], connection=[keep-alive], access-control-allow-origin=[*], content-length=[506], server=[nginx], date=[Fri, 15 Aug 2014 19:30:28 GMT] } Body: <?xml version="1.0" encoding="UTF-8"?> <results> <status>OK</status> <usage>By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use:http://www.alchemyapi.com/company/terms.html </usage> <url>http://www.cnn.com/2011/09/28/us/...</url> <language>english</language> <microformats> <a href="/cnn" rel="tag">cnn</a> </microformats> </results>

More Examples…

9

Page 23: Specification and Detection of SOA Antipatterns

Alchemy Client Request: Header: { cache-control=[no-cache], content-type=[application/xml], connection=[keep-alive], host=[access.alchemyapi.com], accept=[application/xml], path=/calls/url/URLGetRankedNamedEntities?... get /calls/url/urlgetrankednamedentities?... user-agent=[Apache CXF 2.7.5], pragma=[no-cache] } Alchemy Server Response: Header: { content-type=[application/xml; charset=utf-8], cache-control=[no-cache], connection=[keep-alive], access-control-allow-origin=[*], content-length=[506], server=[nginx], date=[Fri, 15 Aug 2014 19:30:28 GMT] } Body: <?xml version="1.0" encoding="UTF-8"?> <results> <status>OK</status> <usage>By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use:http://www.alchemyapi.com/company/terms.html </usage> <url>http://www.cnn.com/2011/09/28/us/...</url> <language>english</language> <microformats> <a href="/cnn" rel="tag">cnn</a> </microformats> </results>

More Examples…

9

Page 24: Specification and Detection of SOA Antipatterns

YouTube Client Request: Header: { cache-control=[no-cache],

content-type=[application/xml], connection=[keep-alive], host=[www.googleapis.com], accept=[application/xml], get/youtube/v3/subscriptions?mine=true&part=snippet&access_token=.. http/1.1=[null], user-agent=[Apache CXF 2.7.11], pragma=[no-cache]

} YouTube Server Response: Header: { x-frame-options=[SAMEORIGIN], content-type=[application/json; charset=UTF-8], cache-control=[private, max-age=300,must-revalidate,no-transform], x-xss-protection=[1; mode=block], x-content-type-options=[nosniff], expires=[Tue, 14 Oct 2014 17:57:26 GMT], etag=["PSjn-HSKiX6orvNhGZvglLI2lvk/PZz4CABe3efkukxgHuo_yc_qoJs"], content-length=[324], server=[GSE], alternate-protocol=[443:quic,p=0.01], date=[Tue, 14 Oct 2014 17:57:26 GMT], vary=[X-Origin, Referer, Origin] } Body: { "kind": "youtube#videoListResponse", "etag": "\"PSjn-HSKiX6orvNhGZvglLI2lvk/PZz4CABe3efkukxgHuo_yc_qo", "pageInfo": { "totalResults": 1, "resultsPerPage": 1 }, “ items": [ { "kind": "youtube#video", "etag": "\"PSjn- HSKiX6orvNhGZvglLI2lvk/9hUt36nrZXNpfqDh...", "id": "SRQtW-sjDGw" } ] }

More Examples…

Alchemy Client Request: Header: { cache-control=[no-cache], content-type=[application/xml], connection=[keep-alive], host=[access.alchemyapi.com], accept=[application/xml], path=/calls/url/URLGetRankedNamedEntities?... get /calls/url/urlgetrankednamedentities?... user-agent=[Apache CXF 2.7.5], pragma=[no-cache] } Alchemy Server Response: Header: { content-type=[application/xml; charset=utf-8], cache-control=[no-cache], connection=[keep-alive], access-control-allow-origin=[*], content-length=[506], server=[nginx], date=[Fri, 15 Aug 2014 19:30:28 GMT] } Body: <?xml version="1.0" encoding="UTF-8"?> <results> <status>OK</status> <usage>By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use:http://www.alchemyapi.com/company/terms.html </usage> <url>http://www.cnn.com/2011/09/28/us/...</url> <language>english</language> <microformats> <a href="/cnn" rel="tag">cnn</a> </microformats> </results>

9

Page 25: Specification and Detection of SOA Antipatterns

YouTube Client Request: Header: { cache-control=[no-cache],

content-type=[application/xml], connection=[keep-alive], host=[www.googleapis.com], accept=[application/xml], get/youtube/v3/subscriptions?mine=true&part=snippet&access_token=.. http/1.1=[null], user-agent=[Apache CXF 2.7.11], pragma=[no-cache]

} YouTube Server Response: Header: { x-frame-options=[SAMEORIGIN], content-type=[application/json; charset=UTF-8], cache-control=[private, max-age=300,must-revalidate,no-transform], x-xss-protection=[1; mode=block], x-content-type-options=[nosniff], expires=[Tue, 14 Oct 2014 17:57:26 GMT], etag=["PSjn-HSKiX6orvNhGZvglLI2lvk/PZz4CABe3efkukxgHuo_yc_qoJs"], content-length=[324], server=[GSE], alternate-protocol=[443:quic,p=0.01], date=[Tue, 14 Oct 2014 17:57:26 GMT], vary=[X-Origin, Referer, Origin] } Body: { "kind": "youtube#videoListResponse", "etag": "\"PSjn-HSKiX6orvNhGZvglLI2lvk/PZz4CABe3efkukxgHuo_yc_qo", "pageInfo": { "totalResults": 1, "resultsPerPage": 1 }, “ items": [ { "kind": "youtube#video", "etag": "\"PSjn- HSKiX6orvNhGZvglLI2lvk/9hUt36nrZXNpfqDh...", "id": "SRQtW-sjDGw" } ] }

More Examples…

Alchemy Client Request: Header: { cache-control=[no-cache], content-type=[application/xml], connection=[keep-alive], host=[access.alchemyapi.com], accept=[application/xml], path=/calls/url/URLGetRankedNamedEntities?... get /calls/url/urlgetrankednamedentities?... user-agent=[Apache CXF 2.7.5], pragma=[no-cache] } Alchemy Server Response: Header: { content-type=[application/xml; charset=utf-8], cache-control=[no-cache], connection=[keep-alive], access-control-allow-origin=[*], content-length=[506], server=[nginx], date=[Fri, 15 Aug 2014 19:30:28 GMT] } Body: <?xml version="1.0" encoding="UTF-8"?> <results> <status>OK</status> <usage>By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use:http://www.alchemyapi.com/company/terms.html </usage> <url>http://www.cnn.com/2011/09/28/us/...</url> <language>english</language> <microformats> <a href="/cnn" rel="tag">cnn</a> </microformats> </results>

9

Page 26: Specification and Detection of SOA Antipatterns

SBSs + Antipatterns = ?

An automatic approach to detect SOA antipatterns in SBSs may support their

easy maintenance and evolution.

Poor performance

Hard for comprehension

Low maintainability

Hard for evolution

Expensive maintenance life

Low reusability +

Specification and Detection of SOA Antipatterns 10

Page 27: Specification and Detection of SOA Antipatterns

Research Problems

• No specification of SOA antipatterns

• No dedicated approach and framework for the detection of SOA

antipatterns in SBSs

• Impact of SOA antipatterns is not yet verified in service-based systems

Specification and Detection of SOA Antipatterns 11

Page 28: Specification and Detection of SOA Antipatterns

Research Questions

Page 29: Specification and Detection of SOA Antipatterns

Research Questions

RQ1: Do service-oriented antipatterns differ from the object-oriented antipatterns?

RQ2: Do the service-oriented antipatterns vary in diverse SBSs developed using different SOA technologies?

RQ3: Can we efficiently specify and detect SOA antipatterns regardless of SOA technologies?

RQ4: How do the SOA antipatterns impact the maintenance and evolution of SBSs?

Specification and Detection of SOA Antipatterns 12

Page 30: Specification and Detection of SOA Antipatterns

Related Work

Page 31: Specification and Detection of SOA Antipatterns

Related Work

Specification and Detection of SOA Antipatterns 13

Page 32: Specification and Detection of SOA Antipatterns

Related Work: Summary

What to Detect/ Technology OO CBSs SOA Other

Code Smells

Emden and Moonen, 2002 Khomh et al., 2009 Moha et al., 2010 Luo et al., 2010

Maneerat and Muenchaisri, 2011

X X X

Antipatterns

Correa et al., 2000 Marinescu, 2001, 2004 Boussaidi et al., 2005

Kreimer, 2005, Biehl, 2006 Salehie et al., 2006

Choinzon and Ueda, 2006 Rao and Reddy, 2007

Khomh et al., 2009, 2011 Llano and Pooley, 2009

Moha et al., 2010 Cortellessa et al., 2010

Luo et al., 2010, Settas et al., 2011 Stoianov and Sora, 2010 Kessentini et al., 2011

Parsons and Murphy, 2004 Parsons and Murphy, 2008

Chis, 2008

X Wong et al., 2010 Fourati et al., 2011

Design Patterns

Kramer and Prechelt, 1996 Antoniol et al., 1998

Heuzeroth et al., 2003 Tsantalis et al., 2006 Kaczor et al., 2006

Guéhéneuc and Antoniol, 2008 Stoianov and Sora, 2010

Maggioni and Arcelli, 2010 Kaczor et al., 2010

Rasool and Mäder, 2011

X

Di Penta et al., 2007

X

Specification and Detection of SOA Antipatterns 14

Page 33: Specification and Detection of SOA Antipatterns

Contributions…

Page 34: Specification and Detection of SOA Antipatterns

Introduction: Contribution

With the goal to assess the design and QoS of SBSs:

• SODA (Service Oriented Detection for Antipatterns), a novel and

innovative approach

• SOFA (Service Oriented Framework for Antipatterns), a framework,

- to specify SOA antipatterns and detect them automatically

- to perform static and dynamic analyses

Specification and Detection of SOA Antipatterns 15

Page 35: Specification and Detection of SOA Antipatterns

Our Detection Approach

Page 36: Specification and Detection of SOA Antipatterns

Proposed SODA Approach

Specification and Detection of SOA Antipatterns 16

Page 37: Specification and Detection of SOA Antipatterns

SOA Antipatterns Tree

Specification and Detection of SOA Antipatterns 17

Page 38: Specification and Detection of SOA Antipatterns

Domain Analysis

“Multi Service also known as God Object

corresponds to a service that implements a

multitude of methods related to different

business and technical abstractions. This

aggregates too much into a single service, such

a service is not easily reusable because of the

low cohesion of its methods and is often

unavailable to end-users because of its overload,

which may induce a high response time”

(Dudney et al., 2003)

Textual Description of Antipatterns

1. S

pe

cifi

cati

on

s

Rule Card

2. G

en

era

tio

n

Detection Algorithms

3. D

ete

ctio

n

SBS Template

Services involved in

antipatterns

Specification and Detection of SOA Antipatterns 18

Page 39: Specification and Detection of SOA Antipatterns

Antipatterns Specification Language

Textual Description of Antipatterns

1. S

pe

cifi

cati

on

s

Rule Card

2. G

en

era

tio

n

Detection Algorithms

3. D

ete

ctio

n

SBS Template

Services involved in

antipatterns

Specification and Detection of SOA Antipatterns 19

Page 40: Specification and Detection of SOA Antipatterns

Specification Examples

1 RULE_CARD: GodObjectWebService {

2 RULE: GodObjectWebService { INTER LowCohesion MultiOperation HighResponseTime LowAvailability };

3 RULE: LowCohesion { COH VERY_LOW };

4 RULE: MultiOperation { NOD HIGH };

5 RULE: HighResponseTime { RT VERY_HIGH };

6 RULE: LowAvailability { A LOW };

7 };

1 RULE_CARD: GodComponent {

2 RULE: GodComponent { INTER HighEncapsulatedService MultiMethod HighParameter };

3 RULE: HighEncapsulatedService { NOSE HIGH };

4 RULE: MultiMethod { NMD VERY_HIGH };

5 RULE: HighParameter { TNP VERY_HIGH };

6 };

Textual Description of Antipatterns

1. S

pe

cifi

cati

on

s

Rule Card

2. G

en

era

tio

n

Detection Algorithms

3. D

ete

ctio

n

SBS Template

Services involved in

antipatterns

Specification and Detection of SOA Antipatterns 20

Page 41: Specification and Detection of SOA Antipatterns

Algorithm Generation

Textual Description of Antipatterns

1. S

pe

cifi

cati

on

s

Rule Card

2. G

en

era

tio

n

Detection Algorithms

3. D

ete

ctio

n

SBS Template

Services involved in

antipatterns

Model Driven Engineering (MDE)

Parsing

1

Visiting & Replacing

2

Templates

Models of Rule Cards

Rule Cards

Algorithms

Specification and Detection of SOA Antipatterns 21

Page 42: Specification and Detection of SOA Antipatterns

SOFA Detection Framework

Textual Description of Antipatterns

1. S

pe

cifi

cati

on

s

Rule Card

2. G

en

era

tio

n

Detection Algorithms

3. D

ete

ctio

n

SBS Template

Services involved in

antipatterns

Specification and Detection of SOA Antipatterns 22

Page 43: Specification and Detection of SOA Antipatterns

Subjects and Objects

Page 44: Specification and Detection of SOA Antipatterns

Validation: Subjects

Service Component Architecture SOAP-based Web services

1. Multi Service 2. Tiny Service 3. Sand Pile 4. Chatty Service 5. The Knot 6. Nobody Home 7. Duplicated Service 8. Bottleneck Service 9. Service Chain 10. Data Service 11. God Component 12. Bloated Service 13. Stovepipe Service

1. God Object Web Service 2. Fine Grained Web Service 3. Ambiguous Name 4. Duplicated Web Service 5. Chatty Web Service 6. Low Cohesive Operations in the Same Port 7. Redundant Port 8. Maybe It is Not RPC 9. Data Web Service 10. CRUDy Interface

REST

1. Ignoring Status Code 2. Tunneling Everything Through GET 3. Tunneling Everything Through POST 4. Forgetting Hypermedia 5. Ignoring Caching 6. Misusing Cookies 7. Ignoring MIME Types 8. Breaking Self Descriptiveness 9. Contextless Resource Names 10. Singularised URI Nodes

Specification and Detection of SOA Antipatterns 23

Page 45: Specification and Detection of SOA Antipatterns

Validation: Objects

Service Component Architecture

Home-Automation – an SCA-based demo system to automate household

FraSCAti – the largest open source SCA system and runtime library for SCA apps

REST APIs

12 REST APIs including BestBuy, DropBox, Facebook, Twitter, and YouTube 115 RESTful method calls

SOAP-based Web Services

120+ Weather- and Finance-related SOAP Web services

Specification and Detection of SOA Antipatterns 24

Page 46: Specification and Detection of SOA Antipatterns

Detection Results in SCA

Page 47: Specification and Detection of SOA Antipatterns

*Availability 100%

Detection Result: Multi Service in SCA

Mediator

Specification and Detection of SOA Antipatterns 25

Page 48: Specification and Detection of SOA Antipatterns

Partial Results on SCA (FraSCAti)

Antipattern Name

Services Involved

Metrics Time Precision Recall

Tiny Service sca-parser NMD=1; CPL=0.56 0.067s [1/1] 100%

[1/1] 100%

Bottleneck Service

sca-composite sca-parser

RT=41ms;CPL=0.96; NIR=16;NOR=8 RT=45ms;CPL=0.84; NIR=16;NOR=5

0.086s [1/2] 50%

[1/1] 100%

Specification and Detection of SOA Antipatterns 26

Page 49: Specification and Detection of SOA Antipatterns

Summary Results on SCA

SCA Systems Average Precision Average Recall Average

Detection Time

Home-Automation 92.5% 100% 0.387s

FraSCAti 89.17% 95% 0.089s

Average 90.84% 97.5% 0.238s

Specification and Detection of SOA Antipatterns 27

Page 50: Specification and Detection of SOA Antipatterns

Detection Results in Web Services

Page 51: Specification and Detection of SOA Antipatterns

51

Detection of Chatty Web Service antipattern in TaarifCustoms Web service.

RULE_CARD: ChattyWebService {

RULE: ChattyWebService {INTER LowCohesion HighDataAccessor MultiOperation LowPerformance};

RULE: LowCohesion {COH LOW};

RULE: HighDataAccessor {ANAO VERY_HIGH};

RULE: MultiOperation {NOD HIGH};

RULE: LowPerformance {INTER HighRT LowA};

RULE: HighRT {RT HIGH};

RULE: LowA {A LOW};

};

23

Low Cohesion High Accessor Methods High Methods High Response Time Low Availability

Detection Result: Chatty Web Service

Specification and Detection of SOA Antipatterns

Page 52: Specification and Detection of SOA Antipatterns

Summary Results on Web Services

Experiments Detection

Times Detected

(True Positive) Manually Validated

Precision Recall

13 Weather Web services

102.19s 7

(6) 6 85.71% 100%

109 Finance Web services

192.91s 24

(22) 22 91.67% 100%

Average - - - 88.69% 100%

Specification and Detection of SOA Antipatterns 29

Page 53: Specification and Detection of SOA Antipatterns

Detection in REST

Page 54: Specification and Detection of SOA Antipatterns

SODA-R approach for REST

SODA-R: Service Oriented Detection for Antipatterns in REST

Step 1

Analysis

Description of REST patterns and antipatterns

Heuristics

Step 2

Algorithms

Detection

Detected REST patterns and antipatterns

REST APIs Implementation

Application of Algorithms

Specification and Detection of SOA Antipatterns 30

Page 55: Specification and Detection of SOA Antipatterns

Detection Heuristics

1: ENTITY-LINKING(response-header, response-body, http-method) 2: body-links[] EXTRACT-ENTITY-LINKS(response-body) 3: header-link response-header.getValue(“Link”)

4: if (http-method = GET and (LENGTH(body-links[]) = 1 or header-link NIL)) or 5: (http-method = POST and (“Location:” response-header.getKeys() or 6: LENGTH(body-links[]) = 1))) then 7: print “Entity Linking detected” 8: end if

Heuristic of Entity Linking pattern

1: FORGET-HYPER-MEDIA(response-header, response-body, http-method) 2: body-links[] EXTRACT-ENTITY-LINKS(response-body) 3: header-link response-header.getValue(“Link”) 4: if (http-method = GET and (LENGTH(body-links[]) = 0 or header-link = NIL)) or 5: (http-method = POST and (“Location:” response-header.getKeys() and 6: LENGTH(body-links[]) = 0))) then 7: print “Forgetting Hypermedia detected” 8: end if

Heuristic of Forgetting Hypermedia antipattern

Specification and Detection of SOA Antipatterns 31

Page 56: Specification and Detection of SOA Antipatterns

Detection Phase

Heuristics

Detection Algorithms

Service Interfaces

Step 2.2

Dynamic Invocation

REST requests and responses

Client Authentication

REST APIs

Detected REST patterns

and antipatterns

Step 2.3

Application

Implementation

Algorithms

Interfaces

Step 2.1

Specification and Detection of SOA Antipatterns 32

Page 57: Specification and Detection of SOA Antipatterns

Validation: Objects in REST

REST APIs Online Documentations

alchemyapi.com/api/

bbyopen.com/developer/

dev.bitly.com/api.html

charlieharvey.org.uk/about/api/

dropbox.com/developers/core/docs/

developers.facebook.com/docs/graph-api/

developer.musicgraph.com/api-docs/overview/

github.com/blackducksw/ohloh_api/

integrate.teamviewer.com/en/develop/documentation/

dev.twitter.com/docs/api/

developers.google.com/youtube/v3/

developer.zappos.com/docs/api-documentation/

Specification and Detection of SOA Antipatterns 33

Page 58: Specification and Detection of SOA Antipatterns

REST Detection Results

Page 59: Specification and Detection of SOA Antipatterns

Detection Results for Antipatterns

-

0.50

1.00

1.50

2.00

2.50

3.00

3.50

average_antipatterns_instance

Specification and Detection of SOA Antipatterns 34

Page 60: Specification and Detection of SOA Antipatterns

Detection Results for Antipatterns

-

0.50

1.00

1.50

2.00

2.50

3.00

3.50

average_antipatterns_instance

Specification and Detection of SOA Antipatterns 34

Page 61: Specification and Detection of SOA Antipatterns

-

0.50

1.00

1.50

2.00

2.50

3.00

3.50

average_patterns_instances

Detection Results for Patterns

Specification and Detection of SOA Antipatterns 35

Page 62: Specification and Detection of SOA Antipatterns

-

0.50

1.00

1.50

2.00

2.50

3.00

3.50

average_patterns_instances

Detection Results for Patterns

Specification and Detection of SOA Antipatterns 35

Page 63: Specification and Detection of SOA Antipatterns

-

0.50

1.00

1.50

2.00

2.50

3.00

3.50

Detection Results: Antipatterns vs. Pattern

Specification and Detection of SOA Antipatterns 36

Page 64: Specification and Detection of SOA Antipatterns

Forgetting_Hypermedia Entity_Linking

-

0.50

1.00

1.50

2.00

2.50

3.00

3.50

Detection Results: Antipatterns vs. Pattern

Specification and Detection of SOA Antipatterns 36

Page 65: Specification and Detection of SOA Antipatterns

Example Detection Results

(7) A

lchem

y -

(12) B

estBuy -

(3) B

itly -

(4) C

harlieH

arvey -

(15) D

ropB

ox -

(29) F

acebook -

(8) M

usicg

raph -

(3) O

hlo

h -

(8) T

eamV

iewer -

(10) T

witter -

(9) Y

ouT

ube -

(7) Z

appos -

(115) T

otal -

Averag

e Precisio

n -

Recall -

Detectio

n T

ime -

Forgetting Hypermedia

1/1 0/0 2/2 0/0 9/10 8/8 7/7 0/0 3/3 4/4 2/3 0/0 36/38 94.58% 19.54s

1/1 0/0 2/2 0/0 9/9 8/8 7/7 0/0 3/3 4/4 2/2 0/0 36/36 100%

Entity Linking

6/6 11/11 1/1 4/4 3/3 21/21 1/1 2/2 1/1 5/5 6/6 4/4 65/65 100% 19.90s

6/6 11/11 1/1 4/4 3/3 21/21 1/1 2/2 1/1 5/5 6/7 4/4 65/66 98.81%

Specification and Detection of SOA Antipatterns 37

Page 66: Specification and Detection of SOA Antipatterns

Four Hypotheses

Page 67: Specification and Detection of SOA Antipatterns

H1: Generality

Our DSL allows the specification of various SOA antipatterns, from simple to more complex ones

1 RULE_CARD: LowCohesiveOperations { 2 RULE: LowCohesiveOperations { INTER MultiOperation LowCohesivePT }; 3 RULE: MultiOperation { NOD HIGH }; 4 RULE: LowCohesivePT { ARIO LOW }; 5 };

Specification and Detection of SOA Antipatterns 38

Page 68: Specification and Detection of SOA Antipatterns

H1: Generality

Our DSL allows the specification of various SOA antipatterns, from simple to more complex ones

1 RULE_CARD: CRUDyInterface { 2 RULE: CRUDyInterface { INTER ChattyInterface HighCRUDOperation }; 3 RULE: ChattyInterface { RULE_CARD: ChattyWebService }; 4 RULE: HighCRUDOperation { NCO > 1 }; 5 };

1 RULE_CARD: ChattyWebService { 2 RULE: ChattyWebService { INTER LowCohesion HighDataAccessor MultiOperation LowPerformance }; 3 RULE: LowCohesion { COH LOW }; 4 RULE: HighDataAccessor { ANAO VERY_HIGH }; 5 RULE: MultiOperation { NOD HIGH }; 6 RULE: LowPerformance { INTER HighRT LowA }; 7 RULE: HighRT { RT HIGH }; 8 RULE: LowA { A LOW }; 9 };

1 RULE_CARD: LowCohesiveOperations { 2 RULE: LowCohesiveOperations { INTER MultiOperation LowCohesivePT }; 3 RULE: MultiOperation { NOD HIGH }; 4 RULE: LowCohesivePT { ARIO LOW }; 5 };

Specification and Detection of SOA Antipatterns 38

Page 69: Specification and Detection of SOA Antipatterns

H2: Accuracy

The detection algorithms have an average precision of more than 75% and a recall of 100%, i.e., more than three-quarters of detected antipatterns are true positive and we do not miss any existing antipatterns

Web Services 88.69% 100%

Average Precision Average Recall

SCA 90.84% 97.5%

REST 89.42% 94%

Specification and Detection of SOA Antipatterns 39

Average 89.65% 97.17%

Page 70: Specification and Detection of SOA Antipatterns

H3: Extendibility

Our DSL and SOFA framework are extensible for adding new metrics and new SOA antipatterns

Web Services 10 0 10

Antipatterns Patterns New Metrics

SCA 13 0 17

REST 8 5 -

Total 31 5 27

Specification and Detection of SOA Antipatterns 40

Page 71: Specification and Detection of SOA Antipatterns

H4: Performance

The computation time required for the detection of antipatterns using the generated algorithms is reasonably very low, i.e., in the order of few seconds

Web Services 147.55s

Average Detection Time

SCA 0.238s

REST 21.43s

Average 51.41s

Specification and Detection of SOA Antipatterns 41

Page 72: Specification and Detection of SOA Antipatterns

Impact of Antipatterns

Page 73: Specification and Detection of SOA Antipatterns

Impact of Antipatterns

The Wilcoxon Rank Sum Test

42

Page 74: Specification and Detection of SOA Antipatterns

To Conclude…

Page 75: Specification and Detection of SOA Antipatterns

Conclusion

Specification and Detection of SOA Antipatterns 43

Page 76: Specification and Detection of SOA Antipatterns

Conclusion

Specification and Detection of SOA Antipatterns 43

Page 77: Specification and Detection of SOA Antipatterns

Conclusion

Specification and Detection of SOA Antipatterns 43

Page 78: Specification and Detection of SOA Antipatterns

Conclusion

Specification and Detection of SOA Antipatterns 43

Page 79: Specification and Detection of SOA Antipatterns

Current and Future Plan

• Antipatterns in service-oriented business processes, i.e., BPEL

• Semantic analysis of REST APIs based on dictionaries

(WordNet and Stanford Core NLP)

• A comprehensive tool support for the detection

• Further validation of the approach with more Web services and

RESTful APIs

Specification and Detection of SOA Antipatterns 44

Page 80: Specification and Detection of SOA Antipatterns

Thanks and Questions?

Page 81: Specification and Detection of SOA Antipatterns
Page 82: Specification and Detection of SOA Antipatterns

Antipattern Template

Page 83: Specification and Detection of SOA Antipatterns

Generated Code