SOA Testing

35
SOA Testing Roopesh Kohad Shirish Kawatkar

description

The presentation is about SOA testing

Transcript of SOA Testing

Page 1: SOA Testing

SOA Testing

Roopesh Kohad

Shirish Kawatkar

Page 2: SOA Testing

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

Page 3: SOA Testing

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

Page 4: SOA Testing

Agenda• SOA

– Introduction– Web Services– Testing Aspects

• SOAP web services– Introduction– Testing

• RESTful web services– Introduction– Testing

• SoapUI– Features– Demo

Page 5: SOA Testing

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

Page 6: SOA Testing

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

Page 7: SOA Testing

SOA Elements

Page 8: SOA Testing

SOA Principles• Loose coupling• Contract• Abstraction• Autonomy• Reusability• Statelessness• Discoverability• Composability• Etc..

Page 9: SOA Testing

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

Page 10: SOA Testing

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

Page 11: SOA Testing

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.)

Page 12: SOA Testing

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?

Page 13: SOA Testing

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

Page 14: SOA Testing

SOA Testing Aspects• Practices & Techniques

– Continuous Integration & Deployment– Service virtualization / Mocking

• Test Management– Framework– Regression– Reporting

Page 15: SOA Testing

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

Page 16: SOA Testing

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)

Page 17: SOA Testing

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

Page 18: SOA Testing

SOAP Testing• Testing a SOAP API means manipulating a

request XML and interpreting a response XML

Page 19: SOA Testing

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

Page 20: SOA Testing

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)

Page 21: SOA Testing

Q&A?

Page 22: SOA Testing

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

Page 23: SOA Testing

REST constraints• Use HTTP methods explicitly• Be stateless or Idempotent• Expose directory structure-like URIs• Transfer XML, JavaScript Object Notation

(JSON), or both• Etc.

Page 24: SOA Testing

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/

Page 25: SOA Testing

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

Page 26: SOA Testing

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

Page 27: SOA Testing

REST Testing• Testing a REST API means manipulating the

request URI and interpreting the answer

Page 28: SOA Testing

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

Page 29: SOA Testing

REST Testing Tools• Custom

– Perl – REST::Client, PerlUnit– Java – Apache HttpClient, JUnit– Language – {Http library, REST client library},

{xUnit}

Page 30: SOA Testing

Q&A?

Page 31: SOA Testing

SoapUI• Types of Testing

– Functional– Data-driven– Load– Integration– Security

• Test Management– Test Cases/Suite– Reporting

• Miscellaneous– Mocking– Authentication

Page 32: SOA Testing

SoapUI Demo• SOAP Service

– Create Project– Create Test suite– Assertions– Mocking

Page 33: SOA Testing

SoapUI Demo• REST service

– Create Project– Create Test suite– Assertions– Authentication– Integration– Data-driven– Load– Reporting

Page 34: SOA Testing

Q&A?

Page 35: SOA Testing

Thank You