| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| Invoke | /bdd:generate |
| Aliases | /bdd:scenario, /test:bdd |
| Tools | Read, Edit, Write, Glob, Grep |
| Model | sonnet |
| Skills | bdd |
/bdd:generate โ ํ๋ฉด ์๋๋ฆฌ์ค ์๋ ์์ฑ๊ธฐ#
ํ๋ง๋๋ก#
์ ํ๋ฉด์ ๋ง๋ค ๋ "์ด ํ๋ฉด์ด ์ด๋ ๊ฒ ๋์ํด์ผ ํ๋ค"๋ ํ ์คํธ ์๋๋ฆฌ์ค๋ฅผ ์๋์ผ๋ก ์จ์ฃผ๋ ๋์ฐ๋ฏธ์ ๋๋ค. ์ ์ ์ง์์๊ฒ "์ด ๋ฒํผ ๋๋ฅด๋ฉด ์ด๋ ๊ฒ ๋๊ณ , ๋น์นธ์ด๋ฉด ์ด๋ฐ ๊ฒฝ๊ณ ๊ฐ ๋ ์ผ ํ๋ค"๋ ์ ๋ฌด ๋งค๋ด์ผ์ ๋์ ์ ๋ฆฌํด์ฃผ๋ ๊ฒ๊ณผ ๊ฐ์์.
๋๊ฐยท์ธ์ ์ฐ๋์#
- ๋ชฉ๋กยท์์ธยท์ ๋ ฅ ํผ ๊ฐ์ ์ ํ๋ฉด์ ๊ฐ๋ฐํ๊ธฐ ์ง์ , ์ด๋ป๊ฒ ๋์ํด์ผ ํ๋์ง ํฉ์๋ ์๋๋ฆฌ์ค๊ฐ ํ์ํ ๋
/bdd:generate๋ช ๋ น์ ์ง์ ์คํํ์ ๋- ํผ๊ทธ๋ง ๋ถ์(
/figma:analyze) ํ๋ฆ์์ ์๋์ผ๋ก ํธ์ถ๋ ๋
๋ฌด์์ ํด์ฃผ๋์#
ํ๋ฉด ์ข ๋ฅ(๋ชฉ๋ก / ์์ธ / ์ ๋ ฅ ํผ)์ ๋ง๋ ์๋๋ฆฌ์ค ๋ฌธ์์ ๊ทธ ์๋๋ฆฌ์ค๋ฅผ ์ค์ ๋ก ๊ฒ์ฆํ๋ ์ฝ๋ ๋ฌถ์์ ๋ง๋ค์ด ์ค๋๋ค. ์ค์ ๋ก ์๊ธฐ๋ ํ์ผ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
-
{feature}_list.feature,{feature}_detail.feature,{feature}_form.featureโ ์ฌ๋์ด ์ฝ์ ์ ์๋ "๋์ ์๋๋ฆฌ์ค" ๋ฌธ์ (Gherkin ํ์) step/ํด๋์*_steps.dartํ์ผ๋ค โ ๊ฐ ์๋๋ฆฌ์ค ๋ฌธ์ฅ์ ์ค์ ๋ก ๊ฒ์ฆํ๋ ์ฝ๋hooks/hooks.dartโ ํ ์คํธ์ ํ์ํ ๊ฐ์ง ๋ฐ์ดํฐ(Mock) ์ค๋น ์ฝ๋
๊ฐ ์๋๋ฆฌ์ค ๋ฌธ์ฅ์ ์์ด ์๋ฌธ + # ํ๊ธ ๋ฒ์ญ ์ฃผ์์ ๋๋ํ ์ ์ด, ๊ฐ๋ฐ์์ ๋น๊ฐ๋ฐ์๊ฐ ํจ๊ป ์ฝ์ ์ ์๊ฒ ์์ฑ๋ฉ๋๋ค.
์ด๋ป๊ฒ ์ฐ๋์#
# ๊ธฐ๋ณธ: ๊ธฐ๋ฅ ์ด๋ฆ๊ณผ ์ํฐํฐ ์ด๋ฆ์ ๋๊น๋๋ค
/bdd:generate
# ๋ค๋ฅธ ์ด๋ฆ์ผ๋ก๋ ํธ์ถํ ์ ์์ด์ (๋ณ์นญ)
/bdd:scenario
/test:bdd
๋๊ธฐ๋ ์ ๋ณด:
feature_name(ํ์) โ ๊ธฐ๋ฅ ๋ชจ๋ ์ด๋ฆ (์:community_post)entity_name(ํ์) โ ๋ฐ์ดํฐ ์ด๋ฆ (์:CommunityPost)-
screen_type(์ ํ) โlist(๋ชฉ๋ก) /detail(์์ธ) /form(์ ๋ ฅ ํผ)
์์์ ๋ฌด์จ ์ผ์ด ๋ฒ์ด์ง๋์#
ํ๋ฉด ์ข ๋ฅ๋ฅผ ํ๋จํ ๋ค, ์ข ๋ฅ๋ณ๋ก ํํ ํ์ํ ๋์๋ค์ ์๋๋ฆฌ์ค๋ก ํ์ด๋ ๋๋ค.
- ๋ชฉ๋ก ํ๋ฉด โ ๋ชฉ๋ก ๋ถ๋ฌ์ค๊ธฐ, ๋น๊ฒจ์ ์๋ก๊ณ ์นจ, ๋ฌดํ ์คํฌ๋กค, ์นด๋ ํญ ์ ์์ธ ์ด๋, ์นดํ ๊ณ ๋ฆฌ ํํฐ, ๋น์ด ์์ยท์ค๋ฅ ์ํ
- ์์ธ ํ๋ฉด โ ์์ธ ์ ๋ณด ํ์, ์ข์์ ํ ๊ธ, (์์ฑ์๋ง) ์์ ยท์ญ์ , ๊ณต์
- ์ ๋ ฅ ํผ ํ๋ฉด โ ์ ์ ์ ์ถ, ํ์ ํญ๋ชฉ ๋๋ฝ ๊ฒฝ๊ณ , ๊ธ์ ์ ์ ํ, ์ด๋ฏธ์ง ์ฒจ๋ถยท์ญ์ , ์์ฑ ์ทจ์, ๋คํธ์ํฌ ์ค๋ฅ
-
ํ์ง ์ ๊ฒ โ ๋ชจ๋ ๋ฌธ์ฅ์ ํ๊ธ ๋ฒ์ญ ์ฃผ์์ด ๋ถ์๋์ง, ๊ณต์ฉ ์คํ
์ ์ฌ์ฌ์ฉํ๋์ง,
@smokeยท@validation๊ฐ์ ๋ถ๋ฅ ํ๊ทธ๋ฅผ ๋ฌ์๋์ง ์ฒดํฌ๋ฆฌ์คํธ๋ก ํ์ธํฉ๋๋ค.
โ๏ธ ์์ธ ์ต์ ยท์คํ ๋ช ์ธ (๊ฐ๋ฐ์ / AI ์์ด์ ํธ์ฉ)
Role#
Analyzes screen types (list/detail/form) and generates Gherkin scenarios and Step definitions.
Activation Conditions#
/bdd:generateActivated when command is invoked/figma:analyzeInvoked from orchestration
Parameters#
| Parameter | Required | Description |
|---|---|---|
feature_name | โ | Feature module name (snake_case) |
entity_name | โ | Entity name (PascalCase) |
screen_type | โ | list, detail, form |
Generated Files#
feature/{location}/{feature_name}/test/src/bdd/
โโโ {feature}_list.feature
โโโ {feature}_detail.feature
โโโ {feature}_form.feature
โโโ step/
โ โโโ common_steps.dart # package/core์์ import
โ โโโ {feature}_list_steps.dart
โ โโโ {feature}_detail_steps.dart
โ โโโ {feature}_form_steps.dart
โโโ hooks/
โโโ hooks.dartCore Patterns Summary#
Gherkin Rules#
- Feature/Scenario title: Write in English with
# ํ๊ธ ๋ฒ์ญcomment (e.g.,Feature: Login Page # ๋ก๊ทธ์ธ ํ์ด์ง) - Scenario description: Write in English with
# ํ๊ธ ๋ฒ์ญcomment - Step pattern: English required with
# ํ๊ธ ๋ฒ์ญcomment (e.g.,Given I am on the login page # ๋ก๊ทธ์ธ ํ์ด์ง์ ์์ต๋๋ค) - Korean text as parameters:
{'ํ๊ธValue'}Format
Step Definition Rules#
- Function name: English camelCase (
iTapTheButton) - Usage ์ฃผ์ ๋ณ๊ธฐ:
/// Usage: When I tap button+/// ์ฉ๋: ๋ฒํผ์ ํญํฉ๋๋ค - ๊ณต์ฉ ์คํ
์ฌUsage:
package:core/src/test/bdd/bdd.dart
Tag System#
| Tag | Purpose |
|---|---|
@smoke | Core functionality tests |
@validation | Validation checks |
@navigation | Page navigation |
@error | Error handling |
Scenarios by Screen Type#
List Screen#
- List loading, pull-to-refresh, infinite scroll
- Card tap -> detail navigation, FAB -> create page
- Category filter, error/empty states
Detail Screen#
- Detail display, like toggle
- Edit/delete (author only), share
Form Screen#
- Valid form submission, missing required fields
- Character limit, image attach/delete
- Cancel writing, network error
Checklist#
- Feature/Scenario title: English with
# ํ๊ธ ๋ฒ์ญcomment - Step pattern: English with
# ํ๊ธ ๋ฒ์ญcomment - Korean comment:
# ํ๊ธ ๋ฒ์ญafter every content line (Feature, Scenario, description, steps) - Function name: English camelCase
- Shared steps: reuse core/bdd.dart
- Tags: apply @smoke, @validation, etc.
- hooks.dart: Mock setup
- build.yaml: bdd_widget_test setup
- Multi-field forms (3+ fields): values in a
Givendata table, submitted via a singleWhendomain step โ no one-When/And-per-field chains - Scenario Outline used only when the data variation itself is the thing under test โ regular
Scenariootherwise
Related Documents#
- BLoC Patterns - Test Pattern
- Pattern Selection Guide