Why API Testing is Important in Your Development Process

综合技术 2016-06-01

One of the most common ways to see companies benefiting from API monitoring is in production — making sure those live API endpoints are up, fast and returning the data that’s expected. By monitoring production endpoints, you’re in the loop as soon as anything breaks, giving you a critical head start to fix the problem before customers, partners or end-users notice. But at this point it may already be too late, as the customers will be unsatisfied and unhappy with their restful API not working or not accessable.

However, most of the companies that are also building restful API's are starting to create thoseAPI tests during the build process in staging and dev environments. The goal of this is that one can actually begin testing API endpoints before they’re deployed to the customers, which means that we’re testing to make sure everything is exactly as we’re promising before we deliver the API's.

Benefits of Incorporating API Testing in Development

Including API tests in your test-driven development (TDD) process provides a host of benefits to engineering teams across the lifecycle that get passed down to customers in the form of better quality services.

There are 3 critical ways that your company will benefit from including API tests in your development process :

1. Test Quality

If you wait until after development to build your API tests, you’ll naturally build them to be biased toward favorable test cases. Once an API or piece of software is built, you’re focused on how it’s supposed to perform instead of the other, equally likely scenarios, in which it will fail. Plus, much like iterating on software during development, iterating on API tests will only make them stronger and more comprehensive, which will benefit the team in the long term, raise the product (or API) quality and will decrease the number of faults that were to be found in the future.

2. Test Coverage

Covering all the bases of potential software failures is a critical component to maintaining quality product and customer trust. API testing during development can reveal issues with your API, server, other services, network and more that you may not discover or solve easily after deployment. Once your software is out in production, you’ll build more tests to account for new and evolved use cases. Those tests, in addition to the ones you built during development, keep you covered for nearly any fail scenario, which keeps QA and customer support teams from being bombarded with support tickets.

3. Test Reuse

One of the best reasons to create API tests in the early stages is the rewards you’ll feel after deployment in that the bulk of your tests are already taken care of. For instance, Runscope allows you to reuse the same tests in multiple environments, duplicate and share tests. Your dev and QA teams build tests and use them in dev and staging environments, then your DevOps teams can reuse those same tests and run them on a schedule in production to monitor those use cases. DevOps then iterates and adds more tests, which can be reused by dev and QA teams when building out new endpoints. Reusing API tests across the development lifecycle facilitates collaboration among teams and provides a more comprehensive and accurate testing canon.

Using API Testing with CI/CD & TDD

You can incorporaterestful API testing into your development process a couple of different ways. Many of the companies include API tests in their continuous integration (CI) and continuous deployment (CD) processes either with trigger URLs or a direct plugin with Jenkins .

If an API test fails during CI or CD, the process is stopped and the API issue must be fixed before the build is complete. Including API tests in this process gives engineering and product teams more assurance that all they’ve covered all the bases before releasing product to customers.

You can also build tests specific to an API that’s in development, similar to how you would when building other software in TDD. Test new endpoints as they’re being built in development and staging, then trigger them to run as part of your CI/CD pipeline.

API testing is at the core of API monitoring, which is just running on a schedule the tests you create either in development or post-deployment. Building API tests during development of any software or service has far-reaching benefits across teams, all the way down to how your customer experiences the product.


Setting up and testing AMP for WordPress: A quick ... In today’s mobile-centric world, having pages that load quickly is essential for satisfying the user. Not only that, but the effects of slow pa...
Angular Testing: A Developer’s Introduction In this guide, we’ll look at how we can write automated tests in Angular 5 projects. Angular Testing is a core feature available in every project tha...
Chrome OS is testing a fullscreen launcher in tabl... It’s no mystery that Chrome OS is moving more towards a touchscreen-optimized interface. Google has been slowly adding more touch-friendly and Androi...
Testing multiple Puppet versions with TravicCI When it comes to running automated tests of my public Puppet code TravisCI has long been my favourite solution. It’s essentially a zero infrastructur...
Azure 认知服务 (2) 计算机视觉API – 分析图像... 在上一节内容中,笔者介绍了微软认知服务的概览。 在本节中,笔者将详细介绍微软认知服务中的一种:计算机视觉 (Computer Vision) API 我的一个客户有需求,他们需要消费者与自己的产品合照,然后上传到服务器并转发到朋友圈。 但是为了防止恶意用户上传不健康的照片,需要对图...