Cucumber (software)

Cucumber (software)
Cucumber
Developer(s) Aslak Hellesøy[2], Joseph Wilk[3], Matt Wynne[4], Gregory Hnatiuk[5], Mike Sassak[6]
Stable release 1.0.2
Operating system Cross-platform
Type Behavior driven development framework / Test tool
License MIT License
Website cukes.info

Cucumber is a tool for running automated acceptance tests written in a behavior driven development (BDD) style. Cucumber is written in Ruby programming language.[7][8] Cucumber allows the execution of feature documentation written in business-facing text.

Contents

Example

A feature definition, with a single scenario[9]:

Feature: Division
  In order to avoid silly mistakes
  Cashiers must be able to calculate a fraction

  Scenario: Regular numbers
    * I have entered 3 into the calculator
    * I press divide
    * I have entered 2 into the calculator

  Result: Should be 1.5 on the screen

The execution of the test implicit in the feature definition above requires the definition, using the Ruby language, of a few "steps"[10]:

# encoding: utf-8
begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end 
require 'cucumber/formatter/unicode'
$:.unshift(File.dirname(__FILE__) + '/../../lib')
require 'calculator'
 
Before do
  @calc = Calculator.new
end
 
After do
end
 
Given /I have entered (\d+) into the calculator/ do |n|
  @calc.push n.to_i
end
 
When /I press (\w+)/ do |op|
  @result = @calc.send op
end
 
Then /the result should be (.*) on the screen/ do |result|
  @result.should == result.to_f
end

Popularity

Cucumber has been downloaded over 829,873 times[11]. According to a Mashable survey[12], it is the 5th most popular testing framework in use by startup companies.

References

External links



Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Cucumber (disambiguation) — A cucumber is an edible fruit. Cucumber may also refer to: Cucumber sandwich, a type of sandwich. Cucumber King (Nyaung u Sawrahan), a ruler of the kingdom of Pagan in what is now Burma. Cucumber, West Virginia, a community in West Virginia… …   Wikipedia

  • Behavior Driven Development — (BDD) (deutsch Verhaltensgetriebene Softwareentwicklung) ist eine Technik der Agilen Softwareentwicklung, welche die Zusammenarbeit zwischen Qualitätsmanagement und Business Analyse in Softwareentwicklungsprojekten stärkt. Beim Behavior Driven… …   Deutsch Wikipedia

  • Stack (data structure) — In computer science, a stack is an abstract data type and data structure based on the principle of Last In First Out (LIFO) . Stacks are used extensively at every level of a modern computer system. For example, a modern PC uses stacks at the… …   Wikipedia

  • List of VeggieTales characters — This is a list of primary, secondary, and recurring characters that appear in the animated series VeggieTales. Contents 1 Primary characters 1.1 Bob the Tomato 1.2 Larry the Cucumber 1.3 …   Wikipedia

  • VeggieTales — Genre Christian, children s, satire Format Computer animation …   Wikipedia

  • environment — environmental, adj. environmentally, adv. /en vuy reuhn meuhnt, vuy euhrn /, n. 1. the aggregate of surrounding things, conditions, or influences; surroundings; milieu. 2. Ecol. the air, water, minerals, organisms, and all other external factors… …   Universalium

  • Computational creativity — (also known as artificial creativity, mechanical creativity or creative computation) is a multidisciplinary endeavour that is located at the intersection of the fields of artificial intelligence, cognitive psychology, philosophy, and the arts.… …   Wikipedia

  • Cisco Unified Communications Manager — (CUCM), formerly Cisco Unified CallManager and Cisco CallManager (CCM), is a software based call processing system developed by Cisco Systems. CUCM tracks all active VoIP network components; these include phones, gateways, conference bridges,… …   Wikipedia

  • Behavior Driven Development — (ou BDD) est une méthode Agile qui encourage la collaboration entre les développeurs, les responsables qualités, les intervenants non techniques et les entreprises participants à un projet de logiciel. Il a été conçu en 2003 par Dan North comme… …   Wikipédia en Français

  • Sediment Profile Imagery — (SPI) is an underwater technique for photographing the interface between the seabed and the overlying water. The technique is used to measure or estimate biological, chemical, and physical processes occurring in the first few centimetres of… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”