Automated Tests And Keyword-Driven Testing

Test automation is an important part of developing software solutions under a continuous integration model. Test scripts, which are developed at the same time as the software solution itself, are executed regularly to quickly detect bugs or identify areas where the application has regressed because of new code that’s been added.

Since a software solution changes and evolves throughout development, being able to update and revise test scripts quickly and efficiently is very important. After all, our main goal is to save time and money, which flexible test scripts can help us do.

This is where keyword-driven testing comes into play.

Wait, what’s “Keyword-driven testing?”

Let’s say you’re in charge of writing scripts that will automate all tests for a web platform. You’ll start by writing test scenarios, which you’ll then convert into code, in a programming language like Python or Groovy. Your test scenarios will be broken down into simple steps and operations. Each operation will describe an action that the script should perform without going too deeply into technical details. Essentially, these test scenarios will resemble instructions that you would give to a human user so that he or she could test your software solution manually.

As you can see, there are have two distinct processes. The first involves writing test scenarios, and the second involves fleshing out the programming scripts that will execute these scenarios. What makes keyword-driven testing so interesting and so advantageous is that it unifies these two processes.

What exactly makes keyword-driven testing so awesome?

Keyword-driven testing greatly reduces the amount of time and energy needed to develop test scripts. Each keyword represents a simple sentence that can be reused in multiple test scenarios. For example, if we create a keyword related to pressing a button, we can then reuse that keyword in any scenario that involves a button being pressed, without having to write a single additional code line.

In other words, since each keyword represents an individual operation within a test scenario, revising or updating our test scripts is therefore fairly simple. To add a new operation to a test scenario, all we have to do is insert the correct keyword at the right place. To remove an operation, we simple the delete the corresponding keyword.

Results are precise and easy to parse. If a bug is detected somewhere in the software solution, the script fails and indicate which keyword caused a problem. Since the keyword corresponds to a specific operation within the test scenario, it’s very easy for the development team to figure out what went wrong and how to fix it.

What do I gain from using keyword-driven testing?

In a nutshell: Less time and energy is needed to flesh out, revise and update test scripts, which allows you to create more test scripts overall and work more easily towards fully automating all tests.

Software quality is very important for everyone at Askida. The best way to ensure that our team delivers a final product we can be proud off is to test everything thoroughly all throughout development. The more test scripts we have, the more bugs will be identified and fixed before the software solution is delivered, which, of course, guarantees better software quality.

Image Olivier Verville

Olivier Verville

Olivier Verville est un développeur chez Askida // Olivier Verville is a developer at Askida