ai-flow-dev 2.7.0 → 2.8.1

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.
Files changed (171) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +573 -570
  3. package/package.json +74 -74
  4. package/prompts/backend/flow-build-phase-0.md +535 -535
  5. package/prompts/backend/flow-build-phase-1.md +626 -626
  6. package/prompts/backend/flow-build-phase-10.md +340 -340
  7. package/prompts/backend/flow-build-phase-2.md +573 -573
  8. package/prompts/backend/flow-build-phase-3.md +834 -834
  9. package/prompts/backend/flow-build-phase-4.md +554 -554
  10. package/prompts/backend/flow-build-phase-5.md +703 -703
  11. package/prompts/backend/flow-build-phase-6.md +524 -524
  12. package/prompts/backend/flow-build-phase-7.md +1001 -1001
  13. package/prompts/backend/flow-build-phase-8.md +1407 -1407
  14. package/prompts/backend/flow-build-phase-9.md +477 -477
  15. package/prompts/backend/flow-build.md +137 -137
  16. package/prompts/backend/flow-check-review.md +656 -20
  17. package/prompts/backend/flow-check-test.md +526 -14
  18. package/prompts/backend/flow-check.md +717 -67
  19. package/prompts/backend/flow-commit.md +88 -119
  20. package/prompts/backend/flow-docs-sync.md +354 -354
  21. package/prompts/backend/flow-finish.md +919 -0
  22. package/prompts/backend/flow-release.md +949 -0
  23. package/prompts/backend/flow-work-feature.md +61 -61
  24. package/prompts/backend/flow-work-fix.md +46 -46
  25. package/prompts/backend/flow-work-refactor.md +48 -48
  26. package/prompts/backend/flow-work-resume.md +34 -34
  27. package/prompts/backend/flow-work.md +1098 -1286
  28. package/prompts/desktop/flow-build-phase-0.md +359 -359
  29. package/prompts/desktop/flow-build-phase-1.md +295 -295
  30. package/prompts/desktop/flow-build-phase-10.md +357 -357
  31. package/prompts/desktop/flow-build-phase-2.md +282 -282
  32. package/prompts/desktop/flow-build-phase-3.md +291 -291
  33. package/prompts/desktop/flow-build-phase-4.md +308 -308
  34. package/prompts/desktop/flow-build-phase-5.md +269 -269
  35. package/prompts/desktop/flow-build-phase-6.md +350 -350
  36. package/prompts/desktop/flow-build-phase-7.md +297 -297
  37. package/prompts/desktop/flow-build-phase-8.md +541 -541
  38. package/prompts/desktop/flow-build-phase-9.md +439 -439
  39. package/prompts/desktop/flow-build.md +156 -156
  40. package/prompts/desktop/flow-check-review.md +656 -20
  41. package/prompts/desktop/flow-check-test.md +526 -14
  42. package/prompts/desktop/flow-check.md +717 -67
  43. package/prompts/desktop/flow-commit.md +88 -119
  44. package/prompts/desktop/flow-docs-sync.md +354 -354
  45. package/prompts/desktop/flow-finish.md +919 -0
  46. package/prompts/desktop/flow-release.md +662 -0
  47. package/prompts/desktop/flow-work-feature.md +61 -61
  48. package/prompts/desktop/flow-work-fix.md +46 -46
  49. package/prompts/desktop/flow-work-refactor.md +48 -48
  50. package/prompts/desktop/flow-work-resume.md +34 -34
  51. package/prompts/desktop/flow-work.md +1202 -1390
  52. package/prompts/frontend/flow-build-phase-0.md +425 -425
  53. package/prompts/frontend/flow-build-phase-1.md +626 -626
  54. package/prompts/frontend/flow-build-phase-10.md +33 -33
  55. package/prompts/frontend/flow-build-phase-2.md +573 -573
  56. package/prompts/frontend/flow-build-phase-3.md +782 -782
  57. package/prompts/frontend/flow-build-phase-4.md +554 -554
  58. package/prompts/frontend/flow-build-phase-5.md +703 -703
  59. package/prompts/frontend/flow-build-phase-6.md +524 -524
  60. package/prompts/frontend/flow-build-phase-7.md +1001 -1001
  61. package/prompts/frontend/flow-build-phase-8.md +872 -872
  62. package/prompts/frontend/flow-build-phase-9.md +94 -94
  63. package/prompts/frontend/flow-build.md +137 -137
  64. package/prompts/frontend/flow-check-review.md +656 -20
  65. package/prompts/frontend/flow-check-test.md +526 -14
  66. package/prompts/frontend/flow-check.md +717 -67
  67. package/prompts/frontend/flow-commit.md +88 -119
  68. package/prompts/frontend/flow-docs-sync.md +550 -550
  69. package/prompts/frontend/flow-finish.md +919 -0
  70. package/prompts/frontend/flow-release.md +519 -0
  71. package/prompts/frontend/flow-work-api.md +1547 -0
  72. package/prompts/frontend/flow-work-feature.md +61 -61
  73. package/prompts/frontend/flow-work-fix.md +38 -38
  74. package/prompts/frontend/flow-work-refactor.md +48 -48
  75. package/prompts/frontend/flow-work-resume.md +34 -34
  76. package/prompts/frontend/flow-work.md +1595 -1320
  77. package/prompts/mobile/flow-build-phase-0.md +425 -425
  78. package/prompts/mobile/flow-build-phase-1.md +626 -626
  79. package/prompts/mobile/flow-build-phase-10.md +32 -32
  80. package/prompts/mobile/flow-build-phase-2.md +573 -573
  81. package/prompts/mobile/flow-build-phase-3.md +782 -782
  82. package/prompts/mobile/flow-build-phase-4.md +554 -554
  83. package/prompts/mobile/flow-build-phase-5.md +703 -703
  84. package/prompts/mobile/flow-build-phase-6.md +524 -524
  85. package/prompts/mobile/flow-build-phase-7.md +1001 -1001
  86. package/prompts/mobile/flow-build-phase-8.md +888 -888
  87. package/prompts/mobile/flow-build-phase-9.md +90 -90
  88. package/prompts/mobile/flow-build.md +135 -135
  89. package/prompts/mobile/flow-check-review.md +656 -20
  90. package/prompts/mobile/flow-check-test.md +526 -14
  91. package/prompts/mobile/flow-check.md +717 -67
  92. package/prompts/mobile/flow-commit.md +88 -119
  93. package/prompts/mobile/flow-docs-sync.md +620 -620
  94. package/prompts/mobile/flow-finish.md +919 -0
  95. package/prompts/mobile/flow-release.md +751 -0
  96. package/prompts/mobile/flow-work-api.md +1500 -0
  97. package/prompts/mobile/flow-work-feature.md +61 -61
  98. package/prompts/mobile/flow-work-fix.md +46 -46
  99. package/prompts/mobile/flow-work-refactor.md +48 -48
  100. package/prompts/mobile/flow-work-resume.md +34 -34
  101. package/prompts/mobile/flow-work.md +1605 -1329
  102. package/prompts/shared/mermaid-guidelines.md +102 -102
  103. package/prompts/shared/scope-levels.md +114 -114
  104. package/prompts/shared/smart-skip-preflight.md +214 -214
  105. package/prompts/shared/story-points.md +55 -55
  106. package/prompts/shared/task-format.md +74 -74
  107. package/prompts/shared/task-summary-template.md +277 -277
  108. package/templates/AGENT.template.md +443 -443
  109. package/templates/backend/.clauderules.template +112 -112
  110. package/templates/backend/.cursorrules.template +102 -102
  111. package/templates/backend/README.template.md +2 -2
  112. package/templates/backend/ai-instructions.template.md +2 -2
  113. package/templates/backend/copilot-instructions.template.md +2 -2
  114. package/templates/backend/docs/api.template.md +320 -320
  115. package/templates/backend/docs/business-flows.template.md +97 -97
  116. package/templates/backend/docs/code-standards.template.md +2 -2
  117. package/templates/backend/docs/contributing.template.md +3 -3
  118. package/templates/backend/docs/data-model.template.md +520 -520
  119. package/templates/backend/docs/testing.template.md +2 -2
  120. package/templates/backend/project-brief.template.md +2 -2
  121. package/templates/backend/specs/configuration.template.md +2 -2
  122. package/templates/backend/specs/security.template.md +2 -2
  123. package/templates/desktop/.clauderules.template +112 -112
  124. package/templates/desktop/.cursorrules.template +102 -102
  125. package/templates/desktop/README.template.md +170 -170
  126. package/templates/desktop/ai-instructions.template.md +366 -366
  127. package/templates/desktop/copilot-instructions.template.md +140 -140
  128. package/templates/desktop/docs/docs/api.template.md +320 -320
  129. package/templates/desktop/docs/docs/architecture.template.md +724 -724
  130. package/templates/desktop/docs/docs/business-flows.template.md +102 -102
  131. package/templates/desktop/docs/docs/code-standards.template.md +792 -792
  132. package/templates/desktop/docs/docs/contributing.template.md +149 -149
  133. package/templates/desktop/docs/docs/data-model.template.md +520 -520
  134. package/templates/desktop/docs/docs/operations.template.md +720 -720
  135. package/templates/desktop/docs/docs/testing.template.md +722 -722
  136. package/templates/desktop/project-brief.template.md +150 -150
  137. package/templates/desktop/specs/specs/configuration.template.md +121 -121
  138. package/templates/desktop/specs/specs/security.template.md +392 -392
  139. package/templates/frontend/README.template.md +2 -2
  140. package/templates/frontend/ai-instructions.template.md +2 -2
  141. package/templates/frontend/docs/api-integration.template.md +362 -362
  142. package/templates/frontend/docs/components.template.md +2 -2
  143. package/templates/frontend/docs/error-handling.template.md +360 -360
  144. package/templates/frontend/docs/operations.template.md +107 -107
  145. package/templates/frontend/docs/performance.template.md +124 -124
  146. package/templates/frontend/docs/pwa.template.md +119 -119
  147. package/templates/frontend/docs/state-management.template.md +2 -2
  148. package/templates/frontend/docs/styling.template.md +2 -2
  149. package/templates/frontend/docs/testing.template.md +2 -2
  150. package/templates/frontend/project-brief.template.md +2 -2
  151. package/templates/frontend/specs/accessibility.template.md +95 -95
  152. package/templates/frontend/specs/configuration.template.md +2 -2
  153. package/templates/frontend/specs/security.template.md +175 -175
  154. package/templates/fullstack/README.template.md +252 -252
  155. package/templates/fullstack/ai-instructions.template.md +444 -444
  156. package/templates/fullstack/project-brief.template.md +157 -157
  157. package/templates/fullstack/specs/configuration.template.md +340 -340
  158. package/templates/mobile/README.template.md +167 -167
  159. package/templates/mobile/ai-instructions.template.md +196 -196
  160. package/templates/mobile/docs/app-store.template.md +135 -135
  161. package/templates/mobile/docs/architecture.template.md +63 -63
  162. package/templates/mobile/docs/native-features.template.md +94 -94
  163. package/templates/mobile/docs/navigation.template.md +59 -59
  164. package/templates/mobile/docs/offline-strategy.template.md +65 -65
  165. package/templates/mobile/docs/permissions.template.md +56 -56
  166. package/templates/mobile/docs/state-management.template.md +85 -85
  167. package/templates/mobile/docs/testing.template.md +109 -109
  168. package/templates/mobile/project-brief.template.md +69 -69
  169. package/templates/mobile/specs/build-configuration.template.md +91 -91
  170. package/templates/mobile/specs/deployment.template.md +92 -92
  171. package/templates/work.template.md +61 -47
@@ -1,350 +1,350 @@
1
- ## PHASE 6: Testing (10-15 min)
2
-
3
- > **Order for this phase:** 6.1 → 6.2 → 6.3 → 6.4 → 6.5
4
-
5
- ### Objective
6
-
7
- Define the testing strategy for desktop applications, including unit, integration, and UI tests.
8
-
9
- ---
10
-
11
- ## 6.1 Testing Levels
12
-
13
- ```
14
- Which testing levels will you implement?
15
-
16
- A) 🧪 Unit Tests - Test individual methods/classes
17
- - Framework: JUnit 5 (recommended) or TestNG
18
- - Mocking: Mockito, EasyMock
19
- - Coverage goal: 70%+
20
- - Fast, isolated, repeatable
21
-
22
- B) 🔗 Integration Tests - Test component interactions
23
- - Database tests (H2 in-memory)
24
- - File I/O tests
25
- - Service integration tests
26
- - Coverage goal: 50%+
27
-
28
- C) 🖥️ UI Tests - Test user interface
29
- - Swing: AssertJ-Swing, Fest-Swing
30
- - JavaFX: TestFX
31
- - SWT: SWTBot
32
- - Coverage goal: 30%+ (critical flows)
33
-
34
- D) 🏁 End-to-End Tests - Full application flow
35
- - User scenarios
36
- - Test from UI to database
37
- - Manual or automated
38
-
39
- E) 🚀 Performance Tests - Measure performance
40
- - Startup time
41
- - Memory usage
42
- - Response time
43
- - JMH benchmarks
44
-
45
- Your testing levels: __
46
- ```
47
-
48
- ---
49
-
50
- ## 6.2 Unit Testing Strategy
51
-
52
- ```
53
- Unit testing approach:
54
-
55
- **Test Framework:**
56
- A) ⭐ JUnit 5 (Jupiter) - Modern, recommended
57
- - @Test, @BeforeEach, @AfterEach
58
- - Assertions, assumptions
59
- - Parameterized tests
60
-
61
- B) TestNG - Alternative framework
62
- - More features, more complex
63
- - Popular in enterprise
64
-
65
- Your choice: __
66
-
67
- **Mocking Framework:**
68
- A) ⭐ Mockito - Most popular
69
- - Mock objects, verify interactions
70
- - @Mock, @InjectMocks annotations
71
-
72
- B) EasyMock - Alternative
73
- C) PowerMock - For static methods (use sparingly)
74
- D) No mocking - Real objects only
75
-
76
- Your choice: __
77
-
78
- **Assertion Library:**
79
- A) JUnit Assertions - Built-in
80
- B) ⭐ AssertJ - Fluent assertions (recommended)
81
- - assertThat(user.getName()).isEqualTo("John")
82
- C) Hamcrest - Matcher-based assertions
83
-
84
- Your choice: __
85
-
86
- **Test Organization:**
87
- - Test class naming: [ClassName]Test or Test[ClassName]?
88
- A) UserServiceTest (suffix)
89
- B) TestUserService (prefix)
90
-
91
- - Test package: Same as source or separate?
92
- A) Same package as source (src/test/java/com/company/app/service/)
93
- B) Separate test package (src/test/java/test/service/)
94
-
95
- Your choices: __
96
- ```
97
-
98
- ---
99
-
100
- ## 6.3 UI Testing Strategy
101
-
102
- **For Swing:**
103
-
104
- ```
105
- UI testing for Swing applications:
106
-
107
- **Framework:**
108
- A) ⭐ AssertJ-Swing - Fluent API (recommended)
109
- - FrameFixture, DialogFixture
110
- - Component lookups
111
- - User interaction simulation
112
-
113
- B) Fest-Swing - Legacy (predecessor of AssertJ-Swing)
114
- C) Jemmy - NetBeans testing library
115
- D) Manual testing only
116
-
117
- Your choice: __
118
-
119
- **Test Approach:**
120
- A) Headless testing - Run without display (CI/CD)
121
- - System.setProperty("java.awt.headless", "true")
122
- B) Full UI testing - Real display required
123
- C) Hybrid - Headless for CI, full for local
124
-
125
- **Test Coverage:**
126
- - Critical flows: Login, main operations
127
- - Error scenarios: Invalid input, exceptions
128
- - Edge cases: Empty data, boundaries
129
- ```
130
-
131
- **For JavaFX:**
132
-
133
- ```
134
- UI testing for JavaFX applications:
135
-
136
- **Framework:**
137
- A) ⭐ TestFX - Official JavaFX testing (recommended)
138
- - FxRobot for interactions
139
- - Lookup API for components
140
- - Headless mode support
141
-
142
- Your choice: __
143
-
144
- **Test Approach:**
145
- A) Headless testing - Monocle headless platform
146
- - System.setProperty("testfx.robot", "glass")
147
- - System.setProperty("testfx.headless", "true")
148
- B) Full UI testing - Real display
149
-
150
- **Test Coverage:**
151
- - Scene graph testing
152
- - Property binding validation
153
- - CSS styling tests
154
- ```
155
-
156
- **For SWT:**
157
-
158
- ```
159
- UI testing for SWT applications:
160
-
161
- **Framework:**
162
- A) ⭐ SWTBot - Eclipse SWT testing (recommended)
163
- - Widget finders
164
- - User action simulation
165
- - Eclipse integration
166
-
167
- Your choice: __
168
-
169
- **Test Approach:**
170
- - Eclipse workbench testing
171
- - Plugin testing
172
- - RCP application testing
173
- ```
174
-
175
- ---
176
-
177
- ## 6.4 Test Data & Fixtures
178
-
179
- ````
180
- How will you manage test data?
181
-
182
- **Test Database:**
183
- A) ⭐ H2 in-memory - Fast, isolated (recommended)
184
- - jdbc:h2:mem:testdb
185
- - Reset between tests
186
-
187
- B) Test database instance - Separate test DB
188
- C) Docker containers - Testcontainers
189
- D) No database - Mock DAO layer
190
-
191
- Your choice: __
192
-
193
- **Test Data:**
194
- A) ✅ In-code test data - Small datasets
195
- ```java
196
- User user = new User("John", "john@example.com");
197
- ````
198
-
199
- B) ✅ Test fixtures - Shared setup
200
-
201
- ```java
202
- @BeforeEach
203
- void setUp() {
204
- testData = createTestData();
205
- }
206
- ```
207
-
208
- C) ✅ External files - JSON, CSV, SQL
209
-
210
- - src/test/resources/test-data.json
211
-
212
- D) ✅ Builders/Factories - Fluent test data creation
213
-
214
- ```java
215
- User user = UserBuilder.aUser()
216
- .withName("John")
217
- .withEmail("john@example.com")
218
- .build();
219
- ```
220
-
221
- Your choices: \_\_
222
-
223
- ```
224
-
225
- ---
226
-
227
- ## 6.5 CI/CD Integration
228
-
229
- ```
230
-
231
- Will you run tests in CI/CD?
232
-
233
- A) ✅ Yes - Automated testing on commit
234
-
235
- - GitHub Actions
236
- - GitLab CI
237
- - Jenkins
238
- - Travis CI
239
-
240
- B) ❌ No - Manual testing only
241
-
242
- If yes, specify:
243
-
244
- **Build Tool:**
245
- A) Maven - mvn test
246
- B) Gradle - gradle test
247
- C) Ant - ant test
248
-
249
- **Test Reports:**
250
- A) ✅ JUnit XML reports
251
- B) ✅ HTML reports (Surefire, Gradle)
252
- C) ✅ Code coverage reports (JaCoCo)
253
- D) ✅ SonarQube integration
254
-
255
- **Headless Mode:**
256
-
257
- - Run UI tests headless in CI?
258
- A) ✅ Yes - Xvfb (Linux), Headless mode
259
- B) ❌ No - Skip UI tests in CI
260
-
261
- **Fail on:**
262
- A) ✅ Test failures
263
- B) ✅ Coverage below threshold (e.g., 70%)
264
- C) ✅ Static analysis violations
265
-
266
- Your choices: \_\_
267
-
268
- ```
269
-
270
- ---
271
-
272
- ### Phase 6 Output
273
-
274
- ```
275
-
276
- 📋 PHASE 6 SUMMARY:
277
-
278
- Testing Levels:
279
-
280
- - Unit Tests: JUnit 5 + Mockito (70% coverage)
281
- - Integration Tests: H2 in-memory DB (50% coverage)
282
- - UI Tests: [AssertJ-Swing/TestFX/SWTBot] (30% coverage)
283
-
284
- Test Framework: [JUnit 5]
285
- Mocking: [Mockito]
286
- Assertions: [AssertJ]
287
- UI Testing: [AssertJ-Swing / TestFX / SWTBot]
288
- Test Database: [H2 in-memory]
289
- Test Data: [Builders, in-code, fixtures]
290
- CI/CD: [Yes - GitHub Actions / No]
291
- Build Tool: [Maven / Gradle / Ant]
292
-
293
- Is this correct? (Yes/No)
294
-
295
- ````
296
-
297
- ---
298
-
299
- ### 📄 Generate Test Configuration
300
-
301
- **Generate Maven Surefire configuration:**
302
- ```xml
303
- <plugin>
304
- <groupId>org.apache.maven.plugins</groupId>
305
- <artifactId>maven-surefire-plugin</artifactId>
306
- <version>3.0.0</version>
307
- </plugin>
308
- ````
309
-
310
- **Generate JaCoCo configuration:**
311
-
312
- ```xml
313
- <plugin>
314
- <groupId>org.jacoco</groupId>
315
- <artifactId>jacoco-maven-plugin</artifactId>
316
- <version>0.8.10</version>
317
- <executions>
318
- <execution>
319
- <goals>
320
- <goal>prepare-agent</goal>
321
- </goals>
322
- </execution>
323
- <execution>
324
- <id>report</id>
325
- <phase>test</phase>
326
- <goals>
327
- <goal>report</goal>
328
- </goals>
329
- </execution>
330
- </executions>
331
- </plugin>
332
- ```
333
-
334
- **Update `docs/DEVELOPMENT.md`:**
335
-
336
- - Testing strategy
337
- - How to run tests
338
- - Test coverage goals
339
- - CI/CD integration
340
-
341
- ---
342
-
343
- **Next Phase:** Phase 7 - Packaging & Deployment (15-20 min)
344
-
345
- Read: `.ai-flow/prompts/desktop/flow-build-phase-7.md`
346
-
347
- ---
348
-
349
- **Last Updated:** 2025-02-03
350
- **Version:** 1.0.0
1
+ ## PHASE 6: Testing (10-15 min)
2
+
3
+ > **Order for this phase:** 6.1 → 6.2 → 6.3 → 6.4 → 6.5
4
+
5
+ ### Objective
6
+
7
+ Define the testing strategy for desktop applications, including unit, integration, and UI tests.
8
+
9
+ ---
10
+
11
+ ## 6.1 Testing Levels
12
+
13
+ ```
14
+ Which testing levels will you implement?
15
+
16
+ A) 🧪 Unit Tests - Test individual methods/classes
17
+ - Framework: JUnit 5 (recommended) or TestNG
18
+ - Mocking: Mockito, EasyMock
19
+ - Coverage goal: 70%+
20
+ - Fast, isolated, repeatable
21
+
22
+ B) 🔗 Integration Tests - Test component interactions
23
+ - Database tests (H2 in-memory)
24
+ - File I/O tests
25
+ - Service integration tests
26
+ - Coverage goal: 50%+
27
+
28
+ C) 🖥️ UI Tests - Test user interface
29
+ - Swing: AssertJ-Swing, Fest-Swing
30
+ - JavaFX: TestFX
31
+ - SWT: SWTBot
32
+ - Coverage goal: 30%+ (critical flows)
33
+
34
+ D) 🏁 End-to-End Tests - Full application flow
35
+ - User scenarios
36
+ - Test from UI to database
37
+ - Manual or automated
38
+
39
+ E) 🚀 Performance Tests - Measure performance
40
+ - Startup time
41
+ - Memory usage
42
+ - Response time
43
+ - JMH benchmarks
44
+
45
+ Your testing levels: __
46
+ ```
47
+
48
+ ---
49
+
50
+ ## 6.2 Unit Testing Strategy
51
+
52
+ ```
53
+ Unit testing approach:
54
+
55
+ **Test Framework:**
56
+ A) ⭐ JUnit 5 (Jupiter) - Modern, recommended
57
+ - @Test, @BeforeEach, @AfterEach
58
+ - Assertions, assumptions
59
+ - Parameterized tests
60
+
61
+ B) TestNG - Alternative framework
62
+ - More features, more complex
63
+ - Popular in enterprise
64
+
65
+ Your choice: __
66
+
67
+ **Mocking Framework:**
68
+ A) ⭐ Mockito - Most popular
69
+ - Mock objects, verify interactions
70
+ - @Mock, @InjectMocks annotations
71
+
72
+ B) EasyMock - Alternative
73
+ C) PowerMock - For static methods (use sparingly)
74
+ D) No mocking - Real objects only
75
+
76
+ Your choice: __
77
+
78
+ **Assertion Library:**
79
+ A) JUnit Assertions - Built-in
80
+ B) ⭐ AssertJ - Fluent assertions (recommended)
81
+ - assertThat(user.getName()).isEqualTo("John")
82
+ C) Hamcrest - Matcher-based assertions
83
+
84
+ Your choice: __
85
+
86
+ **Test Organization:**
87
+ - Test class naming: [ClassName]Test or Test[ClassName]?
88
+ A) UserServiceTest (suffix)
89
+ B) TestUserService (prefix)
90
+
91
+ - Test package: Same as source or separate?
92
+ A) Same package as source (src/test/java/com/company/app/service/)
93
+ B) Separate test package (src/test/java/test/service/)
94
+
95
+ Your choices: __
96
+ ```
97
+
98
+ ---
99
+
100
+ ## 6.3 UI Testing Strategy
101
+
102
+ **For Swing:**
103
+
104
+ ```
105
+ UI testing for Swing applications:
106
+
107
+ **Framework:**
108
+ A) ⭐ AssertJ-Swing - Fluent API (recommended)
109
+ - FrameFixture, DialogFixture
110
+ - Component lookups
111
+ - User interaction simulation
112
+
113
+ B) Fest-Swing - Legacy (predecessor of AssertJ-Swing)
114
+ C) Jemmy - NetBeans testing library
115
+ D) Manual testing only
116
+
117
+ Your choice: __
118
+
119
+ **Test Approach:**
120
+ A) Headless testing - Run without display (CI/CD)
121
+ - System.setProperty("java.awt.headless", "true")
122
+ B) Full UI testing - Real display required
123
+ C) Hybrid - Headless for CI, full for local
124
+
125
+ **Test Coverage:**
126
+ - Critical flows: Login, main operations
127
+ - Error scenarios: Invalid input, exceptions
128
+ - Edge cases: Empty data, boundaries
129
+ ```
130
+
131
+ **For JavaFX:**
132
+
133
+ ```
134
+ UI testing for JavaFX applications:
135
+
136
+ **Framework:**
137
+ A) ⭐ TestFX - Official JavaFX testing (recommended)
138
+ - FxRobot for interactions
139
+ - Lookup API for components
140
+ - Headless mode support
141
+
142
+ Your choice: __
143
+
144
+ **Test Approach:**
145
+ A) Headless testing - Monocle headless platform
146
+ - System.setProperty("testfx.robot", "glass")
147
+ - System.setProperty("testfx.headless", "true")
148
+ B) Full UI testing - Real display
149
+
150
+ **Test Coverage:**
151
+ - Scene graph testing
152
+ - Property binding validation
153
+ - CSS styling tests
154
+ ```
155
+
156
+ **For SWT:**
157
+
158
+ ```
159
+ UI testing for SWT applications:
160
+
161
+ **Framework:**
162
+ A) ⭐ SWTBot - Eclipse SWT testing (recommended)
163
+ - Widget finders
164
+ - User action simulation
165
+ - Eclipse integration
166
+
167
+ Your choice: __
168
+
169
+ **Test Approach:**
170
+ - Eclipse workbench testing
171
+ - Plugin testing
172
+ - RCP application testing
173
+ ```
174
+
175
+ ---
176
+
177
+ ## 6.4 Test Data & Fixtures
178
+
179
+ ````
180
+ How will you manage test data?
181
+
182
+ **Test Database:**
183
+ A) ⭐ H2 in-memory - Fast, isolated (recommended)
184
+ - jdbc:h2:mem:testdb
185
+ - Reset between tests
186
+
187
+ B) Test database instance - Separate test DB
188
+ C) Docker containers - Testcontainers
189
+ D) No database - Mock DAO layer
190
+
191
+ Your choice: __
192
+
193
+ **Test Data:**
194
+ A) ✅ In-code test data - Small datasets
195
+ ```java
196
+ User user = new User("John", "john@example.com");
197
+ ````
198
+
199
+ B) ✅ Test fixtures - Shared setup
200
+
201
+ ```java
202
+ @BeforeEach
203
+ void setUp() {
204
+ testData = createTestData();
205
+ }
206
+ ```
207
+
208
+ C) ✅ External files - JSON, CSV, SQL
209
+
210
+ - src/test/resources/test-data.json
211
+
212
+ D) ✅ Builders/Factories - Fluent test data creation
213
+
214
+ ```java
215
+ User user = UserBuilder.aUser()
216
+ .withName("John")
217
+ .withEmail("john@example.com")
218
+ .build();
219
+ ```
220
+
221
+ Your choices: \_\_
222
+
223
+ ```
224
+
225
+ ---
226
+
227
+ ## 6.5 CI/CD Integration
228
+
229
+ ```
230
+
231
+ Will you run tests in CI/CD?
232
+
233
+ A) ✅ Yes - Automated testing on commit
234
+
235
+ - GitHub Actions
236
+ - GitLab CI
237
+ - Jenkins
238
+ - Travis CI
239
+
240
+ B) ❌ No - Manual testing only
241
+
242
+ If yes, specify:
243
+
244
+ **Build Tool:**
245
+ A) Maven - mvn test
246
+ B) Gradle - gradle test
247
+ C) Ant - ant test
248
+
249
+ **Test Reports:**
250
+ A) ✅ JUnit XML reports
251
+ B) ✅ HTML reports (Surefire, Gradle)
252
+ C) ✅ Code coverage reports (JaCoCo)
253
+ D) ✅ SonarQube integration
254
+
255
+ **Headless Mode:**
256
+
257
+ - Run UI tests headless in CI?
258
+ A) ✅ Yes - Xvfb (Linux), Headless mode
259
+ B) ❌ No - Skip UI tests in CI
260
+
261
+ **Fail on:**
262
+ A) ✅ Test failures
263
+ B) ✅ Coverage below threshold (e.g., 70%)
264
+ C) ✅ Static analysis violations
265
+
266
+ Your choices: \_\_
267
+
268
+ ```
269
+
270
+ ---
271
+
272
+ ### Phase 6 Output
273
+
274
+ ```
275
+
276
+ 📋 PHASE 6 SUMMARY:
277
+
278
+ Testing Levels:
279
+
280
+ - Unit Tests: JUnit 5 + Mockito (70% coverage)
281
+ - Integration Tests: H2 in-memory DB (50% coverage)
282
+ - UI Tests: [AssertJ-Swing/TestFX/SWTBot] (30% coverage)
283
+
284
+ Test Framework: [JUnit 5]
285
+ Mocking: [Mockito]
286
+ Assertions: [AssertJ]
287
+ UI Testing: [AssertJ-Swing / TestFX / SWTBot]
288
+ Test Database: [H2 in-memory]
289
+ Test Data: [Builders, in-code, fixtures]
290
+ CI/CD: [Yes - GitHub Actions / No]
291
+ Build Tool: [Maven / Gradle / Ant]
292
+
293
+ Is this correct? (Yes/No)
294
+
295
+ ````
296
+
297
+ ---
298
+
299
+ ### 📄 Generate Test Configuration
300
+
301
+ **Generate Maven Surefire configuration:**
302
+ ```xml
303
+ <plugin>
304
+ <groupId>org.apache.maven.plugins</groupId>
305
+ <artifactId>maven-surefire-plugin</artifactId>
306
+ <version>3.0.0</version>
307
+ </plugin>
308
+ ````
309
+
310
+ **Generate JaCoCo configuration:**
311
+
312
+ ```xml
313
+ <plugin>
314
+ <groupId>org.jacoco</groupId>
315
+ <artifactId>jacoco-maven-plugin</artifactId>
316
+ <version>0.8.10</version>
317
+ <executions>
318
+ <execution>
319
+ <goals>
320
+ <goal>prepare-agent</goal>
321
+ </goals>
322
+ </execution>
323
+ <execution>
324
+ <id>report</id>
325
+ <phase>test</phase>
326
+ <goals>
327
+ <goal>report</goal>
328
+ </goals>
329
+ </execution>
330
+ </executions>
331
+ </plugin>
332
+ ```
333
+
334
+ **Update `docs/DEVELOPMENT.md`:**
335
+
336
+ - Testing strategy
337
+ - How to run tests
338
+ - Test coverage goals
339
+ - CI/CD integration
340
+
341
+ ---
342
+
343
+ **Next Phase:** Phase 7 - Packaging & Deployment (15-20 min)
344
+
345
+ Read: `.ai-flow/prompts/desktop/flow-build-phase-7.md`
346
+
347
+ ---
348
+
349
+ **Last Updated:** 2025-02-03
350
+ **Version:** 1.0.0