Magic principles in test automation: Misdirection

automation testing magic
Reading time: 1 minute, 40 seconds

This is a new entry in the series "Magic principles in test automation". Today, it is about direction and misdirection. To read the last one, please check out Magic principles in test automation: Clarity.

The Cambridge Dictionary defines "misdirection" (among others) as

the action of making people pay attention to the wrong thing, usually intentionally so that they will not notice something else

In magic, we use this as a form of disguise to mislead our spectators (but not confuse them!) in order to make them think that

  1. something unimportant is important
  2. something important is unimportant
  3. something is going to happen which has already happened
  4. something has already happened when it hasn't (yet)

When talking about misdirection, it is often perceived as an action to make people "look away" from the secret action. This is often not true as the strongest form of misdirection can be to channel a person's focus on a rather small area.

I have seen this phenomenon in software testing before, specifically the analysis of failures.

Often times, a rather obvious cause of a bug can only be seen when stepping back and looking at the big picture of an application: state, dependencies, infrastructure, service outages etc.

When looking at the failure, proximate stacktraces, error logs and even screenshots that were taken just milliseconds after a failure, there is a tendency to stay in this small perimeter. This leads to a phenomenon that can be described as "not seeing the wood for the trees".

This mostly unconscious behavior can be reinforced by bad software design decisions such as

  • logging unimportant information in a way that seems important
  • displaying cryptic error messages
  • cramming too much information into a test report
  • swallowing exceptions

Harry Houdini said once

What the eyes see and the ears hear, the mind believes.

and I could not agree more.


Previous Post Next Post