1 / 36

09 November 2012

09 November 2012. Dongmei Liu, Hong Zhu and Ian Bayley. Applying Algebraic Specification To Cloud Computing. Outline. Motivation and Related works Our Algebraic Specification Language Case Study of IaaS GoGrid Discussion Conclusion and Future work. Motivation. Encourage rigour

addo
Télécharger la présentation

09 November 2012

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 09 November 2012 Dongmei Liu, Hong Zhu and Ian Bayley Applying Algebraic Specification To Cloud Computing

  2. Outline • Motivation and Related works • Our Algebraic Specification Language • Case Study of IaaSGoGrid • Discussion • Conclusion and Future work

  3. Motivation Encourage rigour Well-founded mathematical basis. Well-defined semantics Automating analysis • Formal Specification • Merits • Limitation • Classification of approaches • Algebraic Specification • Heterogeneous algebras • Signature • Axioms Difficult to learn and use Limited scope Limited scalability Property-Oriented Model-Oriented axiomatic algebraic

  4. Motivation REST: From Research to Practice (2011, Erik Wilde) • RESTful Web Services • Identification of resources (URIs) • Manipulation of resources through representations • HTTP methods • Stateless • Cloud Computing • Open API • OCCI (Open Cloud Computing Interface) http://stage.vambenepe.com/archives/863 The OCCI Core specification The OCCI Rendering specifications The OCCI Extension specifications

  5. Related Works • Description of RESTful WS • Formats for annotating the syntax and semantics • Graphic notation(UML state machine diagram) • Algebraic Specification • Algebras • Co-algebras • Extend algebraic and co-algebraic • Algebraic testing WADL hRESTS/Micro WSMO SA-REST O. Liskin,etc. Welcome to the Real World: A Notation for Modeling REST Services, IEEE Internet Computing, 2012

  6. CASOCC-WS • Overall structure • Sorts, operators and/or axioms that logically belong together are grouped into a unit. <Specification> ::= {<Spec Unit>} <Spec Unit> ::= Spec <Sort Name> [<Observability>]; <Signature> [<Axioms>] End • <Sort Name> ::= <Identifier> <Observability> ::= is observable by <Operator ID> | is unobservable <Operator ID> ::= <Identifier>

  7. CASOCC-WS • Example Spec BOOL is observable by eqv; Operators: Creator: true: VOID -> BOOL; false: VOID -> BOOL; Transformer: and: BOOL, BOOL -> BOOL; or: Bool, BOOL -> BOOL; eqv: BOOL, BOOL -> BOOL; not: BOOL -> BOOL; Axioms: For b: BOOL that b and true == b; b or false == b; b and b == b; b or b == b; ... End … End

  8. CASOCC-WS • Signature • specify the syntactic aspect of the software entity • defines a set of typed operations • reuse • <Signature> ::= [<Imported Sorts>;] <Operations> • <Imported Sorts> ::= Sort <Imported Sort List> • <Imported Sort List> ::= <Sort Name>[, <Imported Sort List>] • <Operations> ::= Operators: • [<Creators>;][<Transformers>;][<Observers>;][<Definers>;] • <Creators> ::= Creator: <OpList> • <Transformers> ::= Transformer: <OpList> • <Observers> ::= Observer: <OpList> • <Definers> ::= Definer: <OpList> • <OpList> ::= <Operation> [; <OpList>]

  9. CASOCC-WS • Operator • Function: identifier, domain and co-domain types • have more than one domain sort and more than one co-domain sort at the same time • Spec STACK; • Sort BOOL, NAT; • Operators: • Creator: • newStack: -> STACK; • Transformer: • push: STACK, NAT -> STACK; • pop: STACK -> STACK; • Observer: • isNewStack: STACK -> BOOL; • top: STACK -> NAT; • End • Spec STREAM is unobservable; • Sort NAT; • Operators: • Transformer: • next: STREAM -> STREAM, NAT; • End

  10. CASOCC-WS • Operator • Function: identifier, domain and co-domain types • have more than one domain sort and more than one co-domain sort at the same time • <Operation> ::= <Operator ID> :['['<Context Sort>']'] • [<Domain Type>] -> <Co-domain Type> • <Context Sort> ::= <Sort Name> • <Domain Type> ::= <Type> | VOID • <Co-domain Type> ::= <Type> | VOID • <Type> ::= <Sort Name> [, <Type>]

  11. CASOCC-WS • Axioms • specify the semantics of the operators • describing the properties that operators are required to satisfy • consists of a variable declarations block and a list of conditional equations. • <Axioms> ::= Axiom: <Axiom List> • <Axiom List> ::= <Axiom> [<Axiom List>] • <Axiom> ::= <Var Declarations> <Equations> End • <Var Declarations> ::= • For all <Var-Sort Pairs> that • <Var-Sort Pairs> ::= • <Var IDs> : <Sort Name> [, <Var-Sort Pairs>] • <Var IDs> ::= <Var ID> [, <Var IDs>] • <Var ID> ::= <Identifier>

  12. CASOCC-WS For all SLR: ServerListRequest that SLR.num_items>=0; SLR.page>=0, if SLR.num_items> 0; End • Equation • conditional equation • local variable and Let… in For all s: STACK, n: NAT that isNewStack(push(s,n))== False; pop(push(s, n))== s; top(push(s, n))== n; End For all s: STACK, n: NAT that Let s1 = push(s,n) in isNewStack(s1) == False; pop(s1) == s; top(s1) == n; End End

  13. CASOCC-WS • Equation • conditional equation • local variable and Let… in • <Equation> ::= [<Label>:] <Condition> [, if <Conditions>]; • | Let <Var Definitions> in <Equations> End • <Conditions> ::= <Condition> [(,|or) <Conditions>] • <Condition> ::= <Bool Term> | <Term> <Relation OP> <Term> • | "(" <Condition> ")" | "~" <Condition> • <Bool Term> ::= True | False | <Term> • <Relation OP> ::= "==" | "<>" | ">" | "<" | ">=" | "<=" | "IS“ • <Term> ::= <Var ID> | "(" <Term> ")“ | "<" <Term List> ">" • | <Operator ID> ["(" [<Parameters>] ")"] | "[" <Term> "]" • | <Term> "." <Term> | <Term> "#" <Term> • | <numeric_expression> | <string_expression> • | <literal_expression> | NULL

  14. CASOCC-WS • Modular • software entity: abstract data type, class, component, WS • Algebraic and co-algebraic Op: [s] s1, … , sn s'1, … , s'k • Kinds of operators • Creator • Transformer • Observer • Conditional equations • Relation Operation • Let … in …

  15. Case Study: GoGird • GoGrid • world's largest pure-play Infrastructure-as-a-Service provider specializing in Cloud infrastructure solutions • API • a REST-like query interface

  16. Case Study: GoGrid • Overall Structure of the Specification • First, for each object, specifying the requests and responses of the operations, defining their structures and the constraints on the values of the elements. • Then, specify the semantics of the operators on the type of objects by defining the relationships between the requests and the responses.

  17. Case Study: GoGrid Spec Server; Sort Option, IP, ServerImage; Operators: Observer: id: Server -> long; name: Server -> string; description: Server -> string; ip: Server -> IP; image: Server -> ServerImage; ram: Server -> Option; state: Server -> Option; type: Server -> Option; os: Server -> Option; isSandbox: Server -> boolean; datacenter: Server -> Option; Axiom: For all SO: Server that SO.id <> null; End End • The Specification of Server • Objects and Collections • Requests and Responses • Semantics of the Operations Spec ListofServer; Sort Server; Operators: Observer: items: ListofServer,int -> Server; length: ListofServer -> int; End

  18. Case Study: GoGrid • The Specification of Server • Objects and Collections • Requests and Responses • Semantics of the Operations Spec CommonParameter; Operators: Observer: api_key: CommonParameter -> string; sig: CommonParameter -> string; v: CommonParameter -> string; format: CommonParameter -> string; Axiom: For all CP: CommonParameter that CP.api_key<> NULL; CP.sig<> NULL; CP.v<> NULL; End End

  19. Case Study: GoGrid • The Specification of Server • Objects and Collections • Requests and Responses • Semantics of the Operations Spec ServerListRequest; Sort CommonParameter, ListofString; Operators: Observer: para: ServerListRequest -> CommonParameter; num_items: ServerListRequest -> int; page: ServerListRequest -> int; server_type: ServerListRequest -> string; isSandbox: ServerListRequest -> boolean; datacenter: ServerListRequest -> ListofString; timestamp: ServerListRequest -> int; Axiom: For all SLR: ServerListRequest that SLR.num_items>=0; SLR.page>=0, if SLR.num_items > 0; End End

  20. Case Study: GoGrid • The Specification of Server • Objects and Collections • Requests and Responses • Semantics of the Operations Spec ListResSummary; Operators: Observer: total: ListResSummary -> int; start: ListResSummary -> int; returned: ListResSummary -> int; numpages: ListResSummary -> int; Axiom: For all LRS: ListResSummary that LRS.total>= 0; LRS.start >= 0; LRS.returned >= 0; LRS.numpages>= 0; End End

  21. Case Study: GoGrid • The Specification of Server • Objects and Collections • Requests and Responses • Semantics of the Operations Spec ServerListResponse; Sort ListResSummary, ListofServer, ListofString; Operators: Observer: status: ServerListResponse -> string; request_method: ServerListResponse -> string; summary: ServerListResponse -> ListResSummary; objects: ServerListResponse -> ListofServer; statusCode: ServerListResponse -> int; Axiom: For all SLR: ServerListResponse that SLR.request_method== "/grid/server/list"; End For all SLR:ServerListResponse, i,j:int that SLR.objects.items(i).id <> SLR.objects.items(j).id, if status == "success", i <> j, 0 <= i, i <= SLR.summary.returned, 0 <= j, j <= SLR.summary.returned; End ... End

  22. Case Study: GoGrid • The Specification of Server • Objects and Collections • Requests and Responses • Semantics of the Operations Spec ServerGrid; Sort CommonParameter, Server, ListofServer, … ListofString, ServerListRequest, ListResSummary, ServerListResponse, …; Operators: Observer: clockTime: ServerGrid -> int; sharedSecret: ServerGrid, string -> string; List: [ServerGrid] ServerListRequest-> ServerListResponse; Get: [ServerGrid] ServerGetRequest-> ServerGetResponse; Transformer: Add: [ServerGrid] ServerAddRequest-> ServerAddResponse; Delete: [ServerGrid] ServerDeleteRequest-> ServerDeleteResponse; Edit: [ServerGrid] ServerEditRequest-> ServerEditResponse; Power: [ServerGrid] ServerPowerRequest -> ServerPowerResponse; End

  23. Case Study: GoGrid • The Specification of Server • Objects and Collections • Requests and Responses • Semantics of the Operations Axiom <Authentication>: For all G:ServerGrid, X:ServerListRequest that Let key = X.para.api_key, sig_Re= MD5(key, G.sharedSecret(key), X.timeStamp) in G.List(X).statusCode == 403, If X.para.sig <> sig_Re or abs(X.timeStamp - G.clockTime) > 600; End End

  24. Case Study: GoGrid • The Specification of Server • Objects and Collections • Requests and Responses • Semantics of the Operations Axiom <List-XOp>: For all G: ServerGrid, X: ServerListRequest, X1: ServerXOpRequest that [G.List(X)].XOp(X1) == G.XOp(X1); End

  25. Case Study: GoGrid • The Specification of Server • Objects and Collections • Requests and Responses • Semantics of the Operations Axiom <Add-List>: For all G: ServerGrid, X1: ServerAddRequest, X2: ServerListRequest that [G.Add(X1)].List(X2).objects == insert(G.List(X2).objects, G.Add(X1).objects), If X2.num_items == 0, X2.server_type == NULL, X2.isSandbox == NULL, X2.datacenter == NULL, G.Add(X1).statusCode == 200, G.List(X2).statusCode == 200; End

  26. Case Study: GoGrid • Results

  27. Parser Tool • JavaCC(Compiler Compiler) • parser generator for use with Java applications • a tool that reads a grammar specification and converts it to a Java program that can recognize matches to the grammar. • generates top-down parsers, which limits it to the LL(k) <numeric_expression> ::= <Term> <Arithmetic OP> <Term> <numeric_expression> ::= <numeric_p> [ (*|/) <numeric_p> ] <numeric_p> ::= <numeric_v> [ (+|-) <numeric_v> ] <numeric_v>] ::= <integer_literal> | <float_literal> | ( <Term> )

  28. Parser Tool • JavaCC(Compiler Compiler)

  29. Parser Tool • JavaCC(Compiler Compiler)

  30. Parser Tool • JavaCC(Compiler Compiler)

  31. Parser Tool • JavaCC(Compiler Compiler)

  32. Parser Tool • GUI

  33. Discussion • Improving Document Preciseness • Detecting Incompleteness • Checking Consistency • Reducing Redundancy • Understandability of Document

  34. Conclusion • apply the CASOCC-WS specification language to cloud computing interface with a case study on GoGrid System • demonstrate that CASOCC-WS can be used for RESTful WS • detect non-trivial errors including ambiguity, inconsistency and incompleteness • demonstrate that algebraic specifications can be easy to understand

  35. Further work • More case study for cloud computing, OCCI • Extend the algebraic specification language • Combine Ontology to describe RESTful WS • Develop a tool to support automated testing of a cloud computing interface

  36. Thanks Questions?

More Related