Fast and Furious - Fail Fast

We’ve all heard the phrase fail fast. Also, fail fast, fail often; or fail fast, succeed faster has been around for years. Fail fast suggests that if it is possible to learn from a specific failure, the sooner the failure occurs, the learning can start as quickly as possible.

Invalid inputs to a system are a common source of problems in applications. Sometimes, these problems are persisted, resulting in a corrupt or invalid state. Because of that, the resulting state can not be avoided or fixed and can cause an unresponsive and resource-consuming system.

Failing fast allows getting quick feedback about what works and what does not to adjust the project development plans accordingly.

Practices like defensive programming and patterns like guard clauses are frequently applied to follow the fail-fast principle.

A common way to apply defensive programming is by verifying inputs to individual function or method code to check itself as it runs.

Guard clause, guard code, or guard statement, is a check of integrity preconditions used to avoid errors during execution.

The defensive programming uses a set of guard statements.

Fail fast doesn’t just apply to the coding. In today’s complex business environment, speed of execution is a lot more important than perfect execution. For example, after launching a new product, the constant interplay between feedback from the market and adaptation of features can speed the quality improvement.