Web Service Testing and Automation

Web Service Testing and Automation

In a era where Apps are being designed and developed with an eye on the customer (UI), it is very important on how the developers plan to implement the service layer. Let me give two analogies on what a service is versus the UI layer.

Gmail App --> I login to a gmail App, as a user i see login screen, nice fancy UI. When a user enters his credentials page loads and he is signed in. For laymen if he signs in he is fine, but all the work on Authenticating the user, to generating a unique id etc is done by the Service(s) in the backend

Its like you go to a restaurant and order the food to the waiter, as you relax on the nice cozy sofa's, in the backend the cook is working on how he makes delicious food which is ultimately served to the customer. Your guess is a good as mine on who the Service is and who the UI.

Web Service Testing has evolved but continues to be a neglected area for testing across organizations. Primary reasons being 

- Test the UI which is what customers interact with anyways

- We will anyways catch the issues in UI for the backend as well

However generally as API's (Services) are developed early in the life cycle, testing them at the beginning makes sense. In many organizations which follow agile, they do most of there testing on Services with the following reasons in mind

a. Issues for incorrect response, wrong authentication, client / server side exceptions etc can be caught before the UI Page(s) is available for testing.

b. Data Driven Combinations can also be used to test various scenarios. E.g. for Login API

Days are gone where Organizations leave it to there JS or equivalent programming languages to write the logic. They have to expose it either as a Public API or internal ones. Restful API's have become popular and are widely used.

With the amount of effort we need to test the API's, it's better to to automate them. There are many commercial and open source tools available to automate the restful api's (Reference - https://www.methodsandtools.com/archive/restapitesting.php)

Few key considerations for Rest API Automation :

a. Automate with combinatorial data so that we cover maximum combinations

b. Ensure framework is able to handle all types of http methods like Get, Post etc

c. Ensure that data generation for tests is automatic and created newly, existing data becomes stale and is hardly reliable.

d. Plugin the framework with any Unit testing framework, so that you can run tests parallely

All in all in the today's world its important to have a good GUI but even more important to respond back to the users action faster with right content, Restful API's pave the way!!!

Great article. API testing is truly a neglected area of testing.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了