web service antipatterns detection using genetic programming
TRANSCRIPT
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Web Service Antipatterns Detection Using
Genetic Programming
Ali Ouni1, Raula Gaikovina Kula1, Marouane Kessentini2, Katsuro Inoue1
1Osaka University, Japan2University of Michigan, USA
Genetic and Evolutionary Computation Conference (GECCO’15)
13 July 2015, Madrid, Spain
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
• SOA is
– a way of designing system
– an approach to system development
– a design paradigm
• SOA is not an architecture, is not a system
• SOA can be implemented utilizing different technologies
– OSGi, SCA, REST, Web services
• Service-based system = a set of ready-made, composable and reusable
services
What is SOA?
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Services
• Services are reusable components that represent business tasks
– Customer lookup
– Meteo servie
– Localisation service
– Credit check
– Hotel reservation
– Interest calculation
• Services provide reusable functionality with well-defined interfaces
• An SOA infrastructure enables discovery, composition and invocation of services
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
• Example: Travel system
Service-based system
Client
Travel
Service
+ bookTrip()
Payment serviceFlight Service
+ checkDates()
+ reserveFlight()
+ cancelFlight()
Rent Car Service
+ checkAvailability()
+ reserveCar()
+ cancelCar()
HotelService
+ checkHotel()
+ reserveHotel()
+ cancelHotel()
XML technologies
{SOAP, WSDL, UDDI,...}
Service provider
Internet
Client
Client
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
If designed well…
• If designed well, Web service adoption can lead to
– Cost-efficiency
– interoperability
– Agility
– Adaptability
– Leverage of legacy investments
The hard part is the “if designed well”.
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
• SOA Change continuously– add new user requirements
– Adapt to environment changes
• Poorly planned changes may degrade their design quality
and QoS
–> bad design practices: Anti-patterns
Problem
6
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Typical Web service antipatterns
Multi-service Nano-service
7
TravelService
Endpoint
+ bookFlight()
+ reserveFlight()
+ cancelFlight()
+ reserveCar()
+ cancelCar()
+ reserveHotel()
+ checkDates()
+ modifyBooking()
+ acceptPayment()
+ addPaymentDetails()
+ validateCredit()
+ printInvoice()
+ sendInvoice()
Client 1
Client 2
Client 3
Client n
Flight details.xml
Car reservation.xml
Hotel booking.xml
Payment.xml...
TravelService
Flight Reservation
Service
+ bookFlight()
Flight Change
Service
+ changeFlight()
Flight Cancellation
Service
+ cancelFlight()
- Symptoms
- Aggregates too many methods into a single
service
- Low cohesion of its methods
- Consequences
- Not easily reusable
- Overload: often unavailable to end-users
- Symptoms
- Small service with few operations
- whose overhead outweighs its utility
- Consequences
- requires several coupled services
- high development complexity
- reduced usability
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Current approaches
• Manual approaches
– Service antipatterns definition (Dudney et al., 2003, Král et al, 2009, Rotem-
Gal-Oz et al., 2012)
• Symptoms-based approaches
– Detection rules (Moha et al., 2012, Palma et al., 2014)
• Translate antipattern symptoms into detection rules
8
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Antipattern detection challenges
• Difficult to define/express detection rules
– Large list of antipattern types to categorize
– Large exhaustive list of quality metrics
– Large number of possible threshold values
– Huge space to explore: An expert to manually write and validate
detection rules
9
Idea: Infer detection rules from antipattern examples
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Approach
Generation of
Web services anti-patterns
detection rules
(Genetic Programming)
Generation of
Web services anti-patterns
detection rules
(Genetic Programming)
Metric suite Web services anti-patterns detection
rules
Base of Examples (Web service anti-patterns)
category 2category 1
category 3
Anti-pattern instance
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
GP adaptation
NSTNOPT
COHNOD
[1..200]
[1..100]
Quality metrics
NCT
Solution representation
11
1 : multi-service
Base of examples
antipattern
instance
IF (NOD(s)≥21 AND COH(s)≤0.32 AND NOPT(s)≥7.8) OR (NOD(s)≥24 AND COH(s)≤0.2 AND NPT(s)≥3 AND NST(s)≥41 OR NCT(s)≥32) THEN MultiService(s)
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
GP adaptation
• Fitness function
• Crossover
– random, single point crossover operator
• Mutation
– Substitution, deletion, insertion
12
𝑓𝑖𝑡𝑛𝑒𝑠𝑠 =
𝑖=1𝑝𝑎𝑖
𝑡 + 𝑖=1𝑝𝑎𝑖
𝑝
2∈ [0,1]
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Research questions
• RQ1 (SBSE Validation): How does the proposed GP-based
approach performs compared to RS, PSO and SA?
• RQ2 (Efficiency): To which extent can the proposed
approach detect Web service antipatterns?
• RQ3 (Sensitivity): What types of Web service antipatterns
does it detect correctly?
13
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Evaluation
• Studied Web service
– Benchmark of 310 Web services
14
Category#
services
#
antipatterns
Average #
of operations
Average #
of messages
Average # of
complex types
Financial 94 67 29.52 57.31 19.01
Science 34 3 8.47 17.14 96.73
Search 37 13 8.35 18.94 26.13
Shipping 38 10 13.36 27.76 20.21
Travel 65 28 16.09 33.13 121.13
Weather 42 15 8.54 17.16 9.14
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Evaluation
• Five common types of antipatterns– multiservice, nanoservice, chatty service, data service, and ambiguous service
• 6-fold cross validation– Detect antpatterns in a category using the 5 other categories
• Detection precision and recall
15
𝑅𝑒𝑐𝑎𝑙𝑙 =𝑡𝑟𝑢𝑒 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠
𝑡𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑎𝑛𝑡𝑖𝑝𝑎𝑡𝑡𝑒𝑟𝑛𝑠
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 =𝑡𝑟𝑢𝑒 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑑𝑒𝑡𝑒𝑐𝑡𝑒𝑑 𝑎𝑛𝑡𝑖𝑝𝑎𝑡𝑡𝑒𝑟𝑛𝑠
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
RQ1: Comparison with PSO, SA, and RS
16
GP PSO SA RS
CategoryPrecision
(%)
Recall
(%)
Precision
(%)
Recall
(%)
Precision
(%)
Recall
(%)
Precision
(%)
Recall
(%)
Financial 88 85 79 78 75 75 42 45
Science 75 100 50 100 43 100 17 67
Search 85 85 79 85 63 77 26 46
Shipping 90 90 53 80 57 80 19 40
Travel 80 86 89 86 81 79 27 36
Weather 76 87 72 87 61 73 20 33
Average 85 87 76 82 70 76 30 42
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
– 31 independent runs
17
all financial science search shipping travel weather
25
50
75
100
25
50
75
100
recall
precis
ion
GP PSO RS SA GP PSO RS SA GP PSO RS SA GP PSO RS SA GP PSO RS SA GP PSO RS SA GP PSO RS SA
RQ1: Comparison with PSO, SA, and RS
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
GP
Category Precision (%) Recall (%)
Financial 88 85
Science 75 100
Search 85 85
Shipping 90 90
Travel 80 86
Weather 76 87
Average 85 87
18
RQ2: detection efficiency
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
19
Ambiguousservice Chattyservice Dataservice Multiservice Nanoservice
All
Financial
Science
Search
Shipping
Travel
Weather
0 25 50 75 1000 25 50 75 1000 25 50 75 1000 25 50 75 1000 25 50 75 100
type
precision
recall
RQ3: sensitivity towards antipattern types
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Conclusion & Future Work
• We proposed an SBSE approach to automatically detect Web
service antipatterns.– Infer detection rules from antipattern examples
– Genetic programming
• Empirical evaluation on 310 Web services from 6 categories– Promising detection results of 85% of precision and 87% of recall
• Future Works– Include other types of anti-patterns
– Extend the base of examples
– Consider dynamic Web service metrics
– Recommend refactoring solutions to fix the detected antipatterns20