2

Is there any difference in testing of a API and a Web services?

closed as too broad by IAmMilinPatel, Bharat Mane, Kate Paulk, Rsf, Yu Zhang Dec 3 '16 at 8:23

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    There are already many questions discussing this topic. You may also refer to this which discusses difference with respect to testing .. sqa.stackexchange.com/questions/16177/… – TestingWithArif Dec 2 '16 at 9:55
  • @TestingWithArif : Your accepted answer is explaining the difference between SOAP and RESTful services, while i need to know the difference in verification of a web service and API. Also as you had mentioned in your question as well, there are many discussions on this topic but from development prospective, My intent here is to understand these technologies and their differences from a Tester's perspective. – Keshav Dec 2 '16 at 10:46
  • 2
    Why is this closed? For example there is a job position for WebDriver testing and there is a note that you have to "know how to test API" and I really wonder is there is really any big difference so I googled it and hit this page. – Nakilon Jul 5 '18 at 8:37
0

Following points helps the user to do API Testing approach:

  • Understanding the functionality of the API program and clearly define the scope of the program
  • Apply testing techniques such as equivalence classes, boundary value analysis and error guessing and write test cases for the API
  • Input Parameters for the API need to be planned and defined appropriately
  • Execute the test cases and compare expected and actual results.

API testing should cover atleast following testing methods apart from usual SDLC process

  • Discovery testing: The test group should manually execute the set of calls documented in the API like verifying that a specific resource exposed by the API can be listed, created and deleted as appropriate
  • Usability testing: This testing verifies whether the API is functional and user-friendly. And does API integrates well with another platform as well
  • Security testing: This testing includes what type of authentication is required and whether sensitive data is encrypted over HTTP or both
  • Automated testing: API testing should culminate in the creation of a set of scripts or a tool that can be used to execute the API regularly
  • Documentation: The test team has to make sure that the documentation is adequate and provides enough information to interact with the API. Documentation should be a part of the final deliverable

    WebService can be called by a Software Application using SOAP or HTTP protocol.
    Web Services can be implemented in different ways, but the following two are the popular implementations approaches.

  • SOAP (Simple Object Access Protocol)
  • REST (Representational State Transfer architecture) Software Applications communicate and exchange data with each other using a WebService

  • SOAP and REST are 2 popular protocols to create a WebService

  • SOAP supports XML based data exchange
  • REST support XML, Json or exchange of data in simple URL.
  • WSDL is XML based language which will be used to describe the services offered by a web service. SOAP is defined using WSDL.
  • To test WebService you can Create your own code. For instance use Axis2 API for Java Use WebService Test Automation tools like SoapUI
  • Automation Tools like SoapUI will jumpstart your testing efforts, will require less coding effort compared to creating your own code using Axis2 API

Web Services Testing basically involves - Understand the WSDL file - Determine the operations that particular web service provides - Determine the XML request format which we need to send - Determine the response XML format - Using a tool or writing code to send request and validate the response

Suppose we want to test a WebService which provides Currency Conversion Facility. It will the current conversion rates between the different countries currency. This service we can use in our applications to convert the values from one currency to the other currency.

  • I hate when people downvote without providing explanation what they don't like or was wrong in the answer. – dzieciou Dec 3 '16 at 7:51
  • How do we know what is to be improved ?? Downvote without explanation is not fair. – prinz Dec 3 '16 at 8:39
  • 1
    I'll leave the comment. This answer is long but does not answer the question. The @dzieciou 's answer is better. It also has links pretty useful for subject. – Nakilon Jul 5 '18 at 8:39
4

The difference between testing APIs and testing Web services stems from the difference between APIs and Web services. So, according to Wikipedia:

An application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application software.

Intuitively, Web services are APIs available over the Web. However, again we should be precise on how those Web services are implemented (again from Wikipedia):

Although "web API" is sometimes considered a synonym for web service, many Web 2.0 web applications have moved away from SOAP-based web services towards collections of RESTful web resources.

You may ask whethere there are APIs that are not Web APIs. There are: libraries and frameworks can have APIs. There are also remote APIs that are not available over the Web, like Java RMI.

So when you ask

Is there any difference in testing of a API and a Web services?

you need to be more precise what type of API you have in mind and what exactly you understand by Web services term.

When it comes to difference between testing RESTful resources and SOAP Web services, there is already a question on that topic.

Not the answer you're looking for? Browse other questions tagged or ask your own question.