So You Want to Write Test Automation Scripts — You Better Learn to Meditate

James Wheeler
5 min readApr 25, 2022

--

Peace, Balance, Meditation
Photo by Kyson Dana on Unsplash

Wait What — Meditation Helps Programmers

Yes! Meditation helps in many situations, including when programming

When you dive into learning a new skill you will hit road blocks, new and changing information, constantly updated ways of doing things, plus deadlines you have to meet.

And, although you are, in fact, expanding your knowledge base, it feels like your stuck in 2nd gear. Most humans first response when hitting these types of road blocks:

They turn to negative self talk

People will say things to themselves like:

  1. It worked last time
  2. It worked in my other test
  3. Why can’t I do this
  4. What’s wrong with my code
  5. It always works when so-and-so does it
  6. I’m no good at programming anyway
  7. Time to abandon this whole programming thing — it was doomed from the start
An abandoned car
Photo by Vicky Sim on Unsplash

Meditation Helps You Distance Yourself from the Challenge in Front of You

The problem you are facing is not your fault and it not a commentary on your worth as a being on this planet. Most every programmer at this stage in their career hit these same types roadblocks. Most felt this same frustration. And most of those programmers found solutions.

So what do I mean by meditation? I’ve actually heard this described in several different ways over the years, but rarely if ever without the words meditate or meditation. Common words and phrases include: clear your head, change your surroundings, or give yourself space.

I like those phrases, but would like to go one step further and make a call for actual meditative practices, however short. I’d recommend the following approach, which will likely take less time to do than to read through the steps I’ve outlined below:

Meditation Part One — Breath and Focus

Take a moment to relax and re-center yourself. These types of steps help me:

  1. Take a moment away from the problem, i.e., your code
  2. Take a few deep diaphragmatic breaths into the belly and appreciate the energy, power, and separation from the problem that gives you
  3. Change your focus. I especially like to focus on the natural world whenever possible. Watching the wind’s impact on a tree or a bird’s activities in a tree, observing how the snow and rain fall are all very inspiring for example. At times I enjoy thinking about the joy I’ve felt spending time with friends or family.
  4. If you’re able, walk out into the natural world and find something interesting on which your mind can directly focus and wonder about. If that’s not possible looking out a window will often do just fine.
  5. As you focus continue to breath as deeply into the belly as possible
  6. Continue for a couple of minutes at least and a bit longer if possible

Meditation Part Two — Positive Self Talk

Now that your body and mind are a bit more relaxed, you can move into positive self talk. Here are some phrases that help me:

  1. This is a solvable problem, I think, I’m pretty sure, yeah, it’s doable, even for a someone like me, i.e., a programmer who did not program the mars rover
  2. Others, perhaps many others, have solved this problem, so I probably can also solve this problem too
  3. I then take a moment to remember actual problem solving I’ve done, in programming if possible, but any problem will do
  4. It then helps me to ask: what would it feel like to be a kick-ass programmer? — taking a minute let feelings about great programmers I’ve observed or imagined sink into my soul. This may sound weird, but sometimes my problem solvers look like Mr. T, Apollo Creed, or Rocky. That may be because I wrestled in my younger days. Maybe you think of a cool super hero’s powers, an amazing animal’s skills, or famous scientist’s abilities, and that’s great too.

What I’m getting at with the last point and talking to yourself in a positive fashion is — you’ve got this.

Learning Programmer Compared to Learning to Ride a Bike

If we compare programming to learning to ride a bike, I think we can find some helps as well and you’ll understand the types of positive self talk you need to succeed at programming test automation scripts.

  1. First you saw someone ride a bike and thought that looks awesome
  2. Or, you rode as a passenger on a bike and felt the wind at your face and loved the exhilaration
  3. Then, you felt in your heart that bike riding was for you
  4. And so you found a way to gain access to a bike
  5. Then as you started riding, you fell down a lot and it didn’t look much like riding a bike at all, but you didn’t care, because of your one desire to get this thing done. Okay, admittedly, there were days where the falls impacted you, but after recovering from those tears and the pain, you realized crying about the falls doesn’t help. You thought something like, I just need to be better at falling, so I can get back on the bike more quickly.
  6. And then you had great moments, where you were riding a bike with the wind at your face, your heart racing and joy and power surging through your legs. It felt awesome and you wanted more, so you kept learning and kept riding, getting better and more confident each time.

Programming can be just as exhilarating as riding a bike.

So, learn how to get through the painful moments, how to re-focus your energies on becoming a great programmer. Meditative practices can help here. Use them to re-center yourself and re-focus your attention on the opportunity, not the temporary roadblock.

Girls on a bicycle
Photo by Vitolda Klein on Unsplash

Now that Some of the Worry is Gone — Get to Solving that Problem

After meditating your heart and mind and body should be a bit calmer. One of the first things you’ll notice once you’re feeling more at ease: the worry and associated stress distracted you from the normal steps you follow solve problems. You’re a great problem solver. You got to this point in your journey by solving many problems and probably by helping others to solve problems too.

Now that your mind is clearer and more positive self-talk is present, you can get down to the hard word of solving the problem, reminding yourself that the challenge of solving problems is great fun.

To help you specifically with programming test automation scripts, I highly recommend creating and following a programmer’s problem solving checklist. You’ve used similar checklists in software testing for years, now you just need to do the same for programming.

For ideas on building that checklist, check out my article: building a programmer’s problem solving checklist.

Difficult roads lead to beautiful destinations
Photo by Hello I’m Nik on Unsplash

--

--