Cucumber
Cucumber is a behavior-driven development (BDD) testing tool that lets teams write test scenarios in plain-language Gherkin syntax, which are then executed as automated acceptance tests against the application.
Definition
Cucumber is a behavior-driven development (BDD) testing tool that lets teams write test scenarios in plain-language Gherkin syntax, which are then executed as automated acceptance tests against the application.
Overview
Cucumber grew out of the behavior-driven development movement, which aims to bridge the gap between technical test automation and business-readable requirements. Instead of writing test assertions purely in code, Cucumber scenarios are written in Gherkin — a structured but plain-language format using Given/When/Then steps ("Given a logged-in user, When they add an item to their cart, Then the cart total updates") — that both developers and non-technical stakeholders can read and review. Each Gherkin step is backed by a corresponding "step definition" written in code, which is where Cucumber actually drives the application under test — often using browser automation tools like Selenium or Playwright for web UI testing, or direct API calls for backend scenarios. This separation means the same human-readable scenario can be reused and kept stable even as the underlying automation code changes. Originally built for Ruby, Cucumber's approach has been ported to many language ecosystems — including Cucumber-JVM for Java and SpecFlow for .NET — making Gherkin-style BDD scenarios a common format across otherwise very different codebases. It's typically introduced alongside broader test automation and CI/CD practices, since Cucumber scenarios are most valuable when run automatically on every change.
Key Features
- Gherkin syntax for writing test scenarios in plain, structured language
- Given/When/Then step format readable by non-technical stakeholders
- Step definitions that map plain-language steps to executable test code
- Ports across many languages: Ruby, Java (Cucumber-JVM), .NET (SpecFlow), and more
- Integration with browser automation tools for end-to-end UI testing
- Living documentation — scenarios double as a readable spec of expected behavior
- Tagging support for organizing and selectively running scenario subsets
Use Cases
History
Cucumber is a tool for Behavior-Driven Development (BDD) that lets teams write executable specifications in plain language. It was created by Aslak Hellesøy in 2008, originally as a Ruby tool and as an improvement on the RSpec "Story Runner"; the name was suggested by his fiancée. Central to Cucumber is Gherkin, a domain-specific language that expresses test scenarios in a readable given-when-then structure, so that product owners, testers, and developers can share a single specification that also runs as an automated test. Cucumber emphasizes collaboration and shared understanding over pure testing, and it has since expanded well beyond Ruby to Java, JavaScript, and .NET.
Sources
- Cucumber — "History of BDD" · as of 2026-07-17
- Cucumber — official website · as of 2026-07-17