How do I go about testing web services?
I often get asked the question “How do I go about testing web services?” and the answer I always give may surprise you – the same way you would test any other application!
In general, the best approach to normal functional testing is the same for web services (except for the fact that unlike most other applications, web services don’t have GUI user interfaces). So take comfort in knowing the functional testing techniques that you have always used still apply. Simply think of a web service as a business process without a UI, and write your test case accordingly.
Because web services can be use by many different clients and used in multiple ways, performance testing and negative testing do become more critical. I would suggest you make sure there is good test coverage in those areas. Some good question to ask when automating a web service are:
- Does the service respond with the correct values?
- How quickly does the service send a response to the user?
- Can the service handle expected and unexpected user loads?
- Can the service handle invalid values and exceptions caused by bad data?
The biggest hurdle for most testers is acclimating to the terminology used when talking about web services. For instance:
- WSDLs – an XML format that tells you how to access a web service. WSDL are using that is automatically generated for you. Most test tools read in a WSDL and present all the information you need to interact with it.
- SOAP (Simple Object Access Protocol) – a protocol that uses XML format to exchange info to and from a Web service.
- SOA (Service-oriented architecture) – a way in which companies can organize software that can be quickly changed to respond to the requirements of the market place.
- Web Service – units of software that run in a network. Typically written to handle a specific business process. Web services can be strung together in multiple ways and used by different applications to create desired functionality.
I believe that once the above terms are demystified, the job of testing web services is pretty straightforward. I also feel that the best way to demystify something is to break it down into simple, hands-on examples. In this series I hope to present some simple hands-on examples that break down what a web service actually is, and how one works in general. Hopefully, knowledge plus know-how will equal automation awesomeness!
Follow each link below to learn more: