Getting started with Behavior Driven Development
This tutorial is the perfect starting point for product owners, testers and developers who want to learn the fundamentals of Behavior Driven Development (BDD).
What you will learn
By completing this guide, you will understand how to:
- Describe business needs using examples with Gherkin language
- Use scenarios to drive development
- Implement step definitions to automate tests
- Integrate BDD as part of a CI process
- Keep your test suite fast and lean with refactoring
Prerequisites
You'll need a CucumberStudio account to get started. For the CI automation sections, you'll also need:
- GitHub account
- Computer setup with a text editor
- git installation
- hiptest-publisher installation
Describing Business Needs with Gherkin Language
BDD uses a coffee machine application example to teach scenario writing. The tutorial guides you through creating a scenario: "Descaling is needed after 500 coffees."
Key guidance: Scenarios describe the what, not the how. Use a declarative style focusing on business rules and consistent terminology.
Using Scenarios to Drive Development
Once your scenarios are written in CucumberStudio, they become the single source of truth for what the product should do. You can execute them manually to validate business rules, or integrate with a CI tool for automated validation.
See the CI in 5 minutes flat tutorial for automation integration.
Implementing Step Definitions
hiptest-publisher connects your Gherkin scenarios in CucumberStudio to your test automation code. Use the following commands to generate and update your action words:
hiptest-publisher -c <path to config file> --actionwords-signature Update test files with:
hiptest-publisher -c <path to config file> --without=actionwords Integrating with CI
Add your scenarios to test runs in CucumberStudio, then push changes through GitHub and Travis-CI for continuous integration. Every code push will automatically validate your Gherkin scenarios, giving the whole team confidence in the product's behavior.
Follow the complete CI in 5 minutes flat guide for detailed setup instructions.