{"id":71033,"date":"2023-02-07T09:02:01","date_gmt":"2023-02-07T09:02:01","guid":{"rendered":"https:\/\/www.cryptocabaret.com\/?p=71033"},"modified":"2023-02-07T09:02:01","modified_gmt":"2023-02-07T09:02:01","slug":"how-the-gherkin-language-bridges-the-gap-between-customers-and-developers","status":"publish","type":"post","link":"https:\/\/www.cryptocabaret.com\/?p=71033","title":{"rendered":"How the Gherkin language bridges the gap between customers and developers"},"content":{"rendered":"<p><span class=\"field field--name-title field--type-string field--label-hidden\">How the Gherkin language bridges the gap between customers and developers<\/span><br \/>\n<span class=\"field field--name-uid field--type-entity-reference field--label-hidden\"><a title=\"View user profile.\" href=\"https:\/\/opensource.com\/users\/david-blackwood\" class=\"username\">David Blackwood<\/a><\/span><br \/>\n<span class=\"field field--name-created field--type-created field--label-hidden\">Tue, 02\/07\/2023 &#8211; 03:00<\/span><\/p>\n<div class=\"clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item\">\n<p>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 <a href=\"https:\/\/softwareplanetgroup.co.uk\/user-stories-bridging-the-gap-between-customers-and-developers-updated\/\" target=\"_blank\" rel=\"noopener\">user stories<\/a> and the versatile system metaphor<em>.<\/em><\/p>\n<p>You can assist communication further by utilizing technology designed to facilitate discussions between a project&#8217;s stakeholders and developers.<\/p>\n<h2>The Cucumber framework<\/h2>\n<p>Cucumber is an open source framework that enables the creation of automated software tests using an easy-to-write and common language<em>.<\/em> It&#8217;s based on the concept of <a href=\"https:\/\/opensource.com\/article\/19\/2\/behavior-driven-development-tools\" target=\"_blank\" rel=\"noopener\">behavior-driven development (BDD)<\/a>, which dictates that creating software should define how a user wants an application to behave when specific conditions are true.<\/p>\n<p>The Cucumber framework isn&#8217;t &#8220;technology&#8221; in the modern sense. It&#8217;s not a collection of bits and bytes. Instead, it&#8217;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&#8217;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.<\/p>\n<h2>What is the Gherkin language?<\/h2>\n<p>Cucumber uses Gherkin as a means to define use cases. It&#8217;s primarily used to generate unambiguous project requirements<em>.<\/em> 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.<\/p>\n<p>Here&#8217;s an example:<\/p>\n<pre>\n<code class=\"language-text\">Feature: The Current Account Holder withdraws money\nScenario: The account in question is not lacking in funds\nGiven that the account balance is \u00a3200\nAnd the debit card is valid\nAnd the cash machine contains enough money\nWhen the Current Account Holder requests \u00a350\nThen the cash machine dispenses \u00a350\nAnd the account balance is \u00a3150\nAnd the debit card is returned<\/code><\/pre>\n<p>As you can see, this is a highly specific scenario in which an imaginary user requests \u00a350, and the ATM provides \u00a350 and adjusts the user&#8217;s account balance accordingly. This scenario is just one part of an ATM&#8217;s purpose, and it only represents a specific component of a person&#8217;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.<\/p>\n<h3>What are Gherkin keywords?<\/h3>\n<p>The Gherkin syntax makes use of five indispensable statements describing the actions needed to perform a task:<\/p>\n<ul>\n<li>\n<p><strong>Feature<\/strong>: denotes a high-level description of any given software function<\/p>\n<\/li>\n<li>\n<p><strong>Scenario<\/strong>: describes a concrete <em>example<\/em><\/p>\n<\/li>\n<li>\n<p><strong>Given<\/strong>: explains the initial context of the system<\/p>\n<\/li>\n<li>\n<p><strong>When<\/strong>: specifies an event or action<\/p>\n<\/li>\n<li>\n<p><strong>Then<\/strong>: describes an expected outcome, or a result<\/p>\n<\/li>\n<li>\n<p><strong>And (or but)<\/strong>: increases text fluidity<\/p>\n<\/li>\n<\/ul>\n<p>By making use of these simple keywords, customers, analysts, testers, and software programmers are empowered to exchange ideas with terminology that&#8217;s recognizable by all.<\/p>\n<\/p>\n<div class=\"embedded-resource-list callout-float-right\">\n<div class=\"field field--name-title field--type-string field--label-hidden field__item\">More DevOps resources<\/div>\n<div class=\"field field--name-links field--type-link field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/resources\/devops?intcmp=7013a00000263HlAAI\">What is DevOps?<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/devops-hiring-guide?intcmp=7013a00000263HlAAI\">The ultimate DevOps hiring guide<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/devops-monitoring-guide?intcmp=7013a00000263HlAAI\">DevOps monitoring tools guide<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/guide-implementing-devsecops?intcmp=7013a00000263HlAAI\">A guide to implementing DevSecOps<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/enterprisersproject.com\/cheat-sheet-devops-glossary?intcmp=7013a00000263HlAAI\">Download the DevOps glossary<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/www.ansible.com\/resources\/ebooks\/ansible-for-devops?intcmp=7013a00000263HlAAI\">eBook: Ansible for DevOps<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/devops?intcmp=7013a00000263HlAAI\">Latest DevOps articles<\/a><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<h2>Executable requirements and automated testing<\/h2>\n<p>Even better,<em> Gherkin requirements are also executable.<\/em> This is done by mapping each<em> <\/em>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:<\/p>\n<pre>\n<code class=\"language-text\">When the Current Account Holder requests \u00a350*\nThen the cash machine dispenses \u00a350*\nAnd the account balance is \u00a3150\nAnd the debit card is returned\n<\/code><\/pre>\n<p>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&#8217;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.<\/p>\n<h2>Conclusion<\/h2>\n<p>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.<\/p>\n<p>Find out more about Gherkin by visiting the <a href=\"https:\/\/cucumber.io\/docs\/gherkin\/\" rel=\"noopener\" target=\"_blank\">Cucumber website<\/a> or its <a href=\"https:\/\/github.com\/cucumber\/docs\" rel=\"noopener\" target=\"_blank\">Git repository<\/a>.<\/p>\n<\/div>\n<div class=\"clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item\">\n<p>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.<\/p>\n<\/div>\n<div class=\"field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item\">\n<article class=\"media media--type-image media--view-mode-caption\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2023\/02\/practicing-empathy-1.jpg\" width=\"1024\" height=\"576\" alt=\"Practicing empathy\" title=\"Practicing empathy\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>Melissa Hogan, <a href=\"https:\/\/creativecommons.org\/licenses\/by-sa\/4.0\" rel=\"ugc\">CC BY-SA 4.0<\/a>, via Wikimedia Commons<\/p>\n<\/div>\n<\/article>\n<\/div>\n<div class=\"field field--name-field-tags field--type-entity-reference field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/devops\" hreflang=\"en\">DevOps<\/a><\/div>\n<\/p><\/div>\n<div class=\"hidden field field--name-field-listicle-title field--type-string field--label-hidden field__item\">What to read next<\/div>\n<div class=\"field field--name-field-default-license field--type-list-string field--label-hidden field__item\"><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><br \/>\n        <img decoding=\"async\" alt=\"Creative Commons License\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2023\/02\/cc-by-sa-4-9.png\" title=\"This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.\"><\/a>This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.<\/div>\n<section class=\"field field--name-field-comments field--type-comment field--label-hidden comment-wrapper\">\n<div class=\"comments__count\">\n<div class=\"login\"><a href=\"https:\/\/opensource.com\/user\/register?absolute=1\">Register<\/a> or <a href=\"https:\/\/opensource.com\/user\/login?destination=\/feed&amp;absolute=1\">Login<\/a> to post a comment.<\/div>\n<\/p><\/div>\n<\/section>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\" rel=\"noopener\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How the Gherkin language bridges the gap between customers and developers David Blackwood Tue, 02\/07\/2023 &#8211; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":71034,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[307],"tags":[],"class_list":["post-71033","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source"],"_links":{"self":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/71033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=71033"}],"version-history":[{"count":0,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/71033\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/media\/71034"}],"wp:attachment":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=71033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=71033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=71033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}