# Types of Software Testing ## By Scope - **Unit** — individual functions/methods in isolation; fastest and cheapest - **Integration** — multiple components working together (modules, APIs, databases) - **System / E2E** — entire application as a whole; simulates real workflows (Selenium, Cypress, Playwright) - **Component** — single component (e.g., microservice) isolated from the system ## By Intent - **Functional** — does it do what it's supposed to? Tests the "what" - **Non-Functional** — performance, scalability, usability, reliability, security - **Regression** — re-run existing tests after changes to catch breakage - **Smoke** — quick, broad check of critical functions ("does it catch fire?") - **Sanity** — narrow, focused check on a specific fix - **Exploratory** — unscripted manual testing using tester's intuition ## By Perspective - **Black-Box** — no knowledge of internals; based on inputs/outputs - **White-Box** — full knowledge of code; tests paths, branches, conditions - **Grey-Box** — partial knowledge (e.g., knows DB schema, tests through UI) ## By Development Phase - **Acceptance (UAT)** — end users verify business requirements - **Alpha** — in-house testing before external release - **Beta** — limited external users in real-world environment ## By Methodology - **TDD** — write tests first, then code; Red-Green-Refactor - **BDD** — natural language specs (Given-When-Then); see [[Test Case Writing Patterns]] - **ATDD** — acceptance criteria agreed by business, dev, and testing ## Specialized Types ### Performance - **Load** — expected load - **Stress** — beyond capacity - **Spike** — sudden sharp increase - **Endurance/Soak** — sustained load (memory leaks) - **Scalability** — scaling up/out ### Security - **Penetration** — simulating attacks - **SAST** — static source code analysis - **DAST** — dynamic analysis of running app - **Fuzz** — random/malformed input to find crashes ### Other - **Mutation** — deliberate bugs to measure test suite quality (mutmut, Stryker, pitest) - **Snapshot** — compare rendered output against saved snapshots (Jest) - **Visual Regression** — screenshot comparison (Percy, Chromatic) - **Contract** — verify API schemas between services (Pact) - **Chaos** — inject failures to test resilience (Chaos Monkey, Litmus) - **Canary** — deploy to small subset first, monitor, then roll out - **A/B** — compare variants measuring user behavior ## The Testing Pyramid ```text / E2E \ <- Few, slow, expensive / -------- \ / Integration \ <- Some / ------------ \ / Unit Tests \ <- Many, fast, cheap ``` --- See also: [[Test Case Writing Patterns]]