Types of Testing
Explore the different types of software testing, understand the testing pyramid, and learn when to apply functional, non-functional, and specialized testing techniques.
What you'll learn
- Distinguish between functional and non-functional testing
- Explain the testing pyramid and the role of each level
- Identify when to apply different types of testing
FoundationlessonsJump to another lesson
Types of Testing
A unit test serves a completely different purpose than an end-to-end test. Knowing the landscape is essential for building a real testing strategy.
Functional vs. Non-Functional
Functional Testing
Does it work?
Non-functional Testing
How well does it work?
Functional Testing
- Answers: 'Does it work?'
- Checks registration creates an account
- Verifies discount codes apply correctly
- Confirms password reset emails send
- Focus: features and correctness
Non-Functional Testing
- Answers: 'Does it work well enough?'
- Performance under load
- Security against injection and XSS
- Accessibility and usability
- Focus: speed, safety, reliability
VerdictA system can be functionally correct but non-functionally broken — like a search that returns perfect results in 45 seconds. Cover both.
Quick check
A checkout page processes payments correctly but fails for 2 out of every 10 users under heavy traffic. What kind of testing would catch this?
The Testing Pyramid
- E2E Tests:Full user workflows, slow, fragile
- Integration Tests:Components working together
- Unit Tests:Individual functions, fast, reliable
- 1
End-to-End Tests (top — few)
Test the whole app through a real browser. Slow, expensive, realistic. Reserve for critical user journeys.
- 2
Integration Tests (middle — some)
Test how components work together. Catches bugs that unit tests can't see — data-format mismatches, contract drift.
- 3
Unit Tests (base — many)
Test individual functions in isolation. Fast, cheap, precise. The bulk of your test suite.
- E2E Tests:Way too many! Slow CI, flaky tests
- Integration:Some
- Unit Tests:Not enough!
Exercise: Build the Testing Pyramid
Drag the testing levels into pyramid order, from BOTTOM (most tests, fastest) to TOP (fewest tests, slowest):
- 1End-to-End Tests
- 2Unit Tests
- 3Integration Tests
Other Important Testing Types
| Type | Purpose | When to Use |
|---|---|---|
| Smoke Testing | Quick check that critical functions work after a build or deployment | After every deployment |
| Regression Testing | Verify that new changes haven’t broken existing functionality | Before every release |
| Exploratory Testing | Unscripted, creative testing guided by tester’s experience and intuition | When scripted tests aren’t enough |
| Acceptance Testing | Verify the software meets business requirements and is ready for delivery | Before release, with stakeholders |
Exercise: Match Testing Types
Match each testing type with its correct description: