Download presentation
Presentation is loading. Please wait.
Published byAri Point Modified over 10 years ago
1
Dongmei Liu, Hong Zhu and Ian Bayley 09 November 2012 Applying Algebraic Specification To Cloud Computing
2
Outline Motivation and Related works Our Algebraic Specification Language Case Study of IaaS GoGrid Discussion Conclusion and Future work
3
Motivation Formal Specification Merits Limitation Classification of approaches Algebraic Specification Heterogeneous algebras Signature Axioms Property-Oriented Model-Oriented axiomatic algebraic Encourage rigour Well-founded mathematical basis. Well-defined semantics Automating analysis Difficult to learn and use Limited scope Limited scalability
4
Motivation RESTful Web Services Identification of resources (URIs) Manipulation of resources through representations HTTP methods Stateless Cloud Computing Open API OCCI (Open Cloud Computing Interface) REST: From Research to Practice (2011, Erik Wilde) http://stage.vambenepe.com/arc hives/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 Spec ification 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. ::= { } ::= Spec [ ]; [ ] End ::= { } ::= Spec [ ]; [ ] End ::= is observable by | is unobservable ::= is observable by | is unobservable ::=
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 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 ::= [ ;] ::= Sort ::= [, ] ::= Operators: [ ;][ ;][ ;][ ;] ::= Creator: ::= Transformer: ::= Observer: ::= Definer: ::= [; ] ::= Sort ::= [, ] ::= Operators: [ ;][ ;][ ;][ ;] ::= Creator: ::= Transformer: ::= Observer: ::= Definer: ::= [; ]
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 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 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 ::= :['[' ']'] [ ] -> ::= ::= | VOID ::= [, ] ::= :['[' ']'] [ ] -> ::= ::= | VOID ::= [, ]
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. ::= Axiom: ::= [ ] ::= End ::= For all that ::= : [, ] ::= [, ] ::= ::= Axiom: ::= [ ] ::= End ::= For all that ::= : [, ] ::= [, ] ::=
12
CASOCC-WS Equation conditional equation local variable and Let… in For all s: STACK, n: NAT that Let s1 = push(s,n) in isNewStack(s1) == False; pop(s1) == s; top(s1) == n; End For all SLR: ServerListRequest that SLR.num_items>=0; SLR.page>=0, if SLR.num_items> 0; End For all s: STACK, n: NAT that isNewStack(push(s,n))== False; pop(push(s, n))== s; top(push(s, n))== n; End
13
CASOCC-WS Equation conditional equation local variable and Let… in ::= [ :] [, if ]; | Let in End ::= [(,|or) ] ::= | | "(" ")" | "~" ::= True | False | ::= "==" | "<>" | ">" | " =" | "<=" | "IS“ ::= | "(" ")“ | " ">" | ["(" [ ] ")"] | "[" "]" | "." | "#" | | | | NULL ::= [ :] [, if ]; | Let in End ::= [(,|or) ] ::= | | "(" ")" | "~" ::= True | False | ::= "==" | "<>" | ">" | " =" | "<=" | "IS“ ::= | "(" ")“ | " ">" | ["(" [ ] ")"] | "[" "]" | "." | "#" | | | | NULL
14
CASOCC-WS
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 ObjectListGetAddDeleteEditOther Ops ServerYes Power Server imageYes Save, Restore Load BalancerYes JobYes IPYes PasswordYes Billing Yes OptionYes
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 The Specification of Server Objects and Collections Requests and Responses Semantics of the Operations 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 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
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
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
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 : 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
24
Case Study: GoGrid The Specification of Server Objects and Collections Requests and Responses Semantics of the Operations Axiom : 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 : 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) ::= ::= [ (*|/) ] ::= [ (+|-) ] ] ::= | | ( )
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?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.