
Session1: Introduction to API Testing
SDET- QA
Overview
This video introduces the fundamentals of API testing, starting with basic web application concepts like client-server architecture and the three-tier model. It explains what an API (Application Programming Interface) is, emphasizing its role as a mediator between different software components, particularly the presentation and data layers. The video details the importance of API testing for ensuring software quality and efficiency, contrasting it with web UI testing. It also touches upon different types of APIs (SOAP and REST) and the distinction between APIs and web services, concluding with an overview of REST API methods (GET, POST, PUT, DELETE) and protocols (HTTP, HTTPS).
Save this permanently with flashcards, quizzes, and AI chat
Chapters
- Software applications are developed for specific clients or market requirements.
- Various testing types exist, including web testing and API testing, all aimed at delivering quality products.
- Web testing focuses on the front-end user interface (UI), while API testing is conducted on the back-end.
- Tools like Selenium are used for web testing, while Postman and Rest Assured are common for API testing.
- A client is a device or software that accesses services from a server.
- A server hosts the application or data that clients access.
- Web applications typically follow a three-tier architecture: Presentation Layer (UI), Application Layer (business logic), and Data Layer (database).
- The presentation layer is what the user sees (e.g., a browser interface), the application layer processes requests, and the data layer stores information.
- An API (Application Programming Interface) acts as a mediator, enabling communication between two different applications.
- APIs reside in the middle layer (application layer) and contain the business logic.
- They fetch data from the backend (database layer) and present it to the frontend (presentation layer), and vice-versa.
- API testing involves directly sending requests to the API and validating its responses, rather than testing through the UI.
- API testing allows for earlier detection of bugs, as APIs are often developed before the UI.
- It reduces the effort needed for UI testing, as core functionality is validated at the API level.
- Testing APIs directly saves time and resources compared to extensive UI testing.
- Developers can test APIs independently, even before the UI is fully developed.
- The two main types of APIs are SOAP (Simple Object Access Protocol) and REST (Representational State Transfer).
- REST APIs are more modern and widely used than the older SOAP APIs.
- A web service is essentially an API that is accessible over the internet or a network.
- All web services are APIs, but not all APIs are web services until they are deployed to a network.
- REST APIs commonly use HTTP methods: GET (retrieve data), POST (create data), PUT (update data), and DELETE (remove data).
- These methods correspond to CRUD (Create, Read, Update, Delete) operations.
- HTTP and HTTPS are protocols used for communication; HTTPS is the secure version, encrypting data transfer.
- API testing involves understanding the API's functionality, expected inputs, and desired outputs before validating responses.
Key takeaways
- API testing is a crucial part of software quality assurance that focuses on the back-end logic, complementing front-end web testing.
- Understanding client-server interactions and the three-tier architecture is essential for grasping API functionality.
- APIs act as intermediaries, enabling different software applications to communicate and share data or functionality.
- Testing APIs directly is more efficient and allows for earlier bug detection compared to relying solely on UI testing.
- REST is the dominant API architectural style today, utilizing standard HTTP methods like GET, POST, PUT, and DELETE.
- A web service is an API made accessible over a network, distinguishing it from APIs used internally or locally.
- HTTPS provides a secure channel for API communication, encrypting data to protect it during transmission.
Key terms
Test your understanding
- What is the primary role of an API in a web application's architecture?
- How does API testing differ from traditional web UI testing, and what are the benefits of this difference?
- Explain the concept of the three-tier architecture and identify where APIs typically reside within it.
- What are the four main HTTP methods used in REST APIs, and what CRUD operation does each typically correspond to?
- What is the key distinction between an API and a web service?