The testing pyramid organizes tests by scope. Build many fast, isolated unit tests at the base, then add fewer broader tests as they become slower, less isolated, and more fragile. section 4.3.1
Move upward as tests involve more of the application:
- Unit tests exercise code at the base and support frequent development, including test-driven development. section 4.3.1
- Component tests isolate an API or similar component to find malformed requests and exception cases. section 4.3.1
- Integration tests check whether multiple components work together despite their additional dependencies. section 4.3.1
- UI tests automate user-like workflows, while manual and exploratory testing searches for broken behavior and interface inconsistencies. section 4.3.1
Testing a files endpoint
A FastAPI TestClient calls GET /files, then asserts a 200 status and the expected JSON response. A BDD version expresses the same behavior as a feature and step definitions.







