Skip to main content

bdd

Behavior-Driven Development with Gherkin, Cucumber, and executable specifications

跳到安装

来源信息

仓库
NeuralBlitz/Mito
最近来源活动
2026年3月22日 13:29
检测到的 SKILL.md 语言
英语
星标
0
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
bdd
description
Behavior-Driven Development with Gherkin, Cucumber, and executable specifications
license
MIT
compatibility
opencode
metadata
{"audience":"developers","category":"software-development"}
## What I do - Write BDD scenarios in Gherkin syntax - Create executable specifications - Implement step definitions - Test behavior over implementation - Bridge technical and business communication ## When to use me When practicing BDD, creating living documentation, or improving team communication. ## Gherkin Syntax ### Core Keywords ```gherkin Feature: Search functionality As a user I want to search for products So that I can find what I'm looking for Scenario: Successful search Given I am on the search page When I enter "laptop" in the search box And I click the search button Then I should see search results And the results should contain "laptop" Scenario: No results found Given I am on the search page When I enter "xyz123" in the search box And I click the search button Then I should see "No results found" ``` ### Gherkin Keywords - **Feature**: High-level description - **Background**: Preconditions for all scenarios - **Scenario**: Individual test case - **Scenario Outline**: Parametrized scenarios with Examples - **Given**: Preconditions - **When**: Actions/events - **Then**: Expected outcomes - **And/But**: Continue previous step - **DocString**: Multi-line text - **DataTable**: Structured data ### Scenario Outline Example ```gherkin Scenario Outline: Add items to cart Given the product "<product>" costs "<price>" When I add it to cart Then my cart total should be "<total>" Examples: | product | price | total | | Laptop | 1000 | 1000 | | Mouse | 50 | 1050 | ``` ## BDD Best Practices ### Writing Scenarios - Focus on behavior, not UI - Use business language - One assertion per scenario - Independent scenarios - Meaningful step definitions ### Step Definitions - Reusable steps - Parameterization - Helper methods - Assertions ### Tools - **Cucumber**: Ruby, JS, Java, .NET - **Behave**: Python - **SpecFlow**: .NET - **JBehave**: Java ### Integration - CI/CD pipeline integration - Living documentation - Reporting - Tags for organization
在 GitHub 查看