Functional Testing
Understanding and implementing Functional Testing in software development
less than a minute
Functional testing is a deterministic test that verifies all modules of a sub-system are working together. It avoids integrating with other sub-systems, preferring test doubles instead.
Overview
Functional testing verifies a system’s specification and fundamental requirements systematically and deterministically. It introduces an actor (typically a user or service consumer) and validates the ingress and egress of that actor within specific consumer environments.
Key Points
- Covers broad-spectrum behavioral tests (UI interactions, presentation-logic, business-logic)
- Side-effects are mocked and don’t cross boundaries outside the system’s control
- Differs from E2E tests which have no mocks
Recommended Best Practices
- Write tests from the perspective of an “actor” (user interacting with UI or service interacting with API)
- Avoid real I/O to reduce flakiness and ensure deterministic side-effects
- Use test doubles when the system under test needs to interact with an out-of-context sub-system
Alternate Terms
- Component test
Resources
Examples
🚧 Under Construction 🚧
Recommended Tooling
Platform | Tools |
---|---|
Android | Google Truth/JUnit 5, Android Espresso |
iOS | XCTest, XCUITest |
Web | Testcafe |
Java BE | TestNG, JUnit5 |
JS/node BE | Framework: jest Assertion & Mocking: expect (jest), supertest, nock, apollo Code Coverage: istanbul/nyc |