Monday 23 May 2016

Web services testing at a glance



What is web service?

Web Services can convert application into a Web-application, which can publish its function or message to the rest of the world. There are lots of ready made services available which user can plug into your application and start providing those services in application.
For example if user want to display cities by country, user don't need to collect, process and render the data in application. User can buy services from the people who already publish such kind of data.
Web services allow us to do these kind of implementations.


Web Services have three basic platform elements: SOAP, WSDL and UDDI

SOAP [Simple Object Access Protocol]



       It’s an XML based protocol which allows applications to exchange info over HTTP. It’s a protocol to access a Web Service.

  • SOAP is a communication protocol and is a format for sending messages
  • SOAP is designed to communicate via Internet
  • SOAP is platform and language independent
  • SOAP is based on XML and is simple and extensible
  • SOAP allows you to get around firewalls
  • SOAP is a W3C standard

WSDL [Web Services Description Language]



      WSDL is an XML-based language for locating and describing Web services.

  • WSDL is based on XML
  • WSDL is used to describe and locate Web services
  • WSDL is a W3C standard

UDDI [Universal Description, Discovery and Integration]



       UDDI is a directory service where companies can register and search for Web Services.

  • UDDI is a directory for storing information about web services
  • UDDI is a directory of web service interfaces described by WSDL
  • UDDI communicates via SOAP
  • UDDI is built into the Microsoft .NET platform

Why Web services?


  • Due to Interoperability.
  • Web Services takes Web-applications to the Next Level.
  • Web Services have two types of uses:
  • Reusable application-components
  • Connect existing software
  • Web services can dramatically reduce the costs and complexities of software integration projects.

Advantages and Disadvantages of using web services


Advantages:


  • Re-usability, interoperability, Loose-coupling, etc.
  • Provides location independence: Services need not be associated with a particular system on a particular network.
  • Offers better adaptability and faster response rate to changing business requirements.
  • Allows web service consumers to find and connect to available Services dynamically.

Disadvantages:


  • Availability of services at run-time.
  • Performance maintained.
  • Security.
  • Governing the services.

When not to use web services:


  • For a stable enterprise IT environment, SOA (Service Oriented Architecture) may not be important or cost effective to implement.
  • If an organization is not offering software functionality as services to outside world or not using external web services, Web services may not be useful.
  • Web services are not desirable in case of real time requirements because it relies on loosely coupled asynchronous communication.

Why web service testing?

Web services comes into the picture, with the distributed architecture of loosely coupled systems that are technically apart but frequently need to communicate with each other in terms of data requirements. When you combine a set of services, there are more opportunities for error or failure, so the primary focus is ensuring their functional quality. Many companies exposes their information as web services, but they will probably charge for their use.
Load testing is vital throughout development, to compare between builds so as to identify the effect of code change on performance, also to access whether web service will cope with the expected number of users or even more. Some user might consume web services for mission critical roles, therefore performance matters a lot. In such cases they need assurances that web services won’t fail to return a response within a certain time period.
Web service testing presents a variety of new and interesting challenges. How well a web service will scale and perform depends on wow a web service is implemented.

What is web service testing?

Web Services Testing basically involves
·         Understand the Web Services Description Language (WSDL) file.
·         Determine the operations that respective web service provides.
·         Determine the XML request and response format.
·         Usage of a tool to send request and validate the response.
There are lots of tools available to test web services.   
SoapUI is one of the popular tool which helps to test the web services.  SoapUI is the market leader in API Testing Tool.

Web service Testing includes:

  • Availability
  • Functional
  • Integration
  • Compliance
  • Interoperability
  • Security
  • Performance

Challenges/Ladders in web service testing:

  • No user interface for the services in Web service applications which makes difficult to give input values.
  • Dependency on availability of any internal or external services that offers a business function to perform End-to-End testing.
  • Validating and Verifying the output in different system is little difficult for testers.
  • Test Coverage
    • Client level validation
    • Service level validation
  • Who owns the testing of the services?
    • Requester
    • Provider
    • Both/Another?
  • How well did the vendor test? How do you know?
  • How do you establish trust in a service and demonstrate to users that our web app is worthy of their trust?
  • To conclude what is expected from a Web service with respect to business requirements.
  • To gather and understand the requirements, and the data transfer standards.
  • To design test cases keeping business requirements in mind, the more data scenarios you have, healthier the quality of deliverable.
  • It is a difficult task for the tester to test complete end to end business flows with all the possible data scenarios/inputs. The option is to have an automated tool which can simplify the testing of web services like SOAP UI, SOAP Sonar etc.
  • Input parameter selection and categorization required to be known to the testers.

Types of Bugs that Web service testing detects:

  • Error conditions are not handled correctly/gracefully.
  • There exists unused flags.
  • Duplicate or missing functionality.
  • Reliability Issues. Unavailability/difficulty in connecting and getting response from web service.
  • There exists security Issues.
  • Performance Issues. Web service response time is too high.
  • Improper errors/warning to caller.
  • Incorrect handling of valid argument values.
  • Response data is structured incorrectly (JSON or XML)

Web service testing approach:

Test strategies should be incorporated in the development cycle of a web service. This is to guarantee success, beginning with proof-of-concept testing early on to make sure the architecture chosen is the correct one.
  1. First understand the functionality of the web service and clearly define the scope
  2. Apply appropriate testing techniques such as equivalence classes, boundary value analysis and error guessing and write test cases for the web service being used.
  3. Appropriately plan and define the input parameters being used for the web service that needs to be tested.
  4. Execute the set of test cases and compare expected and actual results.

Commonly used tools:

  • HP-Mercury Service Tester
  • IBM Rational Service Tester
  • Parasoft SOA Tester
  • iTKO
  • SOAP Sonar
  • SOAP UI/SOAP UI Pro
Ideaapplied Technologies provides comprehensive QA services. Visit us at ideaapplied.com to know more about our services.

No comments:

Post a Comment