@su-record/vibe 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,259 @@
1
+ # Feature: {기능명}
2
+
3
+ **Generated from**: `specs/{기능명}.md`
4
+ **Language**: {ko | en}
5
+ **Priority**: {HIGH | MEDIUM | LOW}
6
+
7
+ ---
8
+
9
+ ## Feature Description
10
+
11
+ **As a** {사용자 역할}
12
+ **I want** {원하는 기능}
13
+ **So that** {이유/가치}
14
+
15
+ ---
16
+
17
+ ## Background (Optional)
18
+
19
+ ```gherkin
20
+ Background:
21
+ Given {공통 전제 조건 1}
22
+ And {공통 전제 조건 2}
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Scenarios
28
+
29
+ ### Scenario 1: {시나리오 제목}
30
+
31
+ **Mapped to**: REQ-001 in SPEC
32
+
33
+ ```gherkin
34
+ Scenario: {시나리오 제목}
35
+ Given {전제 조건}
36
+ And {추가 전제 조건}
37
+ When {사용자 행동}
38
+ And {추가 행동}
39
+ Then {예상 결과}
40
+ And {추가 검증}
41
+ ```
42
+
43
+ **Acceptance Criteria**:
44
+ - [ ] {SPEC의 Acceptance Criteria 1}
45
+ - [ ] {SPEC의 Acceptance Criteria 2}
46
+
47
+ **Test Data**:
48
+ ```json
49
+ {
50
+ "input": {...},
51
+ "expected_output": {...}
52
+ }
53
+ ```
54
+
55
+ ---
56
+
57
+ ### Scenario 2: {에러 케이스 제목}
58
+
59
+ ```gherkin
60
+ Scenario: {에러 케이스 제목}
61
+ Given {전제 조건}
62
+ When {잘못된 입력}
63
+ Then {에러 응답}
64
+ And {에러 메시지 검증}
65
+ ```
66
+
67
+ ---
68
+
69
+ ### Scenario Outline: {파라미터화된 시나리오}
70
+
71
+ ```gherkin
72
+ Scenario Outline: {시나리오 제목}
73
+ Given {전제 조건}
74
+ When I {행동} with "<parameter>"
75
+ Then I should see "<result>"
76
+
77
+ Examples:
78
+ | parameter | result |
79
+ | value1 | result1 |
80
+ | value2 | result2 |
81
+ | value3 | result3 |
82
+ ```
83
+
84
+ ---
85
+
86
+ ## Implementation Guide
87
+
88
+ ### Backend Tests (Python + Pytest-BDD)
89
+
90
+ **File**: `tests/features/{기능명}.feature`
91
+
92
+ ```python
93
+ # tests/step_defs/test_{기능명}.py
94
+ import pytest
95
+ from pytest_bdd import scenarios, given, when, then, parsers
96
+
97
+ # Load scenarios
98
+ scenarios('features/{기능명}.feature')
99
+
100
+ @given(parsers.parse('사용자가 {role}로 로그인되어 있다'))
101
+ def user_logged_in(context, role):
102
+ context.user = create_user(role)
103
+ context.token = authenticate(context.user)
104
+
105
+ @when(parsers.parse('{action}을 실행한다'))
106
+ def execute_action(context, action):
107
+ context.response = api_call(action, context.token)
108
+
109
+ @then(parsers.parse('응답 코드는 {status_code:d}이어야 한다'))
110
+ def check_status_code(context, status_code):
111
+ assert context.response.status_code == status_code
112
+ ```
113
+
114
+ **Run**:
115
+ ```bash
116
+ pytest tests/features/{기능명}.feature --verbose
117
+ ```
118
+
119
+ ---
120
+
121
+ ### Frontend Tests (Flutter + Gherkin)
122
+
123
+ **File**: `integration_test/features/{기능명}.feature`
124
+
125
+ ```dart
126
+ // integration_test/step_definitions/{기능명}_test.dart
127
+ import 'package:flutter_gherkin/flutter_gherkin.dart';
128
+
129
+ class UserLoggedInStep extends Given1WithWorld<String, FlutterWorld> {
130
+ @override
131
+ Future<void> executeStep(String role) async {
132
+ await world.appDriver.waitForAppToSettle();
133
+ // Login logic
134
+ }
135
+
136
+ @override
137
+ RegExp get pattern => RegExp(r'사용자가 {string}로 로그인되어 있다');
138
+ }
139
+ ```
140
+
141
+ **Run**:
142
+ ```bash
143
+ flutter test integration_test/{기능명}_test.dart
144
+ ```
145
+
146
+ ---
147
+
148
+ ### Frontend Tests (React + Cucumber)
149
+
150
+ **File**: `tests/features/{기능명}.feature`
151
+
152
+ ```javascript
153
+ // tests/step_definitions/{기능명}.steps.js
154
+ const { Given, When, Then } = require('@cucumber/cucumber');
155
+ const { render, screen, fireEvent } = require('@testing-library/react');
156
+
157
+ Given('사용자가 {string}로 로그인되어 있다', async function (role) {
158
+ this.user = await createUser(role);
159
+ this.token = await authenticate(this.user);
160
+ });
161
+
162
+ When('{string}을 실행한다', async function (action) {
163
+ this.response = await apiCall(action, this.token);
164
+ });
165
+
166
+ Then('응답 코드는 {int}이어야 한다', function (statusCode) {
167
+ expect(this.response.status).toBe(statusCode);
168
+ });
169
+ ```
170
+
171
+ **Run**:
172
+ ```bash
173
+ npm test -- --features tests/features/{기능명}.feature
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Tags
179
+
180
+ ```gherkin
181
+ @priority-high
182
+ @smoke
183
+ @regression
184
+ @backend
185
+ @frontend
186
+ ```
187
+
188
+ **Run by tag**:
189
+ ```bash
190
+ # Python
191
+ pytest -m "priority-high"
192
+
193
+ # JavaScript
194
+ npm test -- --tags "@smoke"
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Coverage Mapping
200
+
201
+ | Scenario | SPEC REQ | Acceptance Criteria | Status |
202
+ |----------|----------|---------------------|--------|
203
+ | Scenario 1 | REQ-001 | AC-1, AC-2, AC-3 | ⬜ |
204
+ | Scenario 2 | REQ-002 | AC-4, AC-5 | ⬜ |
205
+ | Scenario 3 | REQ-003 | AC-6, AC-7 | ⬜ |
206
+
207
+ **Coverage**: 0 / {총 시나리오 수} (0%)
208
+
209
+ ---
210
+
211
+ ## Test Execution Report
212
+
213
+ **Last Run**: {날짜 시간}
214
+ **Environment**: {dev | staging | production}
215
+
216
+ | Scenario | Status | Duration | Error |
217
+ |----------|--------|----------|-------|
218
+ | Scenario 1 | ⬜ PENDING | - | - |
219
+ | Scenario 2 | ⬜ PENDING | - | - |
220
+
221
+ **Total**: 0 passed, 0 failed, {총 수} pending
222
+
223
+ ---
224
+
225
+ ## Next Steps
226
+
227
+ 1. **구현 전 테스트 작성** (Test-First):
228
+ ```bash
229
+ # Create feature file first
230
+ vibe feature "{기능명}"
231
+
232
+ # Then implement
233
+ vibe run "Task 1-1"
234
+ ```
235
+
236
+ 2. **구현 중 테스트 실행**:
237
+ ```bash
238
+ vibe test "{기능명}" --watch
239
+ ```
240
+
241
+ 3. **완료 후 검증**:
242
+ ```bash
243
+ vibe verify "{기능명}"
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Notes
249
+
250
+ - ✅ **Given**: 테스트 전제 조건 (상태 설정)
251
+ - ✅ **When**: 사용자 행동 (액션 실행)
252
+ - ✅ **Then**: 예상 결과 (검증)
253
+ - ✅ **And/But**: 추가 조건/검증
254
+
255
+ **Best Practices**:
256
+ - 시나리오는 비즈니스 언어로 작성
257
+ - 구현 세부사항은 Step Definitions에
258
+ - 각 시나리오는 독립적으로 실행 가능해야 함
259
+ - Background는 중복 제거용으로만 사용
@@ -117,26 +117,83 @@ Response: {...}
117
117
 
118
118
  ---
119
119
 
120
- ## 7. Out of Scope
120
+ ## 7. 테스트 전략
121
+
122
+ ### BDD 시나리오 (Gherkin)
123
+
124
+ **생성 명령어**: `vibe feature "{기능명}"`
125
+
126
+ ```gherkin
127
+ Scenario: {시나리오 제목}
128
+ Given {전제 조건}
129
+ When {사용자 행동}
130
+ Then {예상 결과}
131
+ ```
132
+
133
+ **매핑**:
134
+ - REQ-001 → Scenario 1, 2
135
+ - REQ-002 → Scenario 3
136
+
137
+ ### Contract Tests (API 스키마)
138
+
139
+ **생성 명령어**: `vibe contract "{기능명}"`
140
+
141
+ **Backend Contract**:
142
+ ```json
143
+ {
144
+ "request": {
145
+ "method": "POST",
146
+ "path": "/api/v1/{resource}",
147
+ "schema": {JSON Schema}
148
+ },
149
+ "response": {
150
+ "status": 201,
151
+ "schema": {JSON Schema}
152
+ }
153
+ }
154
+ ```
155
+
156
+ **Frontend Contract**:
157
+ - Mock 서버로 독립 테스트
158
+ - 응답 스키마 검증 (Zod, JSON Schema)
159
+
160
+ ### 테스트 커버리지 목표
161
+
162
+ - [ ] BDD: 모든 Acceptance Criteria 커버
163
+ - [ ] Contract: 모든 API 엔드포인트 커버
164
+ - [ ] Unit: 70%+ 커버리지
165
+ - [ ] Integration: 핵심 경로 커버
166
+
167
+ ---
168
+
169
+ ## 8. Out of Scope
121
170
 
122
171
  - ❌ {제외 항목 1}
123
172
  - ❌ {제외 항목 2}
124
173
 
125
174
  ---
126
175
 
127
- ## 8. 검증 체크리스트
176
+ ## 9. 검증 체크리스트
128
177
 
178
+ ### 요구사항
129
179
  - [ ] 모든 요구사항이 테스트 가능한가?
130
180
  - [ ] SHALL/SHOULD/MAY가 명확한가?
131
181
  - [ ] Acceptance Criteria가 구체적인가?
132
182
  - [ ] 성능 목표가 측정 가능한가?
133
183
 
184
+ ### 테스팅
185
+ - [ ] BDD Feature 파일 생성 완료?
186
+ - [ ] Contract 테스트 정의 완료?
187
+ - [ ] Step Definitions 작성 완료?
188
+ - [ ] 테스트 커버리지 목표 달성?
189
+
134
190
  ---
135
191
 
136
- ## 9. 승인
192
+ ## 10. 승인
137
193
 
138
194
  - [ ] 사용자 승인
139
195
  - [ ] 기술 리뷰 완료
196
+ - [ ] 테스트 계획 승인
140
197
 
141
198
  승인일: ____________
142
199
  승인자: ____________