This article needs additional citations for verification .(October 2016) |
Developer(s) | Aslak Hellesøy, [1] Joseph Wilk, [2] Matt Wynne, [3] Gregory Hnatiuk, [4] Mike Sassak [5] |
---|---|
Stable release | |
Repository | |
Written in | Ruby |
Operating system | Cross-platform |
Type | Behavior driven development framework / Test tool |
License | MIT License |
Website | cucumber |
Cucumber is a software tool that supports behavior-driven development (BDD). [7] [8] [9] [10] [11] [12] Central to the Cucumber BDD approach is its ordinary language parser called Gherkin. It allows expected software behaviors to be specified in a logical language that customers can understand. As such, Cucumber allows the execution of feature documentation written in business-facing text. [13] [7] [8] It is often used for testing other software. [14] It runs automated acceptance tests written in a behavior-driven development (BDD) style. [15]
Cucumber was originally written in the Ruby programming language. [7] [16] [8] and was originally used exclusively for Ruby testing as a complement to the RSpec BDD framework. Cucumber now supports a variety of different programming languages through various implementations, including Java [17] [8] and JavaScript. [18] [19] There is a port of Cucumber to .NET called SpecFlow, [20] [21] [22] now superseded by Reqnroll. [23]
Gherkin is the language that Cucumber uses to define test cases. It is designed to be non-technical and human readable, and collectively describes use cases relating to a software system. [7] [8] [24] [25] The purpose behind Gherkin's syntax is to promote behavior-driven development practices across an entire development team, including business analysts and managers. 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.
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. [25] Gherkin currently supports keywords in dozens of languages. [25] [26] [7] [8]
Syntax is centered around a line-oriented design, similar to that of Python. The structure of a file is defined using whitespace and other control characters. [25] Lines starting with #
are considered comments, and can be placed anywhere in a file. [25] Instructions are any non-empty and non-comment line. They consist of a recognized Gherkin keyword followed by a string. [27]
All Gherkin files have the .feature
file extension. They contain a single Feature definition for the system under test and are an executable test script. [27]
Here is an example of the syntax: [28]
Feature: Guess the word # The first example has two stepsScenario: Maker starts a game When the Maker starts a gameThen the Maker waits for a Breaker to join # The second example has three stepsScenario: Breaker joins a game Given the Maker has started a game with the word "silky"When the Breaker joins the Maker's gameThen the Breaker must guess a word with 5 characters
Cucumber comes with a built-in command line interface that covers a comprehensive list of instructions. Like most command line tools, cucumber provides the --help
option that provides a summary of arguments the command accepts. [29]
$ cucumber--help -r, --require LIBRARY|DIR Require files before executing the features. --i18n LANG List keywords for in a particular language. Run with "--i18n help" to see all languages. -f, --format FORMAT How to format features (Default: pretty). -o, --out [FILE|DIR] Write output to a file/directory instead of ...
Cucumber command line can be used to quickly run defined tests. It also supports running a subset of scenarios by filtering tags.
$ cucumber--tags@tag-name
The above command helps in executing only those scenarios that have the specified @tag-name
. [29] Arguments can be provided as a logical OR
or AND
operation of tags. Apart from tags, scenarios can be filtered on scenario names. [29]
$ cucumber--namelogout
The above command will run only those scenarios that contain the word 'logout'.
It is also useful to be able to know what went wrong when a test fails. Cucumber makes it easy to catch bugs in the code with the --backtrace
option. [29]
Io is a pure object-oriented programming language inspired by Smalltalk, Self, Lua, Lisp, Act1, and NewtonScript. Io has a prototype-based object model similar to those in Self and NewtonScript, eliminating the distinction between instance and class. Like Smalltalk, everything is an object and it uses dynamic typing. Like Lisp, programs are just data trees. Io uses actors for concurrency.
In computer programming, glob patterns specify sets of filenames with wildcard characters. For example, the Unix Bash shell command mv *.txttextfiles/
moves all files with names ending in .txt
from the current directory to the directory textfiles
. Here, *
is a wildcard and *.txt
is a glob pattern. The wildcard *
stands for "any string of any length including empty, but excluding the path separator characters ".
Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk. It can be used as both a programming language and a scripting language for the Java Platform, is compiled to Java virtual machine (JVM) bytecode, and interoperates seamlessly with other Java code and libraries. Groovy uses a curly-bracket syntax similar to Java's. Groovy supports closures, multiline strings, and expressions embedded in strings. Much of Groovy's power lies in its AST transformations, triggered through annotations.
A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging from widely used languages for common domains, such as HTML for web pages, down to languages used by only one or a few pieces of software, such as MUSH soft code. DSLs can be further subdivided by the kind of language, and include domain-specific markup languages, domain-specific modeling languages, and domain-specific programming languages. Special-purpose computer languages have always existed in the computer age, but the term "domain-specific language" has become more popular due to the rise of domain-specific modeling. Simpler DSLs, particularly ones used by a single application, are sometimes informally called mini-languages.
cURL is a computer software project providing a library (libcurl) and command-line tool (curl) for transferring data using various network protocols. The name stands for "Client for URL".
In computer-based language recognition, ANTLR, or ANother Tool for Language Recognition, is a parser generator that uses a LL(*) algorithm for parsing. ANTLR is the successor to the Purdue Compiler Construction Tool Set (PCCTS), first developed in 1989, and is under active development. Its maintainer is Professor Terence Parr of the University of San Francisco.
BeanShell is a small, free, embeddable Java source interpreter with object scripting language features, written in Java. It runs in the Java Runtime Environment (JRE), dynamically executes standard Java syntax and extends it with common scripting conveniences such as loose types, commands, and method closures, like those in Perl and JavaScript.
Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber created Markdown in 2004 as an easy-to-read markup language. Markdown is widely used for blogging and instant messaging, and also used elsewhere in online forums, collaborative software, documentation pages, and readme files.
Behavior-driven development (BDD) involves naming software tests using domain language to describe the behavior of the code.
HTML Tidy is a console application for correcting invalid HyperText Markup Language (HTML), detecting potential web accessibility errors, and for improving the layout and indent style of the resulting markup. It is also a cross-platform library for computer applications that provides HTML Tidy's features.
TextMate is a free and open-source general-purpose GUI text editor for macOS created by Allan Odgaard. TextMate features declarative customizations, tabs for open documents, recordable macros, folding sections, snippets, shell integration, and an extensible bundle system.
RSpec is a computer domain-specific language (DSL) testing tool written in the programming language Ruby to test Ruby code. It is a behavior-driven development (BDD) framework which is extensively used in production applications. The basic idea behind this concept is that of test-driven development (TDD) where the tests are written first and the development is based on writing just enough code that will fulfill those tests followed by refactoring. It contains its own mocking framework that is fully integrated into the framework based upon JMock. The simplicity in the RSpec syntax makes it one of the popular testing tools for Ruby applications. The RSpec tool can be used by installing the rspec
gem which consists of three other gems, namely rspec-core
, rspec-expectation
and rspec-mock.
Urbi is an open-source cross-platform software computing platform written in C++ used to develop applications for robotics and complex systems. Urbi is based on the UObject distributed C++ component architecture. It also includes the urbiscript orchestration language which is a parallel and event-driven script language. UObject components can be plugged into urbiscript and appear as native objects that can be scripted to specify their interactions and data exchanges. UObjects can be linked to the urbiscript interpreter, or executed as autonomous processes in "remote" mode.
Clojure is a dynamic and functional dialect of the programming language Lisp on the Java platform.
Jasmine is an open-source testing framework for JavaScript. It aims to run on any JavaScript-enabled platform, to not intrude on the application nor the IDE, and to have easy-to-read syntax. It is heavily influenced by other unit testing frameworks, such as ScrewUnit, JSSpec, JSpec, and RSpec.
Concordion is a specification by example framework originally developed by David Peterson, and now maintained by a team of contributors, led by Nigel Charman.
Ace is a standalone code editor written in JavaScript. The goal is to create a web-based code editor that matches and extends the features, usability, and performance of existing native editors such as TextMate, Vim, or Eclipse. It can be easily embedded in any web page and JavaScript application. Ace is developed as the primary editor for Cloud9 IDE and as the successor of the Mozilla Skywriter project.
Acceptance test–driven development (ATDD) is a development methodology based on communication between the business customers, the developers, and the testers. ATDD encompasses many of the same practices as specification by example (SBE), behavior-driven development (BDD), example-driven development (EDD), and support-driven development also called story test–driven development (SDD). All these processes aid developers and testers in understanding the customer's needs prior to implementation and allow customers to be able to converse in their own domain language.
Behat is a test framework for behavior-driven development written in the PHP programming language. Behat was created by Konstantin Kudryashov and its development is hosted on GitHub.
{{cite book}}
: CS1 maint: date and year (link){{cite book}}
: CS1 maint: date and year (link)