Programming is the Foundation for Automation

Getting Started — Published September 6, 2021

“Programming is hard!”

“Automation is difficult!”

“Test automation scripts require programming, so you can’t do it.”

These were all statements I heard before diving into automation. The problem was I believed them. Never mind the fact that I graduated with a Computer Information Systems (CIS) degree that involved programming courses each semester. Other people’s fears and doubts influenced how I viewed the world of programming/automation.

Nervous of the unknown delayed my attempt to learn automation. I procrastinated for over a year. Fortunately, my procrastination changed after I joined a company that heavily recommended testers to learn automation. Back then, UFT formerly known as QTP was the most popular automation tool. It was the de facto industry standard for automation. 

Upon learning QTP, I soon realized automation was a cool skill to have in my testing tool kit. It was not as hard as I thought. Reminiscing on those negative statements, I should have never assumed programming/automation was insurmountable. It’s exciting to create test scripts and watch them execute.

However, they were right: to be effective at creating test automation scripts, you must learn how to program. 

Programming is the foundation for automation

Like most endeavors, things are hard when you first start. However, with practice, practice, and more practice, anything is possible. 

I’m sure you’ve heard the phrase “practice makes perfect”. That’s true for some cases but not with programming/automation. Practice makes improvement when creating our test automation scripts. I’m not sure if the most seasoned automation engineer will ever become perfect with automation. 

Why is Programming the Foundation For Test Automation

Programming is the foundation because automation principles are derived from programming concepts. 

Programming languages contain syntax which is a combination of words, rules, and symbols to complete a code statement. If the syntax is incorrect then the program will not execute. It’s valuable to begin with the fundamentals of programming then progress to advanced topics like Object Oriented Programming (OOP). 

The OOP concepts are another reason why programming is the foundation for automation. A thorough understanding of OOP’s help with creating design patterns and frameworks. A popular design pattern is Page Object Model which promotes code readability and code maintainability. Code readability means the code is clear to follow. It’s clear to follow because the names are descriptive with less lines of code. Code maintainability means it will take less time to update our code.  

The Benefits of Knowing How to Program

An overlooked benefit of programming is the ability to sharpen our problem solving skills. Problem solving is important because it provides a process of finding solutions to complex situations. Sometimes those situations are unpredictable.  

In addition to problem solving, is the competence to communicate with developers and attend code reviews. Effective communication produces trust and builds better relationships with developers and other technical team members. Code reviews are a good practice to examine source code, share knowledge, receive knowledge, and find defects early. 

The main benefit of programming is directly related to automation. It helps minimize the struggle with developing clean code. Even spaghetti code which has little structure can function and execute a test script. However, clean code consists of certain practices and patterns which comes with grasping the programming concepts. It’s tempting for a future automation engineer to bypass programming and jump straight to automation. However, it’s not recommended because programming prepares a foundation for automation. 

The Benefits of Automation

There are many benefits of automation. A practical acronym that explains automation is FEAR:

  •  Fast 
  • Efficient 
  • Accurate 
  • Repeatable

Once the test scripts are written, they’ll execute much faster than a human could execute the same scenario.. If the test script is implemented with best practices, then it should also be efficient. There’s a case to be made if they are always accurate but no doubt test automation scripts are repeatable. 

Another important benefit of automation is job opportunities. Nowadays, many companies ask automation questions during an interview although the job does not depend on automation. That’s strange but it happens a lot. 

It’s the same with job postings which request automation experience when the role does not require automation. As a result, a candidate with automation on their resume increases their chances of landing an interview to possibly land the job. 

A myth regarding automation is that test automation replaces functional testing.  That’s not true. In reality,  automation supports functional testing and will not replace it. Automation is an extra skill to add to your testing experience.   

Programming and Automation

If you’re interested in automation, then consider programming as a prerequisite. It’s a decision savvy automation engineers learned before creating robust design patterns and frameworks. I’m not suggesting a particular programming language but seek to understand the concepts. Once you learn the concepts of one language then those same concepts are transferable to other languages. 

There are many programming languages to choose from. The most popular choices in no specific order are JavaScript, Python, Java, and C#. People often ask, “which programming language is the easiest or which programming language is the best?” I’m not sure but I know programming is the foundation for automation. 

To learn how to program, check out these free courses on Test Automation University:

Java Programming
JavaScript Programming
Python Programming

Are you ready?

Get started Schedule a demo