On every `git push`, a GitHub Actions workflow triggers automatically: running linters, executing Jest unit tests, building Docker container images, and deploying to AWS Cloud.
# .github/workflows/ci.yml example
name: CI/CD Pipeline
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with: { node-version: 18 }
- run: npm ci
- run: npm run lint
- run: npm test
- run: npm run buildVisual representation of control loops, memory layout, and execution flow for Software Testing (Unit, Integration, E2E) & CI/CD.
Tests individual functions or components in isolation using mocks for external dependencies.
Tests interaction between multiple modules (e.g., API Route handler + Database query).
Simulates real browser user clicks from UI through backend using Playwright or Cypress.
Automated build artifacts deployed seamlessly to staging or production environments upon passing test gates.
| Feature / Dimension | Unit Tests (Base) | E2E Tests (Top) |
|---|---|---|
| Scope & Speed | Single function/class; Runs in milliseconds | Full application & real browser; Runs in minutes |
| Cost & Volume | Cheap to write and maintain; Represents 70% of test suite | Expensive and prone to flakiness; Represents ~10% of test suite |
| Mock Usage | Heavily mocks databases and network calls | Runs against real backend databases and APIs |
Detailed answers, interviewer pro tips, key takeaway summaries, and code examples formulated for technical rounds.
✅ Correction: Build a solid foundation of fast, deterministic Unit tests (70%), moderate Integration tests (20%), and selective E2E tests (10%).
Automated quality assurance and continuous software delivery.