What are the different types of testing in software development?
TL;DR
Testing can be classified by scope, purpose, and execution style; the categories overlap. Common scopes are unit, component, integration, system/end-to-end, and acceptance testing. Common purposes include regression, smoke, contract, accessibility, performance, security, and usability testing. Tests may be automated or exploratory and can run against static code, an isolated process, or a production-like system.
Choose types from the product's risks rather than trying to satisfy a universal pyramid. For an online checkout, test price rules at unit level, API/database contracts at integration level, critical purchase journeys end to end, and separately test accessibility, load behavior, and authorization.
Testing by scope
Unit testing
Exercises a small behavior with controlled dependencies. Unit tests are fast and make edge cases easy to cover, but cannot prove that modules or external systems integrate correctly.
test('rejects a quantity below one', () => {expect(() => calculateTotal({ price: 20, quantity: 0 })).toThrow();});
Component testing
Renders a UI component or starts one service with nearby dependencies. It checks behavior through a public interface without running the whole product. Testing Library, browser component runners, and service-level test harnesses are common choices depending on the component.
Integration and contract testing
Integration tests verify that collaborators work together—for example, an HTTP route, serializer, and database. Contract tests verify that two independently deployed systems agree on request, response, or event shapes. These tests catch boundary errors that isolated mocks can miss.
System and end-to-end testing
Exercises a complete application or journey through public interfaces. Browser tools such as Playwright and Cypress can verify navigation, rendering, and browser/server integration. Keep the suite focused: these tests require realistic state, take longer, and have more possible failure causes.
Acceptance testing
Checks whether the product satisfies agreed business or user requirements. Acceptance may be automated, performed manually by stakeholders, or both. It is a purpose, not a particular tool or team.
Testing by purpose
- Smoke tests quickly establish that a build's critical surfaces start and respond.
- Regression tests preserve behavior after a bug fix or change.
- Accessibility tests combine automated rule checks with keyboard, screen-reader, zoom, contrast, and usability review; automation alone cannot prove accessibility.
- Performance tests measure latency, throughput, resource use, or browser responsiveness under defined conditions.
- Security tests include static analysis, dependency review, authorization tests, dynamic scanning, and threat-driven manual testing.
- Exploratory and usability tests use human investigation to find confusing workflows and failures that predefined assertions may not anticipate.
Choosing a portfolio
Ask what failure would be costly and which is the lowest layer that can detect it reliably. A tax formula needs many fast cases; a database migration needs real-database integration tests; login and checkout deserve a few production-like journeys. Also define who owns test data and cleanup, where tests run, and how failures will be diagnosed.