You are on page 1of 33

Implementation and Testing Service Oriented Architecture

By Bharath Kumar Bijo Stephen

INTRODUCTION TO SOA
An architectural style to achieve loose coupling among interacting software services. SOA as an architectural style where systems consist of service users and service providers auxiliary components- enterprise service bus (ESB) and the directory of services
CONNECTOR SERVICE PROVIDER SERVICE USER

WHAT IS SOA?
SERVICE- representative of a repeatable business process- Having interface , Implementation Independent. SERVICE ORIENTATION- method of integrating business applications and processes as linked services SERVICE-ORIENTED ARCHITECTURE- set of business services composed to capture the business design for service orientation.

WHY SOA? Flexible (Agile) - Adaptable to changing business needs


Faster time to market- Reuse existing code, minimize new development Business and process-driven- New business opportunities Leverage existing IT asset and greater returns on investment.

PRE SOA SCENARIO

SOA - ENABLED SCENARIO

Partner Credit Data

Back -end system

Back -end system

Customer data

PRINCIPLES AND ARCHITECTURE OF SOA


Standardized service contract- Services adhere to a communications agreement,
as defined collectively by one or more service-description documents.

Service loose coupling- Services maintain a relationship that minimizes


dependencies and only requires that they maintain an awareness of each other.

Service Abstraction- Beyond descriptions in the service contract, services hide


logic from the outside world. Service Reusability - Logic is divided into services with the intention of promoting reuse. Service Autonomy - Services have control over the logic they encapsulate. Service Granularity- A design consideration to provide optimal scope and right granular level of the business functionality in a service operation. Service Stateless - Services minimize resource consumption by deferring the management of state information when necessary

SOA SERVICE LAYERS


ACCESS LAYER PROCESS LAYER SERVICE LAYER RESOURCE LAYER

SOA COMPONENTS
1. Service provider- creates a service and publishes its interface and
access information to a service registry.

2. Service consumer- locates entries in the service registry and then


binds to the service provider in order to invoke the defined service.

3. Service registry- is responsible for making the service interface and


implementation access information available to service consumers.

SOA Components

WEB SERVICES AND SOA SOA is not same as Web Services. A SOA is essentially a collection of services. The technology of Web Service is connection technology of SOAs. Web Service is a software system designed to support interoperable machine-machine. The WSDL forms the basis for Web Services

WEB SERVICES RELATIONSHIP TO SOA


Web services are a technology that is well suited in implementing a SOA. Web services can be developed as loosely coupled application components using any programming language, any protocol, or any platform

Web Service Components


The service provider, service client and service registry. Communications between components is based on XML messaging Service provider provides a service to its clients. The services are published within the registry. Service registry is a network server that maintains details of available services. Client side implements this service. It uses the registry to discover a service and its description.

SOA TESTING
Is a unique testing and validation needs of Service Oriented Architectures Services are based on heterogeneous technologies Tests the message layer functionality of the services, automates the testing and supports numerous transport protocols Testing functionality include static analysis through WSDL testing.

SOA Testing Challenges


Services that do not have a user interface Data driven business logic within services External services to the organization Predicting the future usage of services to assist with performance, load, stress, scalability The quality of 'service' software will be vital to promote reuse and facilitate business agility. As your SOA evolves, security testing will have a higher priority and profile within your organizations test strategy

SOA TEST METHODOLOGY


Traditional software testing that focused on codelevel testing has evolved with Distributed and Web Service architectures. Web application testing has introduced more testing of business logic through the application's user interface. SOA stresses on business logic implementation. SOA services will not have a user interface, which is one of the new challenges to testing unit.

SOA TESTING APPROACH


Equal weighting of testing effort throughout the project life cycle. Design the project test approach alongside the project business and technical requirements Implement Quality Controls throughout the project life cycle. Design and Plan Security testing from the start of the project. Using suitable Testing Tools

HOW DO YOU TEST SOA ARCHITECTURE?


break down the architecture to its component parts. Test each component in a recommended approach by using testing tools , then integrate the holistic architecture. SOA is loosely coupled with complex interdependencies and a SOA testing approach must follow the same pattern.

SOA COMPONENTS

DIFFERENT LEVELS OF SOA TESTING


Governance Testing Functional Testing Performance Testing Service-component-level Testing Service-level Testing Integration-level Testing Security Testing

Governance Testing
SOA Governance is a key factor in the success of any SOA Implementation covers the entire lifecycle of SOA ImplementationDesign ,Run , Maintenance. Refers to Standards (Quality) and Policies that come into picture during- Implementation-Design -Run

Functional Testing
API Testing Detect errors at an early stage, right from the requirements level Ensure that real-world test data is used Automate test case execution to improve productivity

Performance Testing
As SOA grows more of the SOA components and services are reused-To clock this we need Performance Testing. Can be done on individual services and components of SOA architecture.

Service-component-level testing
Unit testing is generally performed by developers to check the code compiles and meets all basic functionality as specified. Divide and conquer- isolate a module from the software and determine whether it behaves exactly as you expect Component is tested separately before integrating it into a service or services

Service-level testing
Most important testing phase in SOA approach. To ensure code complies with organization standards and to identify any potential interoperability, performance and security defects or weaknesses Quality entry and exit criteria are not only defined for this level of testing, but are achieved before delivering the service to the next level of testing must ensure that the service is not only meeting the requirements of the current project, but meeting the business and operational requirements

Integration-level testing
focus on service interfaces aims to determine if interface and information sharing between the services are working as specified should be tested on different technology platforms.

Security Testing
Web Services are exposed to the outside world, this fact opens up a host of vulnerabilities, attacks, penetration etc. Typical security policies have to be enforced at the network level to secure SOA. Testing - Simulate denial-of-service attacks Popular denial-of-service mitigation products from Arbor Networks

REAL TIME SCENARIO WITH SOA


Grand Total Calculation in Online Shopping : Services Used: 1. N unit price Calculation 2. Tax calculation 3. Shipping amount Calculation 4. Grand total Calculation

Pictorial Representation
ITEM PRICE/UNIT

COUNTRY/CITY/ZIP CODE

Input Parameter

N UNIT PRICES

TAX CALCULATI ON

TAX CALCULATI ON

Request/Response Parameter

Services

GRAND TOTAL

REQUEST XML FOR NPRICE UNIT


<soapenv:Envelope <soapenv:Header/> <soapenv:Body> <web:NPrice> <web:ItemId>?</web:ItemId> <web:PerUnitprice>?</web:PerUnitprice> <web:No.Ofunits>?</web:No.Ofunits> </web:NPrice> </soapenv:Body> </soapenv:Envelope>

RESPONSE XML FOR NPRICE UNIT


<soap:Envelope <soap:Body> <NPriceResponse > <NUnitpriceResult>?</NUnitpriceResult> </NPriceResponse> </soap:Body> </soap:Envelope>

Test Plan for Tax Calculation


T.no 1 2 Description Valid Input(zipcode) Invalid Input(zipcode) Input 560029,1000 , 1000 Expected Result 20 Error

Invalid Input

235acf,1600

Error

THANK YOU ANY QUERIES??