Keyword-Driven Testing: A Fun and Informative Guide

Keyword-driven testing (KDT) is a software testing approach that uses a set of predefined keywords to represent user actions within a software application.

Mentor

Blog

Let’s imagine we’re building a robot to test a pizza-making machine! Our robot, named PizzaTesto, loves pizza and is super excited to help ensure that every pizza made by the machine is perfect.

  1. Keyword Library
    • “SpreadSauce”: Spreads the pizza sauce
      • “AddToppings”: Puts toppings like cheese, chicken, and veggies on the pizza
        • “BakePizza”: Puts the pizza into the oven and bakes it
          • “SlicePizza”: Cuts the pizza into slices
            • “DeliverPizza”: Moves the pizza to the delivery area

              2. Test Script: PizzaTesto’s “recipe book” is like an Excel sheet with rows of instructions, each using these keywords.

              Image

              3. Test Execution: PizzaTesto reads the recipe book and follows the instructions, using its robot arms and sensors to interact with the pizza machine. It spreads sauce, adds toppings, bakes the pizza, slices it, and delivers it to the table.

              Now, imagine PizzaTesto gets a new recipe for a different type of pizza. Instead of rewriting the entire process, we just need to update PizzaTesto’s recipe book with the new keywords and details, like using pesto sauce instead of tomato sauce and adding different toppings.

              And just like that, PizzaTesto can keep testing pizzas like a pro, all thanks to its keyword-driven approach!