Unblocking The Main Thread Solving ANRs and Frozen Frames
Specification and Detection of SOA Antipatterns in Web Services
1. Specification and Detection of SOA Antipatterns
in Web Services
Francis Palma, Naouel Moha, Guy Tremblay, and Yann-Gaël Guéhéneuc.
ECSA 2014, Vienna, Austria.
2. Problem Context (1/3)
HTTP, SOAP, WSDL,
UDDI, WS-Technologies
• Service-based systems composed of Web services evolve:
- degrade design, quality of service
- cause the appearance of common poor solutions: antipatterns
- antipatterns might exist since the beginning
• Antipatterns are ineffective solutions and have negative consequences
[A. Koenig, 1995].
Specification and Detection of SOA Antipatterns in Web Services
Service Consumer
Service Provider
Service-based system
2
3. Problem Context (2/3)
Examples of Antipatterns in Web services:
Fine Grained Web Service*
3
God Object Web Service*
Specification and Detection of SOA Antipatterns in Web Services
Many Methods
Very Low Cohesion
High Response Time
Low Availability
Few Methods
Low Cohesion
Very High Coupling
* J2EE AntiPatterns, Bill Dudney, Stephen Asbury, Joseph K. Krozak, Kevin Wittkopf, ISBN: 978-0-471-14615-5, August 2003
4. Problem Context (3/3)
An automatic approach to detect SOA antipatterns in Web services may
support their easy maintenance and evolution, and high reusability.
Poor performance
Hard for comprehension
Low maintainability
Hard for evolution
Expensive maintenance life
Low reusability
4
+
Specification and Detection of SOA Antipatterns in Web Services
7. Contribution
Goal: To assess the design and quality of service of Web services
• SODA-W (Service Oriented Detection for Antipatterns in Web services), a novel
and innovative approach
- inspired from SODA (Service Oriented Detection for Antipatterns), an approach
to detect antipatterns in SCA (Service Component Architecture) systems
• SOFA (Service Oriented Framework for Antipatterns), a framework,
- specifies SOA antipatterns and detect them automatically
- analyses service interfaces syntactically and semantically
- performs static and dynamic analysis
5Specification and Detection of SOA Antipatterns in Web Services
9. Related Work on Web Services (1/2)
Specification and Detection of SOA Antipatterns in Web Services 6
Heuristics-based, Rodriguez et al.
10. Related Work on Web Services (1/2)
Specification and Detection of SOA Antipatterns in Web Services 6
Heuristics-based, Rodriguez et al.
Rule cards-based SODA, Moha et al.
11. Related Work on Web Services (1/2)
Specification and Detection of SOA Antipatterns in Web Services 6
Heuristics-based, Rodriguez et al.
Rule cards-based SODA, Moha et al.
Guidelines to improve service
descriptions & search queries
EasySOC, Rodriguez et al.
12. Related Work on Web Services (1/2)
Specification and Detection of SOA Antipatterns in Web Services 6
Heuristics-based, Rodriguez et al.
Rule cards-based SODA, Moha et al.
Correlation analysis between OO & WSDL metrics,
Coscia et al.
2013
2009
Survey on service cohesion,
coupling, and reusability metrics,
Sindhgatta et al.
Guidelines to improve service
descriptions & search queries
EasySOC, Rodriguez et al.
13. Related Work on Web Services (2/2)
Survey on service cohesion,
coupling, and reusability metrics,
Sindhgatta et al.
Specification and Detection of SOA Antipatterns in Web Services 7
Heuristics-based, Rodriguez et al.
Rule cards-based SODA, Moha et al.
Correlation analysis between OO & WSDL metrics,
Coscia et al.
- Specific SCA technology
- No semantic analysis
- Static analysis of WSDLs
- No antipatterns specification
- No analysis of design
- No semantic analysis
- Static analysis of WSDLs
- No specification of antipatterns
- No semantic analysis
- No design analysis
- No dedicated detection approach
- No design analysis
- No dedicated detection approach
2013
2009
Guidelines to improve service
descriptions & search queries
EasySOC, Rodriguez et al.
15. Approach (1/7): SODA-W
SODA-W: Service Oriented Detection for Antipatterns in Web services
- inspired from SODA (Service Oriented Detection for Antipatterns)
8Specification and Detection of SOA Antipatterns in Web Services
16. Approach (2/7): Specification
1. Specify SOA Antipatterns
in Web services
Domain Analysis
Domain Specific
Language
Rule Cards of
Antipatterns
God Object Web Service corresponds to a Web service that
contains a large number of operations related to different
business abstractions. Often the client interactions break due to
frequent changes in the Web service definition, hence cause low
availability. This antipattern affects the reusability because the
operations are very low cohesive. Moreover, being overloaded
with a multitude of operations, this antipattern may also result
in high response time [Dudney et al. 2003].
BNF Grammar
9Specification and Detection of SOA Antipatterns in Web Services
17. Approach (3/7): Domain Specific Language
Specification and Detection of SOA Antipatterns in Web Services 10
18. Approach (4/7): Example Rule Cards
God Object Web Service:
1 RULE_CARD: GodObjectWebService {
2 RULE: GodObjectWebService { INTER LowCohesion MultiOperation HighRT LowA };
3 RULE: LowCohesion { COH VERY_LOW };
4 RULE: MultiOperation { NOD HIGH };
5 RULE: HighRT { RT VERY_HIGH };
6 RULE: LowA { A LOW };
7 };
Fine Grained Web Service:
1 RULE_CARD: FineGrainedWebService {
2 RULE: FineGrainedWebService { INTER FewOperation HighCoupling LowCohesion };
3 RULE: FewOperation { NOD LOW };
4 RULE: HighCoupling { CPL VERY_HIGH };
5 RULE: LowCohesion { COH LOW };
6 };
Specification and Detection of SOA Antipatterns in Web Services 11
20. Approach (5/7): Generation (on going)
Model Driven Engineering (MDE)
Specification and Detection of SOA Antipatterns in Web Services 12
Parsing
1
Visiting &
Replacing
2
Templates
Models of Rule Cards
21. Approach (6/7): Detection
SOFA: Service Oriented Framework for Antipatterns
Specification and Detection of SOA Antipatterns in Web Services 13
24. Experiments (1/5): Setup
Purpose is to show,
- the generality of our DSL
- the preciseness of our detection algorithms, and
- the extensibility of our DSL and SOFA framework
Subjects:
- 10 common SOA antipatterns in Web services
Objects:
- 13 weather-related Web services
- 109 finance-related Web services
15Specification and Detection of SOA Antipatterns in Web Services
25. Experiments (2/5): Hypotheses
H1. Generality
Our DSL allows the specification of various SOA antipatterns, from simple to more
complex ones
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
H3. Extensibility
Our DSL and SOFA framework are extensible for adding new metrics and new SOA
antipatterns
16Specification and Detection of SOA Antipatterns in Web Services
26. Experiments (3/5): Subjects
We specify 10 SOA antipatterns:
17
1. Ambiguous Name
2. Chatty Web Service
3. CRUDy Interface
4. Data Web Service
5. Duplicated Web Service
6. Fine Grained Web Service
7. God Object Web Service
8. Low Cohesive Operations in the Same PortType
9. Maybe It's Not RPC
10. Redundant PortTypes
Ambiguous Name
Chatty Web Service
Specification and Detection of SOA Antipatterns in Web Services
Low Cohesion
High Accessor Methods
High Methods
High Response Time
Low Availability
Very Long or Short Signatures
Too Many General Terms
Verbs in Message Names
Multiple Verbs in Operation Signatures
27. Experiments (4/5): Objects
Web service search engines:
eil.cs.txstate.edu/ServiceXplorer
programmableweb.com
myexperiment.org
taverna.org.uk, etc.
18
The set of Web services includes:
1. 13 weather-related Web services (keyword ‘Weather’)
2. 109 finance-related Web services (keyword ‘Finance’)
The complete list of analysed Web services is available on sofa.uqam.ca/soda-w/
Specification and Detection of SOA Antipatterns in Web Services
28. Experiments (5/5): Process
1. Specify 10 Web services-specific SOA antipatterns using rule cards
2. Generate detection algorithm for each antipattern
3. Apply these algorithms on 122 Web services
4. Validate detection results by analysing the suspicious services manually
5. Use precision, recall, and specificity for accuracy measurement
19Specification and Detection of SOA Antipatterns in Web Services
30. Results (1/6): Detection
20
RULE_CARD: AmbiguousName {
RULE: AmbiguousName {INTER GeneralTerm ShortORLongSignature VerbedMessage MultiVerbedOperation};
RULE: ShortORLongSignature {UNION ShortSignature LongSignature};
RULE: LongSignature {ALS VERY_HIGH};
RULE: ShortSignature {ALS VERY_LOW};
RULE: GeneralTerm {RGTS HIGH};
RULE: VerbedMessage {NVMS > 0};
RULE: MultiVerbedOperation {NVOS > 1};
};
Detection of Ambiguous Name antipattern in AIP3_PV_Impact Web service.
Specification and Detection of SOA Antipatterns in Web Services
Very Long or Short Signatures
Too Many General Terms
Verbs in Message Names
Multiple Verbs in Operation Signatures
31. Results (2/6): Detection
31
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};
};
Specification and Detection of SOA Antipatterns in Web Services
• Response time is calculated using SAAJ1 API and SoapUI2.
(1) https://saaj.java.net/ (2) www.soapui.org
23
Low Cohesion
High Accessor Methods
High Methods
High Response Time
Low Availability
32. Results (3/6): Hypothesis H1
H1. Generality: Our DSL allows the specification of various SOA antipatterns, from
simple to more complex ones
22Specification and Detection of SOA Antipatterns in Web Services
1 RULE_CARD: LowCohesiveOperations {
2 RULE: LowCohesiveOperations { INTER MultiOperation LowCohesivePT };
3 RULE: MultiOperation { NOD HIGH };
4 RULE: LowCohesivePT { ARIO LOW };
5 };
33. Results (3/6): Hypothesis H1
H1. Generality: Our DSL allows the specification of various SOA antipatterns, from
simple to more complex ones
22
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 };
Specification and Detection of SOA Antipatterns in Web Services
1 RULE_CARD: LowCohesiveOperations {
2 RULE: LowCohesiveOperations { INTER MultiOperation LowCohesivePT };
3 RULE: MultiOperation { NOD HIGH };
4 RULE: LowCohesivePT { ARIO LOW };
5 };
34. Results (3/6): Hypothesis H1
H1. Generality: Our DSL allows the specification of various SOA antipatterns, from
simple to more complex ones ...YES!!!
22Specification and Detection of SOA Antipatterns in Web Services
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 };
35. Results (4/6): Hypothesis H2
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
23
Experiments
Detection
Times
Detected
(True Positive)
Manually
Validated
Precision Recall Specificity
13 Weather
Web services
102.19s
7
(6)
6 85.71% 100% 98%
109 Finance
Web services
192.91s
24
(22)
22 91.67% 100% 99%
Average - - - 88.69% 100% 98.5%
Specification and Detection of SOA Antipatterns in Web Services
36. Results (4/6): Hypothesis H2
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 ...YES!!!
23
Experiments
Detection
Times
Detected
(True Positive)
Manually
Validated
Precision Recall Specificity
13 Weather
Web services
102.19s
7
(6)
6 85.71% 100% 98%
109 Finance
Web services
192.91s
24
(22)
22 91.67% 100% 99%
Average - - - 88.69% 100% 98.5%
Specification and Detection of SOA Antipatterns in Web Services
37. Results (5/6): Hypothesis H3
H3. Extensibility: Our DSL and SOFA framework are extensible for adding new
metrics and new SOA antipatterns
24Specification and Detection of SOA Antipatterns in Web Services
38. Results (5/6): Hypothesis H3
H3. Extensibility: Our DSL and SOFA framework are extensible for adding new
metrics and new SOA antipatterns
24
- 10 SCA-specific SOA antipatterns
using SODA
- 10 Web service-specific SOA
antipatterns using SODA-W
Moreover, SOFA supports
the detection of,
Specification and Detection of SOA Antipatterns in Web Services
39. Results (5/6): Hypothesis H3
H3. Extensibility: Our DSL and SOFA framework are extensible for adding new
metrics and new SOA antipatterns ...YES!!!
24Specification and Detection of SOA Antipatterns in Web Services
- 10 SCA-specific SOA antipatterns
using SODA
- 10 Web service-specific SOA
antipatterns using SODA-W
Moreover, SOFA supports
the detection of,
40. Results (6/6): Validation Summary
Specify and implement detection algorithms for 10 Web service-specific SOA
antipatterns
Detect 10 Web service-specific SOA antipatterns on two sets of Web services
13 weather-related Web services
109 finance-related Web services
Average precision of our detection algorithms is 88.69% and recall is 100%
Average specificity of our rule cards is 98.5%
Detail results and more materials on sofa.uqam.ca/soda-w/
25Specification and Detection of SOA Antipatterns in Web Services
45. Future Work
- Additional experiments with more Web services and SOA antipatterns
- Correction through adding recommendation support for service developers
- Focus on other SOA styles and technologies, e.g., RESTful services
Specification and Detection of SOA Antipatterns in Web Services 27
50. Related Work (1/2)
SOAOO
- Adopt OO design style
- Services as first-class entities
- Highly dynamic, also static
- Adopt procedural design style
- Classes as first-class entities
- Mainly static, also dynamic analysis
Specification and Detection of SOA Antipatterns in Web Services 6
Books/Articles:
• J2EE Antipatterns, Dudney et al. 2003
• SOA Patterns, Rotem-Gal-Oz et al. 2012
• Crucial SO Antipatterns, Král and Žemlička, 2003
Detection Methods in OO:
• Kessentini et al. (2011), Munro et al. (2005), Settas et al. (2011), ...
► OO detection methods and tools cannot be directly applied to SOA:
56. Threats to Validity
External Validity:
Generalisation to other large set of Web services
Internal Validity:
Detection depends on services provided by SOFA . We experimented on a
representative set of Web service-specific antipatterns
Construct Validity:
Rule cards are subjective. We define rule cards based on thorough literature review
and domain analysis
Specification and Detection of SOA Antipatterns in Web Services 26
57. Related Work (1/2)
Specification and Detection of SOA Antipatterns in Web Services 6
Books/Articles:
• J2EE Antipatterns, Dudney et al. 2003
• SOA Patterns, Rotem-Gal-Oz et al. 2012
• Crucial SO Antipatterns, Král and Žemlička, 2003
Detection Methods in OO:
• Kessentini et al. (2011), Munro et al. (2005), Settas et al. (2011), ...
58. Related Work (1/2)
SOAOO
- Adopt OO design style
- Services as first-class entities
- Highly dynamic, also static
- Adopt procedural design style
- Classes as first-class entities
- Mainly static, also dynamic analysis
Specification and Detection of SOA Antipatterns in Web Services 6
Books/Articles:
• J2EE Antipatterns, Dudney et al. 2003
• SOA Patterns, Rotem-Gal-Oz et al. 2012
• Crucial SO Antipatterns, Král and Žemlička, 2003
Detection Methods in OO:
• Kessentini et al. (2011), Munro et al. (2005), Settas et al. (2011), ...
► OO detection methods and tools cannot be directly applied to SOA: