🧑💻 Integration Testing –
1. What is Integration Testing?
Integration testing is about checking how two or more parts of a software work together.
- When developers build software, they split it into different modules (like login, cart, payment).
- First, each module is tested separately (this is unit testing).
- Then in integration testing, we combine modules and check if they talk to each other properly.
👉 Example: In an online shopping app – when a customer adds items to the cart and then goes to payment, integration testing ensures the cart details are correctly passed to the payment page.
2. Different Ways to Do Integration Testing
- Big Bang Approach: Test everything together at once.
- Example: Login → Search → Add to Cart → Pay → Invoice (all tested together).
- Top-Down Approach: Start testing from the top-level module and slowly add the lower ones. Use fake programs (called stubs) if the lower modules are not ready.
- Example: Check Place Order → Payment and use a stub to pretend that delivery service works.
- Bottom-Up Approach: Start testing from the bottom modules (like database and services) and move up. Use fake programs (called drivers) for higher modules.
- Example: Test Database → Payment Service even if the UI (screen) is not ready, by using a driver to call payment functions.
- Sandwich / Hybrid Approach: Mix of top-down and bottom-up.
3. How is it Different from Other Testing?
- Unit Testing: Check only one small part (like “login API gives success when username and password are correct”).
- Integration Testing: Check how two or more parts work together (like “login API + database + session management work correctly”).
- System Testing: Check the whole application end-to-end (like “login → dashboard → logout”).
4. Examples of Integration Testing
Banking App Example – Fund Transfer
- Modules: Account Balance, Fund Transfer, Notification
- Test Case:
- Transfer ₹5,000 from Account A to Account B.
- Account A balance should reduce.
- Account B balance should increase.
- SMS notification should be sent.
Shopping App Example – Place Order
- Modules: Product Selection, Cart, Payment, Invoice
- Test Case:
- Add product to cart.
- Go to checkout and make payment.
- Payment success → Invoice generated.
- Cart should become empty.
5. How Can You Do Integration Testing?
- Manually: Write test cases and test step by step. If some modules are not ready, use stubs (fake lower modules) or drivers (fake higher modules).
- With Tools:
- API Testing: Postman, REST Assured (Java), PyTest + Requests (Python).
- UI Testing: Selenium, Cypress.
- Automation with CI/CD: Jenkins, GitHub Actions.
6. Tips / Best Practices
- Always start with important data flow paths (like money transfer or checkout).
- If a module is not ready, use stubs/drivers to simulate it.
- Automate API-level tests because they are faster and more stable than UI tests.
- Use real-looking test data (e.g., valid account numbers, valid product IDs).
- Keep track of which modules are dependent on which.
✅ In Short: Integration Testing = making sure modules work properly together. Without it, software may pass unit tests but fail in real-world usage.
Now you have a clear idea of what integration testing is. Explore other topics of Manual testing
