On semantic detection of cloud API (anti)patterns

https://doi.org/10.1016/j.infsof.2018.10.012Get rights and content

Highlights

  • We review the OCCI standard and the literature to identify the set of OCCI and REST (Anti)Patterns.

  • We provide a semantic specification of 21 REST (anti)patterns and 24 OCCI (anti)patterns.

  • We propose a semantic-based detection of both OCCI and REST (anti)patterns in Cloud RESTful APIs.

  • We validated our approach by analyzing both OCCI and REST (anti)patterns on real Cloud REST APIs and assessing its accuracy, usefulness and extensibility.

  • We explored the applicability of OCCI and REST best principles on existing Cloud APIs.

Abstract

Context

Open standards are urgently needed for enabling software interoperability in Cloud Computing. Open Cloud Computing Interface (OCCI) provides a set of best design principles to create interoperable REST management APIs. Although OCCI is the only standard addressing the management of any kind of cloud resources, it does not support a range of best principles related to REST design. This often worsens REST API quality by decreasing their understandability and reusability.

Objective

We aim at assisting cloud developers to enhance their REST management APIs by providing a compliance evaluation of OCCI and REST best principles and a recommendation support to comply with these principles.

Method

First, we leverage patterns and anti-patterns to drive respectively the good and poor practices of OCCI and REST best principles. Then, we propose a semantic-based approach for defining and detecting REST and OCCI (anti)patterns and providing a set of correction recommendations to comply with both REST and OCCI best principles. We validated this approach by applying it on cloud REST APIs and evaluating its accuracy, usefulness and extensibility.

Results

We found that our approach accurately detects OCCI and REST(anti)patterns and provides useful recommendations. According to the compliance results, we reveal that there is no widespread adoption of OCCI principles in existing APIs. In contrast, these APIs have reached an acceptable level of maturity regarding REST principles.

Conclusion

Our approach provides an effective and extensible technique for defining and detecting OCCI and REST (anti)patterns in Cloud REST APIs. Cloud software developers can benefit from our approach and defined principles to accurately evaluate their APIs from OCCI and REST perspectives. This contributes in designing interoperable, understandable, and reusable Cloud management APIs. Thank to the compliance analysis and the recommendation support, we also contribute to improving these APIs, which make them more straightforward.

Introduction

Cloud Computing is becoming more and more attractive. Its economic pay-as-you-go model and elasticity nature are among the main assets characterizing this paradigm. Suitably, many projects have been carried out as a joint effort between industry and academia to develop open standards for the cloud with the aim of increasing its adoption. Nowadays, open standards are inevitably needed to enable interoperability among cloud services. Open Cloud Computing Interface (OCCI) is the only open standard that addresses the basic management tasks over any kinds of cloud resources, e.g., Infrastructure as a Service, Platform as a Service, and Software as a Service [1], [2]. OCCI defines a meta-model for cloud resources and a RESTful API1 for managing these resources. Among the OCCI specifications, the OCCI HTTP Protocol [3] describes a set of recommended best principles to create unified REST APIs for managing cloud resources. These best principles form a minimal set of practices to achieve interoperability and provide a uniform way to discover and manage cloud resources across various providers [3]. The poor adoption of such principles in current cloud resource management APIs negatively impacts the interoperability of cloud services.

Currently, OCCI members provide a textual description of suggested principles[3] along with a compliance test tool [4] that does not provide a detailed description about the detected principles. However, this tool can be used to show the presence of best principles but not to show the absence of one of them. Previous researches [5], [6] on best principles design for REST APIs mainly dealt with general REST APIs like Facebook and Twitter or made from the perspective of mobile applications as in [7] and networking domain like [8]. Hence, they do not perfectly fit REST APIs developed for managing cloud services or resources. Actually, in addition to REST aspects, OCCI provides principles that relate to the structure and definition of cloud resources, that is how cloud resources could be defined, created or linked to other resources. For example, to create a link between two cloud resources, the creation request should contain HTTP POST as a method along with the kind category defining the type of link (e.g., Storage Link, Network Link) as well as source and target attributes. To this end, such aspects should be considered in designing Cloud APIs to ensure sustainable interoperability and an easy discovery of cloud resources.

To address this need, in our previous work [9], we leveraged patterns and anti-patterns to drive respectively the good and poor practices of OCCI best principles. In particular, we defined compliance to OCCI best principles as OCCI patterns and non-compliance to OCCI best principles as OCCI anti-patterns. We then provided a semantic-based approach to specify these patterns and anti-patterns and to detect them automatically. Moreover, in another previous work [2], we conducted a systematic study of REST best principles on three cloud APIs including OCCI. In consequence, we showed that OCCI fails to support some of the best principles related to the REST aspects in the design of REST APIs. More specifically, OCCI only follows 56% of the best REST principles. This lack of support makes the design of Cloud REST APIs by cloud providers or developers difficult and decreases the understandability and reusability of these APIs. To alleviate this, we believe that both OCCI and REST best principles should be supported together in the design of Cloud REST APIs, which can enhance their understandability and reusability.

In the extension to our previous work [9], our ultimate objective is threefold: (i) Specifying along with OCCI (anti)patterns the REST (anti)patterns and providing their formal definitions; (ii) Assisting Cloud providers or API developers in revising their APIs by providing a set of correction recommendations to comply with both REST and OCCI best principles; And finally (iii) exploring the current application of OCCI and REST best principles on real Cloud APIs. To this end, we extend our previous work [9] (which only supports the definition of OCCI (anti)patterns and provides a set of SWRL2 rules to automate their detection), with the following additional contributions:

  • Reviewing literature with the aim of identifying the set of patterns that must be respected and anti-patterns that should be averted to conform to REST best principles;

  • Proposing semantic definitions of 21 common REST (anti) patterns for Cloud REST APIs by specifying their detection rules in terms of SWRL rules in combination with SQWRL3 queries.

  • Proposing patterns and anti-patterns detection algorithms based on SPARQL4 queries which provides an automated detection of both OCCI and REST (Anti) patterns along with a set of correction recommendations in case of any anti-pattern detection.

To validate our work, we developed a proof of concept implementation5 to support the detection of REST and OCCI (anti)patterns while providing a set of correction recommendations in case of any anti-pattern detection. Thus, we contribute in assisting developers to revise their Cloud REST APIs to be compliant with both OCCI and REST best principles. To conduct this evaluation, we rely on a validation dataset that includes five real-world Cloud RESTful APIs: OOi, COAPS, OpenNebula OCCI, Amazon S3, and Rackspace.

The remainder of this article is organized as follows. In Section 2 we give an overview on REST architectural style and OCCI. Section 3 presents the OCCI and REST patterns and anti-patterns. In Section 4, we introduce our proposed approach. Section 5 presents a validation of our approach and an interpretation of the experiment results. In Section 6, we examine related work. Finally, we conclude the article and provide insights for future work in Section 7.

Section snippets

Representational state transfer (REST)

REpresentation State Transfer (REST) was defined in the PhD thesis of Roy Thomas Fielding [10]. REST is an architectural style defining a set of rules for the design of distributed systems that assists the design and development of web applications. It is commonly used in the design of APIs for modern web services. Web services supporting properly the REST architectural style are called RESTful Web services and the application programmatic interfaces of these services are called REST APIs.

REST/OCCI (Anti)patterns

In this section, we present the REST and OCCI patterns and anti-patterns that we consider in this article. Therefore, we analyzed both the literature and the OCCI standard with the aim of identifying the set of REST and OCCI (anti)patterns. This analysis is done in context of OCCIware project8. OCCIware is a scientific research project that aimed at providing a new precise metamodel for OCCI, along with an enhanced tooling environment called OCCIware Studio.

Approach overview

After defining OCCI and REST patterns and anti-patterns, in this section, we describe our approach to detect their occurrences. The proposed approach relies on ontologies with the aim of formally specifying OCCI and REST (anti)patterns, ensuring their automatic detection and providing a set of correction recommendations in case of any anti-pattern detection. As shown in Fig. 2, the proposed approach proceeds in four steps as follows:

Step 1. Definition of OCCI/REST (Anti)Patterns: This step

Experiments and validation

In this section, we discuss the evaluation of our proposed approach. We conduct this evaluation through a proof of concept implementation and a validation study on a dataset, in which we evaluated the accuracy (i.e. recall, precision, F-measure) of the proposed approach in detecting of OCCI (anti)patterns. In this article, we intend to provide an extensive validation of the proposed approach. Firstly, we assess the compliance of Cloud REST APIs with both OCCI and REST principles. Then, we show

Related work

Over the last years, patterns and anti-patterns have been widely adopted by various researches with the aim of expressing architectural solutions and concerns in Service Oriented Architectures (SOAs), Object Oriented Systems and lately in RESTful APIs. Suitably, various techniques have followed to specify and detect these patterns, including genetic programming [27], [28], domain specific language (DSL) [24], [29], [30], temporal logic [31], Bayesian networks [32] , Natural language processing

Conclusion

The growth of the cloud computing has motivated many projects to develop open standards for facilitating and increasing its adoption. Open Cloud Computing Interface (OCCI) is the only open standard that provides a set of good design principles to develop and design interoperable Cloud Restful APIs for any kind of management tasks over cloud resources. However, it failed to support a range of good principles related to REST aspects decreasing the understandability and reusability of these APIs

Acknowledgment

This work is partially supported by OCCIware research and development project (www.occiware.org) funded by French Programme d’Investissements d’Avenir (PIA).

References (40)

  • R. Fourati, N. Bouassida, H.B. Abdallah, A Metric-Based Approach for Anti-pattern Detection in UML Designs, Springer...
  • A. Edmonds et al.

    Toward an open cloud standard

    IEEE Internet Comput.

    (2012)
  • F. Petrillo et al.

    Are REST APIs for cloud computing well-designed? An exploratory study

    Proceedings of 14th International Conference on Service-Oriented Computing, ICSOC’16

    (2016)
  • R. Nyrén et al.

    Open Cloud Computing Interface – HTTP Protocol

    Recommandation GFD-R-P.223

    (2016)
  • OCCI Compliance Testing Tool, 2011....
  • F. Palma et al.

    Detection of REST patterns and antipatterns: a heuristics-based approach

    Proceedings of 12th International Conference on Service-Oriented Computing, ICSOC’14

    (2014)
  • F. Palma et al.

    Are RESTful APIs well-designed? Detection of their linguistic (Anti)patterns

    Proceedings of 13th International Conference on Service-Oriented Computing, ICSOC’15

    (2015)
  • C. Rodríguez et al.

    REST APIs: a large-scale analysis of compliance with principles and best practices

    Proceedings of 16th International Conference on Web Engineering (ICWE2016), Lugano

    (2016)
  • W. Zhou et al.

    REST API design patterns for SDN northbound API

    2014 28th International Conference on Advanced Information Networking and Applications Workshops

    (2014)
  • H. Brabra et al.

    Detecting cloud (Anti)patterns: OCCI perspective

    Proceedings of 14th International Conference on Service-Oriented Computing, ICSOC’16

    (2016)
  • R.T. Fielding

    Architectural Styles and the Design of Network-based Software Architectures

    (2000)
  • A. Edmonds et al.

    Toward an open cloud standard

    IEEE Internet Comput.

    (2012)
  • P. Merle et al.

    Mobile cloud robotics as a service with OCCIware

    Proceedings of the 2nd IEEE International Congress on Internet of Things, IEEE ICIOT 2017, Honolulu, Hawaii, United States

    (2017)
  • R. Nyrén et al.

    Open Cloud Computing Interface – Core

    Recommendation GFD-R-P.221

    (2016)
  • P. Merle et al.

    A precise metamodel for open cloud computing interface

    Proceedings of 2015 IEEE 8th International Conference on Cloud Computing, CLOUD’15

    (2015)
  • A. Edmonds et al.

    Open Cloud Computing Interface – Text Rendering

    Recommandation GFD-R-P.229

    (2016)
  • T. Metsch et al.

    Open Cloud Computing Interface – Infrastructure

    Recommandation GFD-R-P.224

    (2016)
  • M. Drescher et al.

    OCCI Compute Resource Templates Profile

    Recommandation GFD-R-P.222

    (2016)
  • T. Metsch et al.

    Open Cloud Computing Interface – Platform

    Recommandation GFD-R-P.227

    (2016)
  • G. Katsaros

    Open Cloud Computing Interface – Service Level Agreements

    Recommandation GFD-R-P.228

    (2016)
  • Cited by (21)

    • Assessing the linguistic quality of REST APIs for IoT applications

      2022, Journal of Systems and Software
      Citation Excerpt :

      In previous works, we also performed studies (Palma et al., 2015, 2017) that focused on the ‘RESTful’ aspect of Web APIs, for example, to see if the APIs follow basic REST design principles including (i) statelessness, (ii) cacheability, and (iii) interface uniformity. In similar lines of research, working with OCCI patterns and antipatterns, Brabra et al. (2016, 2019) defined a set of patterns and antipatterns, inspired by the OCCI guidelines.13 They performed an automatic detection of 28 OCCI REST patterns and antipatterns in Cloud APIs by invoking more than 300 operations.

    • Usability Heuristics and Guidelines for RESTful APIs and Application to the Twitter API

      2023, 2023 Research in Adaptive and Convergent Systems RACS 2023
    • Usability Heuristics and Guidelines for RESTful APIs and Application to a Case Study

      2023, Proceedings of the ACM Symposium on Applied Computing
    View all citing articles on Scopus
    View full text