Testability defined
Testability is the degree to which a system makes it practical to create a known condition, perform an action, observe the result, and diagnose unexpected behaviour.
Six dimensions
| Dimension | Good testability |
|---|---|
| Observability | Important states, events, errors, and outputs can be inspected. |
| Controllability | Tests can create required states and inputs. |
| Isolation | Dependencies can be stubbed, mocked, or independently exercised. |
| Repeatability | The same test can run again under comparable conditions. |
| Determinism | Results are not dominated by random timing or shared state. |
| Diagnosability | Failures produce useful evidence. |
Poor vs strong testability
Design choices that help
- Stable test IDs
- Accessible APIs
- Structured logs
- Correlation IDs
- Feature flags
- Seedable data
- Dependency simulation
- Health endpoints
- Configurable timeouts
- Repeatable reset
Testability reviews
Ask how the required state will be created, how results will be observed, how failures can be simulated, and how tests can repeat without manual cleanup.