Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

bdd-patterns

/bdd-patterns

Podpowiada wzorce behavior-driven development, w tym strukturę Given-When-Then, pliki feature i kryteria akceptacji, przy pisaniu testów i specyfikacji w stylu BDD.

Repozytorium
han ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
08.09.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 08.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Podpowiada wzorce behavior-driven development, w tym strukturę Given-When-Then, pliki feature i kryteria akceptacji, przy pisaniu testów i specyfikacji w stylu BDD.

Oryginalny opis (EN)

Use when applying Behavior-Driven Development patterns including Given-When-Then structure, feature files, and acceptance criteria. Use when writing BDD-style tests and specifications.

Jak działa

  1. Given-When-Then Structure
  2. Feature File Organization
  3. Scenario Outlines for Data-Driven Tests
  4. Step Definition Patterns
  5. When to Use This Skill
  6. Best Practices
  7. Common Pitfalls
Sekcje z nagłówków SKILL.md, w oryginale · 111 linii, 447 słów
Podgląd SKILL.md
---
name: bdd-patterns
user-invocable: false
description: Use when applying Behavior-Driven Development patterns including Given-When-Then structure, feature files, and acceptance criteria. Use when writing BDD-style tests and specifications.
allowed-tools:
  - Bash
  - Read
---

# BDD Patterns

Master Behavior-Driven Development patterns to write clear, business-readable specifications that drive implementation.

## Given-When-Then Structure

The fundamental BDD pattern uses three parts:

- **Given**: The initial context or preconditions
- **When**: The action or event being tested
- **Then**: The expected outcome or result

```gherkin
Feature: User Authentication

  Scenario: Successful login with valid credentials
    Given a registered user with email "user@example.com"
    And the user has password "secure123"
    When the user submits the login form with correct credentials
    Then the user should be redirected to the dashboard
    And a session should be created
```

## Feature File Organization

```gherkin
Feature: Shopping Cart
  As a customer
  I want to manage items in my cart
  So that I can purchase products I'm interested in

  Background:
    Given I am logged in as a customer
    And the product catalog is available

  Scenario: Add item to empty cart
    Given my cart is empty
    When I add "Blue T-Shirt" to my cart
    Then my cart should contain 1 item
    And the cart total should be $29.99

  Scenario: Remove item from cart
    Given my cart contains "Blue T-Shirt"
    When I remove "Blue T-Shirt" from my cart
    Then my cart should be empty
```

## Scenario Outlines for Data-Driven Tests

```gherkin
Scenario Outline: Password validation
  Given I am on the registration page
  When I enter password "<password>"
  Then I should see "<message>"

  Examples:
    | password    | message                        |
    | abc         | Password too short             |
    | abcdefgh    | Password needs a number        |
    | abcdefgh1   | Password accepted              |
    | abcdefgh1!  | Password accepted              |
```

## Step Definition Patterns

```ruby
# Ruby/Cucumber example
Given('a registered user with email {string}') do |email|
  @user = User.create!(email: email, password: 'password123')
end

When('the user submits the login form with correct credentials') do
  visit login_path
  fill_in 'Email', with: @user.email
  fill_in 'Password', with: 'password123'
  click_button 'Log In'
end

Then('the user should be redirected to the dashboard') do
  expect(page).to have_current_path(dashboard_path)
end
```

## When to Use This Skill

Use bdd-patterns when you need to:

- Write acceptance tests that stakeholders can understand
- Define behavior before implementation
- Create living documentation from tests
- Bridge communication between developers and business
- Ensure features meet business requirements

## Best Practices

- Write scenarios from the user's perspective
- Keep scenarios focused on single behaviors
- Use declarative language, not implementation details
- Reuse step definitions across scenarios
- Use Background for common setup steps
- Keep feature files organized by domain area

## Common Pitfalls

- Writing scenarios that are too technical
- Coupling steps to specific UI implementations
- Creating overly complex scenario outlines
- Not maintaining feature files as code changes
- Mixing multiple behaviors in one scenario

Wersje

W bazie nie ma innych skilli o nazwie bdd-patterns.

Migawka bazy z 13.11.2026 · wersja paczki 0dc5002f24b4 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100bdd
    Prowadzi pracę w projektach BDD ze specyfikacjami Gherkin: pisze pliki feature, implementuje definicje kroków i projektuje testy akceptacyjne oparte na obserwowalnym zachowaniu.
  • 100bdd
    Prowadzi pracę w stylu Behavior-Driven Development: definiowanie zachowania na przykładach, pisanie plików .feature w Gherkin oraz automatyzacja w pytest-bdd lub behave.
  • 91bdd
    Prowadzi przez proces rozwoju sterowanego zachowaniem (BDD) i pisanie scenariuszy w formacie Given-When-Then.
  • 100bdd-testing
    Pisze i utrzymuje testy BDD w Gherkin i Cucumber: scenariusze akceptacyjne, pliki feature, definicje kroków, sesje Three Amigos oraz diagnostykę jakości testów.
  • 100bdd-scenarios
    Pomaga pisać skuteczne scenariusze BDD razem z kryteriami akceptacji, przypadkami brzegowymi i uporządkowaniem scenariuszy w specyfikacji zachowania.
  • 100bdd-cheatsheet
    Podpowiada wzorce BDD i składnię Gherkin w .NET: pliki feature, scenariusze Given-When-Then, tabele danych i kroki, z użyciem Reqnroll lub SpecFlow.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.