6

I had an interview and they asked me how you will perform API testing? What should be my perfect answer? I explained what ever I have experienced with API testing but I felt that they were not satisfied with my answer.

I have answered as follow :

Generally I test following things while do API Testing :

  1. Data accuracy
  2. Data Validations
  3. Error codes if API returns

I told that I use SOAP UI to test API.

I would like to know perfect answer for this question and please suggest other tool as well which help me to do API testing.

1
  • 1
    API testing is the law hanging fruit of test automation. Unless the team are expert in 'doing it wrong' ™ their ideal answer should be 'not manually'
    – Nathan
    Commented Dec 21, 2015 at 22:47

3 Answers 3

6

Well, an API is such a loaded term. It can be REST, SOAP, RMI, or native C++ library API, etc., so the tooling will depend on that. Particular test scenarios will depend on that as well. For instance, for REST or SOAP over HTTP you may want to check popular HTTP-related attacks like HTTP Response Splitting, etc. You may also check if API is well-defined, e.g. in case of REST it is RESTful.

Next thing is that you may test API in isolated, small scenarios, where you check expected responses for valid and invalid inputs. This may go two ways, either through equivalence class partitioning and boundary checks, or with fuzz testing.

Finally, API is just an interface to a system or a library living in a certain context: it may have different states and may be just a part of different flows. So I would verify that as well.

I already mentioned some security tests, but there's a whole set of other non-functional tests you can run against API, performance tests included.

0
7

In general your answers were valid. But to create a better impression you could communicate the points which show you have deeper understanding of APIs and API testing.

  • You can mention about web services, APIs REST, SOAP, WSDL, XML, JSON, different methods (POST, GET, DELETE) etc so they get the perception that you have technical understanding of these technologies

  • It will be good to share if you have any prior experience of testing APIs. How you did test designing/documentation for them. Which tools (manual/automated both) you used. why & how.

We can test following factors in APIs

  • data, data type, data order, data completeness
  • authorization checks
  • http status codes
  • response time out implementation
  • security and performance testing

For further tips: https://mathieu.fenniak.net/the-api-checklist/

2
  • Yes you are right , Actually my answers were correct but limited. Thanks for your answer. Commented Dec 11, 2015 at 10:18
  • The list under the link is awesome, could you summarize it's content here?
    – dzieciou
    Commented Dec 11, 2015 at 19:09
0

You can check video API Testing - Part 1 - API Testing Introduction that make you confident to answer your interview question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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