Software Testing & QA (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
Unit Testing vs. Integration Testing vs. End-to-End (E2E) Testing.
junior LevelTesting
In Simple Words:
| Dimension | Unit Tests | Integration Tests | End-to-End (E2E) Tests |
|---|---|---|---|
| Scope | Single function, class, or component | Two or more modules (Service + DB) | Full system (Browser + API + DB) |
| Dependencies | All external I/O mocked | Real/Containerized DB, Redis, APIs | Full real running environment |
| Execution Speed | Milliseconds ($<5\text{ms}$) | Hundreds of milliseconds ($100\text{ms}-1\text{s}$) | Multiple seconds ($5\text{s}-30\text{s}$) |
| Debugging Ease | Pinpoints exact line of failure | Identifies boundary contract bugs | Hard to isolate root cause |
| Primary Tools | Vitest, Jest, JUnit, PyTest | Testcontainers, Supertest, MSW | Playwright, Cypress, Maestro |