Skip to content
Back to skills

Behavior Driven Development

ASecurity

Use when implementing BDD with Gherkin and Cucumber.

  • 2 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 10, 2026
ai-agentspythontestingcode-reviewapidatabaseci/cddocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill behavior-driven-development --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Behavior Driven Development?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Behavior Driven Development
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-behavior-driven-development/badge)](https://www.skillsdirectory.com/skills/loopyluci-behavior-driven-development)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: behavior-driven-development
description: "Use when implementing BDD with Gherkin and Cucumber."
version: 1.0.0
author: Hermes Agent
license: MIT
metadata:
  hermes:
    tags: [BDD, behavior-driven-development, Gherkin, Cucumber, SpecFlow, executable-specifications]
    related_skills: [test-driven-development, test-driven-workflow, code-review-checklist, api-testing-patterns]
---

# Behavior-Driven Development (BDD)

Implementing behavior-driven development — from Gherkin feature files and scenario design through step definitions, living documentation, and BDD in CI/CD.

## When to Use

- Bridging communication gap between business and technical teams
- Creating executable specifications that double as tests
- Building a shared understanding of requirements
- Automating acceptance criteria validation
- Generating living documentation from feature files

## Gherkin Syntax

```gherkin
Feature: User Login
  As a registered user
  I want to log into the application
  So that I can access my account
  
  Background:
    Given a registered user with email "user@example.com" and password "SecurePass123"
  
  Scenario: Successful login with valid credentials
    When I navigate to the login page
    And I enter "user@example.com" in the email field
    And I enter "SecurePass123" in the password field
    And I click the "Sign In" button
    Then I should be redirected to the dashboard
    And I should see "Welcome, User!" in the header
  
  Scenario: Login with invalid password
    When I navigate to the login page
    And I enter "user@example.com" in the email field
    And I enter "WrongPassword" in the password field
    And I click the "Sign In" button
    Then I should see "Invalid email or password" error message
```

## Step Definitions (Python)

```python
from behave import given, when, then
from selenium import webdriver

@given('a registered user with email "{email}" and password "{password}"')
def step_register_user(context, email, password):
    context.driver = webdriver.Chrome()
    # Register user via API or directly in database
    register_user(email, password)

@when('I navigate to the login page')
def step_navigate_to_login(context):
    context.driver.get("https://example.com/login")

@then('I should be redirected to the dashboard')
def step_check_dashboard(context):
    assert "dashboard" in context.driver.current_url
```

## Common Pitfalls

1. **Feature file as test script** — Gherkin is for behavior, not step-by-step automation details
2. **Too many scenarios** — one feature file with 40 scenarios becomes unreadable; split up
3. **Brittle step definitions** — CSS selectors in step defs break on UI changes; use Page Objects
4. **No business involvement** — BDD without business collaboration is just automated testing
5. **Overlapping step definitions** — ambiguous step matches cause confusing failures

## Verification Checklist

- [ ] Feature files written in business language (not technical)
- [ ] Scenarios use Given-When-Then format consistently
- [ ] Step definitions use Page Objects or abstraction layer
- [ ] Feature files reviewed by product/business stakeholders
- [ ] Scenarios run in CI/CD pipeline
- [ ] Living documentation generated from feature files
- [ ] Background sections for shared setup (not repeated in each scenario)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.