Everything you need to know about API Testing and its types.
A Thread 🧵👇🏻
API testing is performed to test whether a particular API meets pre-defined parameters or not.
API testing includes testing APIs in isolation to ascertain if they meet:
• Functionality
• Reliability
• Latency
• Performance
• Security and other essential parameters.
API testing commonly includes testing APIs with JSON or XML payload sent over HTTP, HTTPS, JMS, and MQ.
These are widely used data formats and networking/messaging protocols.
📌 Types of API Testing
API testing is not a process that is carried out right away.
It is divided into several categories.
API testing aims to check whether an API can work in isolation, with integration, and produce the desired results to edge cases.
1️⃣ Unit Testing
Testing the individual operations of the API by logically dividing them into units.
Unit testing helps to identify imperfections in the early stages.
It typically includes testing each part of the code separately.
2️⃣ Functional Testing
As the term suggests, Functional API Testing includes testing of all the functions in the codebase.
It often uses unit tests as the building blocks.
3️⃣ Load Testing
Load testing generally validates the functionality and performance of API under load.
Load testing ensures whether an API will work as expected if multiple users are accessing the API concurrently.
4️⃣ Runtime error detection
Runtime error detection can be performed manually or through automated testing.
This testing includes monitoring an API by actually running the API entirely.
It helps us to detect errors and exceptions and also prevent resource leaks.
5️⃣ Security Testing
As the term suggests, this testing handles all the security aspects of an API, including external threats, validation, access control, and data encryption.
6️⃣ Penetration testing
Penetration testing includes testing an API to find vulnerabilities in the system or codebase that attackers can exploit.
It also includes testing functions that could be misused and test security assets that could be bypassed.
7️⃣ Fuzz Testing
In this testing, we provide substantial random data as the input to test the reliability of an API.
This random data is known as fuzz.
Fuzz testing ensures the API functionality in the worst-case scenario.
API testing is an essential aspect of API development.
Thousands of developers will use your API in several applications.
Examining the reliability, functionality, security, resource leaks of an API is the most crucial thing to be considered at first.
With that being said, time to wrap up this thread.