Design And Implementation Of Web Service Testing Framework Mit Template


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Design And Implementation Of Web Service Testing Framework Mit Template

  1. 1. A.RESWIN RODRIQUEZ Reg No. 070927009 M.Tech. Network Engineering Dept of Information & Communication Technology Manipal Institute of Technology . DESIGN AND IMPLEMENTATION OF WEB SERVICE TESTING FRAMEWORK Under the Guidance of Balachandra Sujit Kumar Chakrabarti, Senior Lecturer, Senior Scientist, Manipal Institute of Technology, Philips Electronics India Ltd, Manipal. Bangalore.
  2. 2. What is a web service? <ul><li>Web services are software's that are designed to provide interoperable machine to machine communication over a network. </li></ul><ul><li>Web services are also called programmable web. </li></ul><ul><li>The web service client parses the response xml and extracts the necessary information from it, as xml are well structured. </li></ul><ul><li>A machine doesn’t care about layout and styling. Machines basically just need the data. </li></ul>
  3. 3. Web Service contd. <ul><li>When a machine or web service client makes GET on a resource, it will ask for the machine readable one. </li></ul><ul><li>When a browser makes GET on a resource for a human, it will ask for the human readable one. </li></ul><ul><li>Eg:A part of the response from a web service to find the details of a book would look like </li></ul><ul><li><productname>RESTful Web service</productname> </li></ul><ul><li><catalog>Book</catalog> </li></ul><ul><li><author>Lenard and Sam</author> </li></ul><ul><li><releasedate>01,may2007<releasedate> </li></ul><ul><li>Normal applications are not distributed, but web services are distributed. </li></ul>
  4. 4. RESTful Web services <ul><li>REST stands for Representational State Transfer. </li></ul><ul><li>Its is an architectural style of implementing web service. </li></ul><ul><li>In REST all the resources are uniquely identified by a URI. </li></ul><ul><li>It has uniform form Interface (CRUD operation). </li></ul><ul><li>CRUD – CREATE,READ,UPDATE,DELETE. </li></ul><ul><li>In RESTful service the interactions are stateless. </li></ul><ul><li>For example the services expose by the RESTful web service are described in a machine process able language called WADL (Web Application Description Language). </li></ul>
  5. 5. RESTful Web services Example <ul><li>A RESTful web service is a simple web service implemented using HTTP and with the principles of REST. </li></ul><ul><li>It is a collection of Resources. </li></ul><ul><li>For example if a RESTful web service presenting a collection of cars for sale might have the URI as “ ”. </li></ul><ul><li>If the service uses the car registration number as the ID then a particular car might be present in the collection as “ ”. </li></ul>
  6. 6. WADL <ul><li>WADL stands for Web Application Description Language. </li></ul><ul><li>WADL is a Resource centric description language. </li></ul><ul><li>It is a well formed XML file. </li></ul><ul><li>WADL provides a machine process-able description of the services exposed by the web service. </li></ul>
  7. 7. WADL Example <ul><li><?xml version=&quot;1.0&quot;?> </li></ul><ul><li><!-- This is a Example of a WADL . --> </li></ul><ul><li><application xmlns:xsd=&quot;; </li></ul><ul><li>xmlns:html=&quot;;> </li></ul><ul><li><resources base=&quot;;> </li></ul><ul><li> <resource path=&quot;Search&quot;> </li></ul><ul><li><method href =&quot;#end&quot;/> </li></ul><ul><li></resource> </li></ul><ul><li></resources > </li></ul><ul><li><!-- Methods--> </li></ul><ul><li><method name=&quot;GET&quot; id=&quot;end&quot;> </li></ul><ul><li><request> </li></ul><ul><li><query_variable name=&quot;id&quot; type=&quot;xsd:int&quot; required=&quot;true&quot;/> </li></ul><ul><li></request > </li></ul><ul><li><response> </li></ul><ul><li><representation mediaType=&quot;application/xml&quot; element=&quot;result&quot;/> </li></ul><ul><li><fault id=&quot;SearchError&quot; status=&quot;400&quot; mediaType=&quot;application/xml&quot; element=&quot;error&quot;/> </li></ul><ul><li></response> </li></ul><ul><li></method> </li></ul><ul><li></application> </li></ul>
  8. 8. Connectedness <ul><li>Connectedness means the ability to navigate from one resource to the other by following the links. The links are the URI of the resource that connect one resource to the other . </li></ul><ul><li>Placement of the URI should be intuitive. </li></ul>
  9. 9. Connectedness Example <ul><li>Suppose R1,R2,R3 are resources. </li></ul><ul><li>R1,R2,R3 have unique URI representing a resource. </li></ul><ul><li>If R1,R2,R3 are reachable following the URI from the base resource R, then web service is connected. </li></ul>
  10. 10. Connectedness-Testing <ul><li>R1,R2,R3,R4 are resources. </li></ul><ul><li>A graph with URI of the resources as Nodes and connectivity between the resources as their Edges. </li></ul>R R1 R2 R3 R4
  11. 11. Connectedness-Testing <ul><li>A reference list is a collection of all URI present on a web service. </li></ul><ul><li>Check if all the URI’s present in the reference list are present in the graph. </li></ul>
  12. 12. Problem of Reference List Generation <ul><li>Reference List is generated from the WADL. </li></ul><ul><li>WADL document does not contain the sufficient information. </li></ul><ul><ul><li>Whether a resource already exist or not. </li></ul></ul><ul><ul><li>i.e. are the resources already posted? </li></ul></ul>
  13. 13. Insufficient Information in WADL <ul><li>WADL specification does not contains the necessary information to test the connectedness of the RESTful web service. </li></ul><ul><li>Information about already posted resources are not present in the WADL specification. </li></ul><ul><li>Certain changes have to be incorporated into WADl Document. </li></ul>
  14. 14. Enhancement to WADL <ul><li>List of proposed changes to WADL. </li></ul><ul><ul><li>‘target’ element is added under ‘method’ element. </li></ul></ul><ul><ul><li>The ‘ target ’ element has an attributes called ‘ id ’. </li></ul></ul><ul><ul><ul><li><target id = “#user” /> </li></ul></ul></ul><ul><ul><ul><li><target id =”#article” /> </li></ul></ul></ul>
  15. 15. Enhancement Contd.. <ul><ul><li>‘resource’ element adds an attribute called ‘id’ which corresponds to the ‘id’ attribute of ‘target’ element. </li></ul></ul><ul><ul><ul><li><resource path = “eblog/{x}” id = “#user> </li></ul></ul></ul>
  16. 16. Example :eblog WADL <ul><li><?xml version=&quot;1.0&quot;?> </li></ul><ul><li><application xmlns:xsd=&quot;; </li></ul><ul><li>xmlns:html=&quot;;> </li></ul><ul><li><resources base=&quot;http://localhost:8282/&quot;> </li></ul><ul><li><resource path=&quot;eblog&quot; id = &quot;#blog&quot;> </li></ul><ul><li><method href =&quot;#Postblog&quot;/> </li></ul><ul><li></resource> </li></ul><ul><li><resource path=&quot;eblog/{x}&quot; id = &quot;#user&quot;> </li></ul><ul><li><method href =&quot;#Postarticle&quot;/> </li></ul><ul><li></resource> </li></ul><ul><li><resource path=&quot;eblog/{x}/{y}&quot; id = &quot;#article&quot;> </li></ul><ul><li></resource> </li></ul><ul><li></resources > </li></ul><ul><li><!-- Methods--> </li></ul><ul><li><method name=&quot;POST&quot; id=&quot;Postblog&quot;> </li></ul><ul><li><request> </li></ul><ul><li><query_variable name=&quot;user&quot; type=&quot;xsd:string&quot; value =&quot;{x}&quot; required=&quot;true&quot;/> </li></ul><ul><li><target id =&quot;#user&quot;/> </li></ul><ul><li></request> </li></ul><ul><li><response> </li></ul><ul><li> <representation mediaType=&quot;application/xml&quot; element=&quot;result&quot;/> </li></ul><ul><li><fault id=&quot;SearchError&quot; status=&quot;400&quot; mediaType=&quot;application/xml&quot; element=&quot;error&quot;/> </li></ul><ul><li></response> </li></ul><ul><li></method> </li></ul><ul><li><method name=&quot;POST&quot; id=&quot;Postarticle&quot;> </li></ul><ul><li><request> </li></ul><ul><li><target id =&quot;#article&quot;/> </li></ul><ul><li></request> </li></ul><ul><li><response> </li></ul><ul><li><header> </li></ul><ul><li><field name = &quot;location&quot; value = &quot;{x}/{y}&quot;/> </li></ul><ul><li></header> </li></ul><ul><li><representation mediaType=&quot;application/xml&quot; element=&quot;result&quot;/> </li></ul><ul><li><fault id=&quot;SearchError&quot; status=&quot;400&quot; mediaType=&quot;application/xml&quot; element=&quot;error&quot;/> </li></ul><ul><li></response> </li></ul><ul><li></method> </li></ul><ul><li></application> </li></ul>
  17. 17. Implementation Approach Start wadl  WADL Document Result  Analyze WADL (wadl) If (Result = pass) RefList  GenerateRefernceList(wadl) Result  TestConnectivity (wadl, RefList) Output Result Stop Yes No Abort
  18. 18. WADL Analyzer <ul><li>A WADL analyzer is a program that verifies if it contains the Proposed changes. </li></ul><ul><li>Only if the output of the WADL analyzer is “pass” then the WADL document will be the input of the Reference List Generator. </li></ul>
  19. 19. Automatic Reference List Generator <ul><li>The Reference List Generator would make POST operations depending upon the WADL specification. </li></ul><ul><li>Collect the URI of the resource from the post response or from query string of the resource. </li></ul>Augmented WADl Reference List Auto Reference List Generator
  20. 20. URI Navigator <ul><li>The output of the Reference List Generator is given as the input to the URI navigator (i.e. a list of URI). </li></ul><ul><li>The URI Navigator is a program that performs GET operations starting from the base URI and then forms a list of URI’s Navigated. </li></ul><ul><li>Navigated URI List is compared with the Reference list to check if the URI’s are reachable. </li></ul>
  21. 21. THANK YOU