Open-source News

How the Gherkin language bridges the gap between customers and developers

opensource.com - Tue, 02/07/2023 - 16:00
How the Gherkin language bridges the gap between customers and developers David Blackwood Tue, 02/07/2023 - 03:00

Communicating with software developers can often be a burdensome task, especially when people lack technical knowledge and technical vocabulary. This is why project managers often use user stories and the versatile system metaphor.

You can assist communication further by utilizing technology designed to facilitate discussions between a project's stakeholders and developers.

The Cucumber framework

Cucumber is an open source framework that enables the creation of automated software tests using an easy-to-write and common language. It's based on the concept of behavior-driven development (BDD), which dictates that creating software should define how a user wants an application to behave when specific conditions are true.

The Cucumber framework isn't "technology" in the modern sense. It's not a collection of bits and bytes. Instead, it's a way of writing in natural language (English, in the case of this article, but so far Gherkin has been translated to over 70 languages). When using the Cucumber framework, you aren't expected to know how to read or write code. You only need to be able to write down ideas you have about how you work. You should also document how you want technology to work for you, using a set of specific terms and guidelines.

What is the Gherkin language?

Cucumber uses Gherkin as a means to define use cases. It's primarily used to generate unambiguous project requirements. In other words, its purpose is to allow users to describe precisely what they require software to do, leaving no room for interpretation or exception. It helps you think through the process of a transaction with technology and then helps you write it down in a form that translates into programmer logic.

Here's an example:

Feature: The Current Account Holder withdraws money Scenario: The account in question is not lacking in funds Given that the account balance is £200 And the debit card is valid And the cash machine contains enough money When the Current Account Holder requests £50 Then the cash machine dispenses £50 And the account balance is £150 And the debit card is returned

As you can see, this is a highly specific scenario in which an imaginary user requests £50, and the ATM provides £50 and adjusts the user's account balance accordingly. This scenario is just one part of an ATM's purpose, and it only represents a specific component of a person's interaction with a cash machine. When a programmer is given the task to program the machine to respond to a user request, this clearly demonstrates what factors are involved.

What are Gherkin keywords?

The Gherkin syntax makes use of five indispensable statements describing the actions needed to perform a task:

  • Feature: denotes a high-level description of any given software function

  • Scenario: describes a concrete example

  • Given: explains the initial context of the system

  • When: specifies an event or action

  • Then: describes an expected outcome, or a result

  • And (or but): increases text fluidity

By making use of these simple keywords, customers, analysts, testers, and software programmers are empowered to exchange ideas with terminology that's recognizable by all.

More DevOps resources What is DevOps? The ultimate DevOps hiring guide DevOps monitoring tools guide A guide to implementing DevSecOps Download the DevOps glossary eBook: Ansible for DevOps Latest DevOps articles Executable requirements and automated testing

Even better, Gherkin requirements are also executable. This is done by mapping each and every keyword to its intended (and clearly stated) functionality. So, to keep with the example above, anything already implemented could automatically be displayed in green:

When the Current Account Holder requests £50* Then the cash machine dispenses £50* And the account balance is £150 And the debit card is returned

By extension, Gherkin enables developers to translate requirements into testable code. In practice, you can use specific phrases to check in on your software solutions! If your current code isn't working properly, or a new change has accidentally caused a software error (or two or three) then you can easily pinpoint problems before proceeding to repair them.

Conclusion

Thanks to the Gherkin syntax, your customers will no longer be in a pickle. You can bridge the divide between businesses and developers and deliver outstanding products with greater confidence than ever before.

Find out more about Gherkin by visiting the Cucumber website or its Git repository.

The Gherkin syntax helps you think through the process of a transaction with technology and then helps you write it down in a form that translates into programmer logic.

Image by:

Melissa Hogan, CC BY-SA 4.0, via Wikimedia Commons

DevOps What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

How to Install Mono (Microsoft’s .NET Framework) in RHEL Systems

Tecmint - Tue, 02/07/2023 - 15:54
The post How to Install Mono (Microsoft’s .NET Framework) in RHEL Systems first appeared on Tecmint: Linux Howtos, Tutorials & Guides .

Mono is a free, open-source, and cross-platform implementation of Microsoft’s .NET framework, which runs on Linux, macOS, BSD, and Windows and supports various CPU architectures such as x86, ARM, PowerPC, and more. Mono enables

The post How to Install Mono (Microsoft’s .NET Framework) in RHEL Systems first appeared on Tecmint: Linux Howtos, Tutorials & Guides.

X.Org Server Hit By New Local Privilege Escalation Vulnerability

Phoronix - Tue, 02/07/2023 - 13:00
The X.Org Server keeps on giving when it comes to security vulnerabilities with its massive, aging, and ill-maintained code-base. Disclosed on Monday night was CVE-2023-0494 as the latest security advisory and another discovery by the Trend Micro Zero Day Initiative...

Qualcomm Cloud AI 100 Driver Updated For Linux's New Accelerator Subsystem

Phoronix - Tue, 02/07/2023 - 07:29
Qualcomm's Cloud AI 100 inference accelerator that features up to sixteen cores and focused on AI needs at the edge of data centers continues on a trek toward having mainline Linux kernel support...

Linux 6.3 Preparing Support For Arm's Scalable Matrix Extension 2 (SME2)

Phoronix - Tue, 02/07/2023 - 05:30
While initial Scalable Matrix Extension (SME) support for the Linux kernel only was mainlined last year to the kernel tree, Arm already has SME 2 and SME 2.1 support on the way to mainline...

Noctua NH-L9a-AM5 Low-Profile Heatsink Works Great For 2U AMD Ryzen AM5 Servers

Phoronix - Tue, 02/07/2023 - 03:10
Noctua at the end of January announced the NH-L9a-AM5 and the all-black NH-L9a-AM5 chromax.black heatsinks as their new ultra low-profile active CPU coolers for the AMD AM5 socket that support AMD's recently announced Ryzen 7000 series 65 Watt CPUs. The height with fan at only 37 mm makes the new NH-L9a-AM5 heatsinks work out very well for small form factor (SFF) builds and for our case at Phoronix an instant hit for running the new AMD Ryzen processors within 2U rackmount enclosures.

Pages