API endpoint testing is a form of integration testing that validates the developed application programming interfaces (APIs) to see that they meet the requirements (functionalities, performance, security, …). Because API’s don’t have a graphical user interface (GUI) testing is done by sending and receiving JSON or XML payloads over http(s).
Why do API testing?
A graphical user interface is no longer king. In a world of mobile applications, Internet of Things (IoT) and microservices, API’s are getting more important. Because of the number of applications that needs to communicate with each other keeps increasing, it’s very important that they all remain stable throughout their lifecycle.
Software methodologies such as XP and Agile cause a quicker release cycle. And because we release quicker and more often, there is also a higher need for some form of automated testing. Manually testing an API after every release cycle would be very slow and cumbersome. By automating this process we can quickly test every previously developed endpoint to ensure everything keeps working as expected.
The biggest advantages of API testing during the development process are:
Reusability: The same tests we are using for API development can be used for both production and staging environments in postman. They can also be used as a blueprint for development teams that need to integrate with our API.
Detailed test coverage: It’s very important to guarantee the quality of a product. Implementing API tests in the beginning of the development process will limit the amount of bugs and issues in later stages that might otherwise be harder to pinpoint. Adding new tests as the product grows will ensure that new functionalities can be deployed with more ease.
Quality: By writing our API tests based on the technical requirements and specifications instead of the already developed API we will be able to cover more exotic scenarios. When writing tests based on the API itself, we would unconsciously write our tests based on the API output, not on the technical requirements.
Implementing these automated test in a development process will happen through a continuous integration server such as Bamboo or Jenkins. This way on every push or pull request the test scenarios can validate that none of the code breaks.
More about developing API’s and microservices: