SOA Testing
-
Upload
roopesh-kohad -
Category
Technology
-
view
428 -
download
2
description
Transcript of SOA Testing
SOA Testing
Roopesh Kohad
Shirish Kawatkar
Roopesh Kohad• QA Manager/Test Architect with Synerzip• 13+ years of experience working in Product
development teams leading the Test Engineering efforts
• Email: [email protected]• LinkedIn:
http://in.linkedin.com/in/roopeshkohad
Shirish Kawatkar• QA Lead with Synerzip• 9+ years of experience in software testing in
Microsoft & Open technologies• Email: [email protected]• LinkedIn:
http://in.linkedin.com/in/shirishkawatkar
Agenda• SOA
– Introduction– Web Services– Testing Aspects
• SOAP web services– Introduction– Testing
• RESTful web services– Introduction– Testing
• SoapUI– Features– Demo
Agenda Contd…• Automation
– Custom clients in Open & Microsoft Technologies
– To automate – Issue Tracking System, TCM, CI etc.
• Demos– Create a test case using SoapUI & Integration
test– Create a test case using WCFClient– Write a simple client in C# using Visual Studio– Write a simple client in Java using Eclipse
What is SOA?• Service Oriented Architecture (SOA) is a
software design pattern or philosophy• Distinct and loosely coupled software pieces
(called services) encapsulating business logic providing application functionality
• Client (Service Requester) Server (Service Provider) model
• Independent of any vendor, product or technology
• Reference - http://en.wikipedia.org/wiki/Service-oriented_architecture
SOA Elements
SOA Principles• Loose coupling• Contract• Abstraction• Autonomy• Reusability• Statelessness• Discoverability• Composability• Etc..
What is a Service?• Services are unassociated, loosely coupled
units of functionality that are– self-contained– Self-describing
• Well defined interface/contract using standard protocols
• Independent of any technology or vendor
What is a Web service?• Service which communicates over the
internet or www• Has API with web methods / operations• Uses web standards like,
– XML/JSON for defining • Interface/Contract • Message architecture & format
– HTTP(s) protocol for communication
SOA Examples• Examples,
– Websites like Portals or Mashups– Payment Gateways– Mobile application clients
• Composed of,– in-house (different department)– third-party (different vendor) – public services (government etc.)
SOA Testing Challenges• No User Interface• Heterogeneous
– Variety of service types, implementation & technologies
• Third-party service so no control• Isolation of defects
– Whose responsibility? Provider? Requester? Both?• How do you know vendor has tested the service
thoroughly?• If we are a provider, how do we show that it is
worthy of acceptance?
SOA Testing Aspects• Everything has to be tested
– End-to-End– Service-by-Service– Interface-by-Interface– Process orchestration
• End-to-End– User-Interface testing
• Service Testing– Functional
• Contract/API
– Non-functional• Security• Performance
SOA Testing Aspects• Practices & Techniques
– Continuous Integration & Deployment– Service virtualization / Mocking
• Test Management– Framework– Regression– Reporting
Web Service Types• SOAP / WSDL
– Simple Object Access Protocol– Web Services Description Language
• REST / WADL– Representational State Transfer– Web Application Description Language
• Others– XML/JSON-RPC
SOAP• Simple Object Access Protocol• Interface Endpoint(s), Operation(s)• Message format XML• Transport HTTP or others• WSDL – Web Services Description
Language– Machine readable– Automatic code generation (Proxy)
SOAP Example• IP2Geo
– Service• http://ws.cdyne.com/ip2geo/ip2geo.asmx
– Request-Response• http://ws.cdyne.com/ip2geo/ip2geo.asmx? op=
ResolveIP
– WSDL• http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl
SOAP Testing• Testing a SOAP API means manipulating a
request XML and interpreting a response XML
SOAP Testing Tools• IDE Tools
– Eclipse Web Service Explorer– WCFTestClient from Visual Studio
• Web-based– http://wsdlbrowser.com– http://www.soapclient.com/soaptest.html
• Browser Apps– Firefox - SOAPClient– Chrome – wizdler
SOAP Testing Tools• Custom
– Eclipse/Java – Web service client / soap-ws, Junit
– VS/.NET – Service/Web Reference, Nunit– Perl – SOAP:Lite, PerlUnit– Language – {SOAP Library / Proxy code},
{xUnit}• Specialized
– SoapUI (http://www.soapui.org)– SoaTest (http://www.parasoft.com/soatest)
Q&A?
REST• Representational State Transfer• Architectural style• It is NOT a protocol like SOAP. Protocol is HTTP.• HTTP operations
– GET, POST, PUT, DELETE, TRACE, HEAD, OPTIONS• Endpoint Resource• Operations on resource
– Create POST– Retrieve GET– Update PUT– Delete DELETE
REST constraints• Use HTTP methods explicitly• Be stateless or Idempotent• Expose directory structure-like URIs• Transfer XML, JavaScript Object Notation
(JSON), or both• Etc.
REST API Examples• Twitter: https://dev.twitter.com/rest/public• Flickr: http://www.flickr.com/services/api• Google -
https://developers.google.com/maps/documentation/timezone/– Example – Current Time Zone
• Amazon S3 - http://docs.aws.amazon.com/AmazonS3/latest/API/APIRest.html
• http://www.thomas-bayer.com/sqlrest/
REST API• Endpoint – Root of API• List of Resources in a hierarchical manner
– /api/customers/– /api/customers/1– /api/customers/1/zipcode
• For each resource– List of HTTP methods: GET, POST, PUT, DELETE– For each method
• List of Headers• Request JSON/XML for POST/PUT• Response JSON/XML
REST Misc• Sample WADL• REST APIs are generally not open and
require some kind of authentication– Basic HTTP authentication– API Key (linked to an account, eg. Google)– OAuth
• Further– XML/JSON processing for verification– Regular expressions
REST Testing• Testing a REST API means manipulating the
request URI and interpreting the answer
REST Testing Tools• Desktop tools
– https://github.com/wiztools/rest-client• Command Line tools
– cURL• Online Tools
– http://apikitchen.com/– http://hackst.com/– https://apigee.com/console
• Browser apps– Firefox – REST Client– Chrome – Advaned Rest Client
REST Testing Tools• Custom
– Perl – REST::Client, PerlUnit– Java – Apache HttpClient, JUnit– Language – {Http library, REST client library},
{xUnit}
Q&A?
SoapUI• Types of Testing
– Functional– Data-driven– Load– Integration– Security
• Test Management– Test Cases/Suite– Reporting
• Miscellaneous– Mocking– Authentication
SoapUI Demo• SOAP Service
– Create Project– Create Test suite– Assertions– Mocking
SoapUI Demo• REST service
– Create Project– Create Test suite– Assertions– Authentication– Integration– Data-driven– Load– Reporting
Q&A?
Thank You