Connect API Fortress to Any Database

Easily Connect API Fortress to Any Database

Option 1: Leverage the JDBC component on the API Fortress platform to connect with any  JDBC-compliant database including PostGres, MySQL, and Microsoft SQL.

Option 2: Use an API Fortress helper app to convert most popular databases, CSV and other files into an API, which API Fortress can then use for data-driven testing.

Data-driven Testing (DDT) and Data-driven APIs

Data-driven testing is critical in validating that APIs meet your needs for reliability, resiliency, and performance.

Most mobile and web apps require APIs that connect to multiple databases that undergo constant, iterative changes. Variable data can be provided by the provider or consumer, and the only constant is how inconsistent those requests can be. For example, an ecommerce app may allow users to select different shoes with varying colors, sizes, and prices. 

What this means is that testing those APIs using static calls from something like a  CSV won’t properly reproduce real world conditions. Yet, that’s the most common method of testing APIs.

Fortunately, there is a new push towards data-driven tests (DDT). The obvious utility in this method is allowing APIs to be run in numerous unpredictable manners, and therefore properly tested for normal and edge cases. 

We have years of experience in seeing the difference between using CSVs and proper data-driven tests, and even wrote an ebook detailing some of those – API Fortress eBook. One of the stories involves a book publisher with a partner API that had tens of thousands of ISBNs. That API was used by resellers to know what items were in stock and still for sale. Before using API Fortress the publisher recognized a 99%+ uptime.

When API Fortress was introduced, the publisher created data-driven tests that did simply this:

  1. Call the partner API with all ISBNs
  2. Choose 500+ of those ISBNs at random and dive into the product information

What they found was that hundreds of these allegedly “valid ISBNs” were actually not valid. How could that be possible when the ISBNs were actually pulled from an API of good ISBNs?

Simply put, they were updating their product databases once every two weeks, but weren’t resetting the cache of their API gateway. This isn’t even an API failure, but a database and gateway failure that only proper API testing could have captured. There are more examples in the ebook, but we wanted to convey a really unique problem that is exclusively captured by proper data-driven testing.

Problems such as this are exacerbated by the complex constellation of APIs that each feed off independent databases. Most QA and test automation teams don’t have the time or resources to manually add proper data iteration into their testing suites due to the complexity and time involved. Platforms like API Fortress are built for this sort of testing from Day 1. 

No added complexity. Just smart testing.

$2.84 trillion was the estimated total cost of poor quality software in the U.S. alone during 2018

Source: Consortium for IT Software Quality (CISQ)

Data-driven API Testing Checklist

Data-driven API testing focuses on validating variable data from a database or file repository. Therefore, data-driven testing can be conducted early in the software development lifecycle. But to successfully enable continuous data-driven API testing throughout the life cycle, QA and testing automation teams really need two key elements: centralization and simplicity.

With proper attention to centralization and simplicity, modern data-driven testing provides distributed QA teams with a central repository to unify testing across teams. It also makes it simple for QA teams to ensure that the test logic built from requests and assertions accurately captures real world scenarios at the API level. 

Here’s a Best Practices Checklist for modern data-driven API testing:

  • Centralize data-driven tests and queries for easy reuse

  • Simplify test execution in multiple environments

  • Connect databases with JDBC drivers or convert databases or files into APIs for connections

  • Store variable data sets for easy sharing and reuse

  • Design data-driven test logic, and designate data-driven tests at the Global or Project level

  • Enable any team members to run tests

Data-driven Testing with API Fortress

Sign up for a free trial of API Fortress and put your data-driven testing to the test. Schedule a demo today.