In this article of the "Magic principles in test automation" series, I will talk about the concept of time lapse which is the key to powerful misdirection.
"Time lapse" can mean multiple things. In magic, the most common understanding is the passing of time between two states or events.
Imagine a classic effect in which the following happens:
There are multiple ways in which time lapse can strengthen or weaken this seemingly simple chain of events:
Phase 1:
Phase 2:
Phase 3:
When I started thinking about timing and the passing of time between two states of a system, two examples that popped into my mind were reporting and monitoring.
For monitoring and test reporting to be relevant, this needs to happen as closely to a failing test or application state as possible. Otherwise both might be outdated already when too much time passes between the incident and the notification.
Like in magic, there must also be enough time to register the failed state and compare it to the previous state before the next run happens (and potentially overwrites and overrides it).
If both conditions are not met, it results in no meaning.
Timing is important!
In order to improve test feedback, more and more "shifting left" is happening. That means that tests are moved closer to the software development lifecycle phase where they can provide quicker and more meaningful information in case of failure. It is closely related to the "test early, test often" and "fail fast, learn fast" mindset.
This technique only makes sense, though, if the feedback and communication channels are fast enough to provide real-time notification and insight into failures to not fall into the traps mentioned above.
Let me close with a great Albert Einstein quote that fits perfectly here:
The only reason for time is so that everything doesn’t happen at once.