Recipes for Test Automation (Part 1) – Soup

Ingredients, appliances, and who is the chef?

A colleague recently approached me and asked me whether I know a recipe for good test automation. I told him that, just like with a good soup, it takes more than a recipe: The kitchen appliances, ingredients, and the cook are important as well. Accordingly, the project framework, the selection of the test tools, and the testers involved in the test automation are decisive in test automation.

How do we find out if the framework is right for test automation? Generally speaking, we have to differentiate between software projects that are still in the pre-planning stage where test automation is planned from the start, and projects that are already underway, where test automation is intended to support the project.

First of all: The earlier well-planned test automation is started, the more likely it will be successful. This is often due to the fact that the initial effort involved in test automation is underestimated, and the benefits, in terms of figures at least, are not reaped until after the project has been completed.

To counter this, a project that is about to start requires good planning, and a project in progress requires a preliminary study of the ongoing processes, test cases, and framework. Such a preliminary study is used to analyze and evaluate the existing test case portfolio, the test object and the testers’ knowledge, among other aspects. This way, we can identify the project’s true weaknesses in the field of testing.

Test automation is often used to try and solve problems that have nothing to do with the test automation, and that can sometimes even be exacerbated by it. Just like with cooking: When the soup tastes bad, replacing the cook with an automaton will not necessarily improve it. The result will, in fact, often be even worse—just think of the coffee maker out in the hallway. It is important to ensure that the prerequisites for the test automation have reached a minimum quality before you can start selecting the tools or begin the actual automation. Test automation is the dab of cream that tops off the soup, i.e. test automation can only be successful with a well-functioning test process. The test cases also need a sufficient level of detail for automation The level of detail required depends on the level of technical know-how the tester has in regard to the test object. Some people might suggest that the technical department, i.e. those who have the technical know-how, could carry out the test automation. However, that is usually not a good idea because these colleagues cannot spare the time. On the one hand, their everyday work always comes before the test automation in terms of priorities, and on the other hand, they would need to gain proficiency in the use of the tools and testing experience first. Therefore, the technical department should preferably provide the manual test cases with a sufficient level of detail that the tester understands even without knowledge of the domain. The tester then uses their testing experience and knowledge of the tools to carry out the automation.

It is illusory to believe that you can automate everything, which is why the test cases are prioritized in the preliminary study. In this context, it must be checked whether the test object or the software that is to be tested can be automated. Dynamic object IDs that change every time they are requested, for example, pose a particular challenge in test automation.

And then, like the cook in the kitchen, the tester who carries out the test automation also plays an important role. Firstly, they need the necessary knowledge of the tools, and secondly, they have to be able to decide where, specifically, test automation is worthwhile. For example, it makes no sense to automate a feature of the software that is rarely needed, yet takes great effort to automate.

This is why you should always adhere to the recipe:

  • Use common sense and an instinct for the effort involved to create a harmonious composition: Keep an eye on the cost and benefits.
  • Do not rely on technology alone: Your craftsmanship is important as well.
  • Test automation only works if the basic test tasks and processes work first: First, you learn to slice and dice onions, then you get to work on the bouillabaisse.

The test data are another challenge in test automation. I will address this issue in my next blog post. Until then: Happy Holidays—and don’t rely on some machine to prepare your Christmas dinner.

This post was written by: