From the course: Java: Automated API Testing with REST Assured

The challenge with API testing - Java Tutorial

From the course: Java: Automated API Testing with REST Assured

Start my 1-month free trial

The challenge with API testing

- [Instructor] APIs are consumed by programs, not humans, which means there is no person on the receiving end of an API response who will be able to use human judgment to bypass any inaccuracies. That's why it's very important to test APIs to ensure they work as expected. Now one way to validate your APIs is to have a human tester examine the response that's returned from an API request. However, when the responses are long and contain a lot of data, human validation is error prone. For example, if we were to make an API request for a specific book, let's say "Steve Jobs" by Walter Isaacson, here is the response that we would receive. Attempting to verify this information by eyeballing it is not wise. With such intricate data, there's so much that we can miss. If this ID were incorrect, will we catch it? How about the ISBNs? And let's not even mention the URLs. How will we know if these were incorrect just by eyeballing them? API responses are not meant for human consumption, and therefore, attempting to efficiently verify them manually is almost impossible. It's much more effective to write automated tests that will thoroughly and consistently verify that all of the details of an API response are correct.

Contents