Given that [[Engineers are probably your biggest cost]] and writing tests is a time consuming activity, you need to decide what cases are worth writing tests for in the first place.
To answer this, it helps to think in terms of the risks of each of the [[Failure mode]]s that the [[System under test]] can encounter. You can attempt a rough measurement of the risk level of a failure mode using the following formula:
Risk level = Probability x Severity
The **Probability** factor is the likelihood of the failure mode occurring in the production system.
The **Severity** is a measure of the impact on the perceived system quality (e.g. from the perspective of end users or other stakeholders) if the failure mode does occur.
## #OpenQuestions
- Only the risk aspect is described above and this isn't sufficient to answer the title question. Other factors such as the effort required to write a test to detect this failure mode need to be accounted for.
- Is this useful in the absolute or only as a relative measurement? How does one then use the risk level to decide whether or not to write a test?
---
## References
- [Failure Mode and Effects Analysis (wiki)](https://en.wikipedia.org/wiki/Failure_mode_and_effects_analysis)