If you are working in any stage of the software industry – whether it be development, testing, operations, marketing, or some combination of the lot – you’re probably well-aware of the frenzied waters of the current API industry. Like many people, you may also be wary about how to navigate those waters. It’s not surprising, really, considering how new the idea of APIs as a business strategy is.
Still, if you’re really hoping to succeed in the API space, you can’t just slap some code together and ship out to the world. Much in the same way you do with your core products, you need to invest some time and energy into every stage of your API quality life cycle – from development and testing to post-production monitoring.
Let’s focus some attention on how you can elevate the quality of your API to make it a valuable (and valued) asset in your organization.
Functional API Testing
When creating functional API tests, it’s good practice to design the test suite as individual API call test steps that make up larger use cases. This makes it easier to find defects that arise and provides a more focused troubleshooting framework for the developers. Additionally, if your developers are building smoke tests using this same philosophy, you can use their those as a base for your own functional tests.
Structuring your tests into logical blocks will enable you to easily create flexible and maintainable tests. Creating these very precise tests allows you to select specific pieces of functionality to test and re-test. If your suite includes of thousands of tests, but you only want to verify a single bug fix in one area of the application, you can quickly re-test that area by selecting only those tests that matter.
Performance and Load Testing
Testing the limitations of your API prior to release is extremely important. Whether you’re using it internally or making it available to the general public, your API’s performance can greatly affect any application it’s built into. With that in mind, there are a few different types of performance tests you’ll want to run before releasing your API into production:
Speed tests – Before you put any load on the system, make sure you know your API’s baseline performance by running tests that can measure TPS, response time, latency, server metrics, etc. While these may seem like basic tests, API response time statistics are swiftly becoming a negotiation point between providers and consumers.
Load tests – Take that baseline from your speed tests and apply load by increasing TPS to make sure that it can handle the number of concurrent requests you expect on your system. Keep an eye on the same metrics mentioned above and make sure that none of them degrade within your expected user limits.
Stress tests – Once you’ve tested it under your expected load, try putting enough stress on the system to break it. The results of a stress test may tell you that your API is capable of handling X times the number of concurrent requests you actually expect to have. It’s better to understand how gracefully it fails when you push it beyond those limitations, before it negatively affects the consumers of your API.
Post-production monitoring has become yet another necessary arm of product quality assurance. Many organizations already realize the benefit of using production data to perform routine quality analysis of their applications or websites.
It’s no different with APIs. While there aren’t many options out there, this is a growing focus among those in the API community who are beginning to see the value in backing up SLAs and keeping an eye on any production trends around usage and performance as an important extension of their well-established quality efforts.
Building an API monitor is similar to building an API test, but there are some things to consider so you can maximize their effectiveness. You probably want to limit the number of steps you perform in the test in order to reduce cost and improve reliability. Your biggest concern is probably how well that API performs its basic tasks and how fast it responds.
Want to learn more about how to take your API quality to the next level? Join us on May 15 for an action-packed webinar and follow along as our expert panel takes us on a journey of ensuring API quality with continuous testing through every stage of the API life cycle, from development to testing, production, and back.
- API Documentation Matters More than Performance and Functionality
- The Complementary Paths of Real and Synthetic Monitoring
- Ever Wonder Who Invented the Cleanroom?