10 Feb 2020 |
Research article |
Information and Communications Technologies
Automatic Decomposition of Web Service Interfaces
Purchased on Istock.com. Copyright.
A Web service interface is an essential component of a service-oriented architecture (SOA). A poorly designed Web service interface can have negative effects on all client applications using this service. One way to address the issue is to “restructure” the service interface to improve its quality. To help developers in this task, we propose a new automatic approach, called WSIRem, based on multi-objective optimization, which consists in finding the appropriate modularization of a service interface to obtain more cohesive and fewer coupled interfaces. WSIRem was evaluated on a test bench of 22 Amazon and Yahoo Web services. Results show that WSIRem outperforms existing approaches based on traditional partitioning techniques, achieving 73% accuracy and 77% recall compared to expected modulations. Keywords: Web service, SOA, Web service interface, Multi-objective optimization.
A Web service interface is the main source of user interaction in real-world software applications. Like any other software system, Web services must be frequently modified and updated to add new features in response to customer needs. Yet, these constant changes can increase the complexity of the interfaces and even take them away from their original design . This can lead to side effects, known as anti-patterns, a symptom of poor design/implementation practices, often leading to problems of comprehensibility, maintainability, as well as execution errors .
Bad practices and anti-patterns in Web service designs have been studied recently and different approaches were proposed to detect Web service interfaces impacted by poor design practices      . However, correcting these anti-patterns needs more exploration and remains a complex, manual and error prone task.
To solve this issue, we introduce a new approach to Web service interface remodularization — improving the structure of Web service interfaces — called WSIRem, using the multi-objective genetic algorithm NSGA-II .
WSIRem analyzes WSDL files, which describe Web services in a structural and semantic way to extract sequential similarity and semantic relationships between exploded operations. The extracted information is used in an optimization process based on the non-dominated genetic-sorting algorithm (NSGA-II)  to generate optimal remodularization solutions. An optimal modularization solution must provide the best compromise between the following objectives: (i) maximizing cohesion, (ii) minimizing coupling, (iii) minimizing degrees of modification.
As an output, WSIRem proposes a set of interfaces, i.e., an interface for each distinct abstraction/functionality, containing all the operations related to this abstraction/functionality.
To evaluate our approach, we conducted an empirical study on a test bed of 22 popular Amazon and Yahoo Web services. First, we evaluated the impact of our proposed modularization approach with three quality metrics: (i) cohesion, (ii) coupling, and (iii) interface modularity. We also compared WSIRem’s performance with two other recent approaches: Greedy  and SIM . Results are shown in Figures 2, 3 and 4.
Cohesion refers to the close relationship between operations in a Web service interface. The cohesion obtained by Greedy was 0.35, slightly higher than WSIRem and SIM, which were 0.33 and 0.29, respectively (Figure 2).
Coupling refers to the number of dependencies between all service interfaces.
WSIRem achieved much lower coupling results (the weaker the coupling, the better the remodularization), with an average score of -0.08 for Amazon and Yahoo, compared to a score of -0.14 and -0.26 with SIM and Greedy, respectively, as shown in Figure 3.
Service interface modularity can be defined as the degree to which service operations are linked to the same abstraction and well partitioned into cohesive interfaces.
WSIRem offered an improvement in modularity with an average of 0.12 as shown in Figure 4, while Greedy and SIM were less effective with an average of 0.04 and 0.07, respectively, for the 22 services studied.
WSIRem Accuracy and Recall
To better assess the applicability of our approach, we compared our modularization to manual modulations for accuracy and recall.
We calculated accuracy and recall as follows:
where TP (True Positive) is the number of problematic interfaces identified by the developer and by the proposed approach; FP (False Positive) is the number of problematic interfaces identified by the proposed approach, but not by the developer; FN (False Negative) is the number of problematic interfaces identified by the developer, but not by the proposed approach.
WSIRem achieved an average accuracy of 73% and an average recall of 77% compared to the expected modularizations.
In this research, we proposed a Web service interface remodularization approach, WSIRem, based on the multi-objective optimization algorithm, NSGA-II, to find the best possible compromise between cohesion, coupling, number of interfaces, and average number of operations per interface. WSIRem was then evaluated with 22 real Web services provided by Amazon and Yahoo.
Our results show that WSIRem offers remodularization solutions that are better adapted to developers’ expectations, achieving more than 73% accuracy and 77% recall.
For more information on this research, please refer to the following paper: Boukharata, S.; Ouni, A.; Kessentini, M.; Bouktif, S; Wang, H., 2019. “Improving web service interfaces modularity using multi-objective optimization.” Automated Software Engineering. Volume 26, Issue 2, pp. 275-312.
Sabrine Boukharata is a Master’s student at ÉTS. Her research focuses on software systems maintenance and restructuring.
Program : Software Engineering