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
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.
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
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
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
Research Questions
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
Related Work
Related Work
Specification and Detection of SOA Antipatterns 13
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
Contributions…
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
Our Detection Approach
Proposed SODA Approach
Specification and Detection of SOA Antipatterns 16
SOA Antipatterns Tree
Specification and Detection of SOA Antipatterns 17
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
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
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
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
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
Subjects and Objects
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
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
Detection Results in SCA
*Availability 100%
Detection Result: Multi Service in SCA
Mediator
Specification and Detection of SOA Antipatterns 25
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%
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
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
Specification and Detection of SOA Antipatterns 38
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%
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
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
Impact of Antipatterns
Impact of Antipatterns
The Wilcoxon Rank Sum Test
42
To Conclude…
Conclusion
Specification and Detection of SOA Antipatterns 43
Conclusion
Specification and Detection of SOA Antipatterns 43
Conclusion
Specification and Detection of SOA Antipatterns 43
Conclusion
Specification and Detection of SOA Antipatterns 43
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