BDD — Gauge Framework

Ali KAYA
5 min readMay 15, 2023

--

The BDD approach was first introduced by Dan North in 2009. BDD, which stands for Behavior Driven Development, emerged to remove the complexity of the TDD(Test Driven Development) approach. The purpose of developing the BDD approach is to increase the readability of the test for all stakeholders. In this way, all stakeholders including analysts, customers-which are generally inside the company- product divisions, and managers can follow the testing processes. Projects appear in document format to easy read by stakeholders in the team. This means stakeholders read the BDD project as a document instead of automation codes.

-This article contains not Selenium, Junit, or Java codes but talks about Bdd working logic.

BENEFİTS:

  • Improve cooperation: The reason for this is the high readability of test scenarios. Stakeholders can give each other more feedback as the scenarios are written in non-technical language. Because of that all of them can contribute scenario steps, assertions, and controls.
  • Correlation between scenarios and code: With the BDD approach, testers can design their scenarios the same as test management tools. Test managers or test leads can check all test scenarios and automation scripts thanks to BDD. To illustrate I can give a TestRail example which is commonly used by testers to test scenario execution and writing. Like in your TestRail scenarios, step by step you can move your scenarios to automation without losing among all the complicated codes.
  • Sustainable automation tests: A test is a long-run task and process in the test object and product. When testers want to look back and fix their scenarios and scripts, can do that. Besides analysts, SM or PO can change scenario steps without the need for automation framework knowledge and research.

GAUGE

Gauge is an open-source test automation framework that supports the Markdown standard and many platforms. In order to write automation tests, it uses Markdown, which is a fast and easy way to take notes, create content for a website, and produce print-ready documents. Markdown is the ideal syntax for taking notes. Markdown language contains such as — — , ===, ## status. Each of them has functions. Gauge supports a lot of programming languages like Java, Javascript, and Ruby and supports a lot of IDE like IntelliJ and Visual Studio.

Gauge is not an alternative to Selenium. There are no actions like attributes to control the browser moving in Selenium. While using Gauge, you need to use libraries like Selenium or Appium.

1. Easy to set up: Firstly you must have a programming language like Java then go to the Gauge website and follow the installation steps.

Open your IDE, for example, IntelliJ Idea, and create a new project, choose Maven then click create from archetype and select Gauge and click the next button. If you don’t have any Gauge archetype you can click Add Archetype button by providing groupId, ArtifacId, and the version you can add the Gauge archetype.

To add an archetype you can check mvn repository website. Additionally, for Vs Code you can check the extensions and install Gauge first.

2. Easy to learn: Gauge is a framework and the framework presents a template to us. Gauge template works with specification and concept. Specs are a big part of Gauge which is service creating scenario steps. The concept is for a small part of this framework, if you use step blocks more than once you can move them into concepts. When you want to maintain your scenarios steps you can easily fix them with concepts. Just change steps into concept and specs will change already.

3. Then you can start to create your scenarios into specs. The header section has to be a big mark. For concepts, each word can start with a big mark to separate them from common steps. Tags must be unique. Scenario names have to describe your specific scenario name, it should be unique since someone or you can forget what the scenario is. I have a question for you. What is the beginning of automation scenarios design? You have to manually test first. With your eye and the capacity of your brain, you need to plan all steps. After that, you need a test management tool or something like that. Save all your scenarios and their steps. Thereby you design all the scenarios. Let me give you an example; imagine the youtube website.What would you test? How do you begin it? Generally, not one tester but many testers are responsible for the big website or mobile applications like youtube. Assume that you are responsible for subscription service.

-First, look into your subscription area, how to use it, and what it is for. Then plan your scenarios. After that phase, you can start to scenario steps. Now you can pass to the automation side as you determine your scenario steps and check to application with your fingers and eyes. I’ll give a simple scenario example:

-Secondly, The scenario contains functional processes, assertions, and fill in the textboxes just like your manual test steps. When someone reads the steps pictured above they can get it easy. No need for automation knowledge. This is like talking sentences. Of course, all the sentences have selenium and java methods in the background but it is not important for reader-only people. This article is not about Selenium and Java so I am not going to explain how to create step implementations and methods.

As you see, Gauge(BDD) provides all the conditions and benefits that we count above such as easily readable, easy step creations, and easy maintenance.

Thanks for reading the article :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Ali KAYA
Ali KAYA

Written by Ali KAYA

Software QA at Nesine.com. Quality Assurance, researcher, debater. Love the world, love the animals.

No responses yet

Write a response