Cucumber (software)
Cucumber is a software tool that supports behavior-driven development (BDD).[src] Central to the Cucumber BDD approach is its ordinary language parser called Gherkin.[src] It allows expected software behaviors to be specified in a logical language that customers can understand.[src] As such, Cucumber allows the execution of feature documentation written in business-facing text.[src] It is often used for testing other software.[src] It runs automated acceptance tests written in a behavior-driven development (BDD) style.[src] Cucumber was originally written in the Ruby programming language and was originally used exclusively for Ruby testing as a complement to the RSpec BDD framework.[src] Cucumber now supports a variety of different programming languages through various implementations, including Java and JavaScript.[src] There is a port of Cucumber to .NET called SpecFlow, now superseded by Reqnroll.[src]
Cucumber is a software tool that supports behavior-driven development (BDD).[src] Central to the Cucumber BDD approach is its ordinary language parser called Gherkin.[src] It allows expected software behaviors to be specified in a logical language that customers can understand.[src] As such, Cucumber allows the execution of feature documentation written in business-facing text.[src] It is often used for testing other software.[src] It runs automated acceptance tests written in a behavior-driven development (BDD) style.[src] Cucumber was originally written in the Ruby programming language and was originally used exclusively for Ruby testing as a complement to the RSpec BDD framework.[src] Cucumber now supports a variety of different programming languages through various implementations, including Java and JavaScript.[src] There is a port of Cucumber to .NET called SpecFlow, now superseded by Reqnroll.[src] ==Gherkin language== Gherkin is the language that Cucumber uses to define test cases.[src] It is designed to be non-technical and human readable, and collectively describes use cases relating to a software system.[src] The purpose behind Gherkin's syntax is to promote behavior-driven development practices across an entire development team, including business analysts and managers.[src] It seeks to enforce firm, unambiguous requirements starting in the initial phases of requirements definition by business management and in other stages of the development lifecycle.[src] In addition to providing a script for automated testing, Gherkin's natural language syntax is designed to provide simple documentation of the code under test.[src] Gherkin currently supports keywords in dozens of languages.[src] ===Syntax=== Syntax is centered around a line-oriented design, similar to that of Python.[src] The structure of a file is defined using whitespace and other control characters.[src] Lines starting with # are considered comments, and can be placed anywhere in a file.[src] Instructions are any non-empty and non-comment line.[src] They consist of a recognized Gherkin keyword followed by a string.[src] All Gherkin files have the .feature file extension.[src] They contain a single Feature definition for the system under test and are an executable test script.[src] Here is an example of the syntax: Feature: Guess the word # The first example has two steps Scenario: Maker starts a game When the Maker starts a game Then the Maker waits for a Breaker to join # The second example has three steps Scenario: Breaker joins a game Given the Maker has started a game with the word "silky" When the Breaker joins the Maker's game Then the Breaker must guess a word with 5 characters ==Command line== Cucumber comes with a built-in command line interface that covers a comprehensive list of instructions.[src] Like most command line tools, cucumber provides the --help option that provides a summary of arguments the command accepts.[src] $ cucumber --help -r, --require LIBRARY|DIR Require files before executing the features.[src] --i18n LANG List keywords for in a particular language.[src] Run with "--i18n help" to see all languages.[src] -f, --format FORMAT How to format features (Default: pretty).[src] -o, --out [FILE|DIR] Write output to a file/directory instead of ...[src] Cucumber command line can be used to quickly run defined tests.[src] It also supports running a subset of scenarios by filtering tags.[src] $ cucumber --tags @tag-name The above command helps in executing only those scenarios that have the specified @tag-name .[src] Arguments can be provided as a logical OR or AND operation of tags.[src] Apart from tags, scenarios can be filtered on scenario names.[src] $ cucumber --name logout The above command will run only those scenarios that contain the word 'logout'.[src] It is also useful to be able to know what went wrong when a test fails.[src] Cucumber makes it easy to catch bugs in the code with the --backtrace option.[src] ==References==[src]
47 sentences · 47 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Cucumber (software)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/cucumber-software. Accessed 26 November 2026.
Chicago
"Cucumber (software)." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/cucumber-software.
APA
encyclopegia.org. (2026). Cucumber (software). Retrieved November 26, 2026, from https://encyclopegia.org/wiki/cucumber-software
Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON