speccrew 0.1.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.
- package/.speccrew/agents/speccrew-feature-designer.md +142 -0
- package/.speccrew/agents/speccrew-product-manager.md +61 -0
- package/.speccrew/agents/speccrew-system-designer.md +200 -0
- package/.speccrew/agents/speccrew-system-developer.md +238 -0
- package/.speccrew/agents/speccrew-task-worker.md +80 -0
- package/.speccrew/agents/speccrew-team-leader.md +92 -0
- package/.speccrew/agents/speccrew-test-manager.md +313 -0
- package/.speccrew/skills/speccrew-create-agents/SKILL.md +98 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/designer-agent.md +54 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/dev-agent.md +79 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/test-agent.md +80 -0
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +205 -0
- package/.speccrew/skills/speccrew-dev-backend/templates/TASK-RECORD-TEMPLATE.md +118 -0
- package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +258 -0
- package/.speccrew/skills/speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md +161 -0
- package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +202 -0
- package/.speccrew/skills/speccrew-dev-frontend/templates/TASK-RECORD-TEMPLATE.md +115 -0
- package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +200 -0
- package/.speccrew/skills/speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md +125 -0
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +73 -0
- package/.speccrew/skills/speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md +96 -0
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +395 -0
- package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +387 -0
- package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +80 -0
- package/.speccrew/skills/speccrew-get-timestamp/scripts/get-timestamp.js +35 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +1116 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-FASTAPI.md +462 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-JAVA.md +480 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-NET.md +464 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE.md +480 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/MODULE-OVERVIEW-TEMPLATE.md +367 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +667 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +74 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +176 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +150 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +106 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +249 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +848 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +226 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +264 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +34 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +867 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +26 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +165 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/apply-module-mapping.js +208 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/extract-module-summary.js +180 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/reindex-modules.js +358 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +1055 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-DESKTOP.md +303 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-ELECTRON.md +327 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MINIAPP.md +292 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MOBILE.md +281 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI.md +324 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +270 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/COMPONENT-PATTERN-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/LAYOUT-PATTERN-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/PAGE-TYPE-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +229 -0
- package/.speccrew/skills/speccrew-knowledge-graph-query/scripts/graph-query.js +549 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +181 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/scripts/graph-write.js +651 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +305 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md +400 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +351 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md +294 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +683 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +550 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/templates/techs-manifest-EXAMPLE.json +35 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +1087 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/ARCHITECTURE-TEMPLATE.md +240 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COLOR-SYSTEM-TEMPLATE.md +68 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COMPONENT-LIBRARY-TEMPLATE.md +86 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-BUILD-TEMPLATE.md +466 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DATA-TEMPLATE.md +432 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DESIGN-TEMPLATE.md +1209 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DEV-TEMPLATE.md +1433 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md +1052 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md +946 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/INDEX-TEMPLATE.md +29 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-LAYOUTS-TEMPLATE.md +69 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +74 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/TECH-STACK-TEMPLATE.md +232 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +628 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +392 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +489 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md +243 -0
- package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +269 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +562 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/BUSINESS-COMPONENTS-TEMPLATE.md +171 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMMON-COMPONENTS-TEMPLATE.md +177 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-INDIVIDUAL-TEMPLATE.md +80 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-LIBRARY-TEMPLATE.md +118 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-INDIVIDUAL-TEMPLATE.md +97 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-PATTERNS-TEMPLATE.md +208 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/NAVIGATION-PATTERNS-TEMPLATE.md +157 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md +123 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +58 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/SPACING-TEMPLATE.md +119 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/STYLE-SYSTEM-TEMPLATE.md +117 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/TYPOGRAPHY-TEMPLATE.md +107 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/UI-STYLE-GUIDE-TEMPLATE.md +171 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +434 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md +332 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +200 -0
- package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +195 -0
- package/.speccrew/skills/speccrew-project-diagnosis/SKILL.md +208 -0
- package/.speccrew/skills/speccrew-project-diagnosis/templates/DIAGNOSIS-REPORT-TEMPLATE.md +202 -0
- package/.speccrew/skills/speccrew-sd-backend/SKILL.md +188 -0
- package/.speccrew/skills/speccrew-sd-backend/templates/INDEX-TEMPLATE.md +85 -0
- package/.speccrew/skills/speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md +269 -0
- package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +192 -0
- package/.speccrew/skills/speccrew-sd-desktop/templates/INDEX-TEMPLATE.md +271 -0
- package/.speccrew/skills/speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md +673 -0
- package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +176 -0
- package/.speccrew/skills/speccrew-sd-frontend/templates/INDEX-TEMPLATE.md +184 -0
- package/.speccrew/skills/speccrew-sd-frontend/templates/SD-FRONTEND-TEMPLATE.md +382 -0
- package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +189 -0
- package/.speccrew/skills/speccrew-sd-mobile/templates/INDEX-TEMPLATE.md +219 -0
- package/.speccrew/skills/speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md +534 -0
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +284 -0
- package/.speccrew/skills/speccrew-test-case-design/templates/TEST-CASE-DESIGN-TEMPLATE.md +263 -0
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +313 -0
- package/.speccrew/skills/speccrew-test-code-gen/templates/TEST-CODE-PLAN-TEMPLATE.md +180 -0
- package/.speccrew/skills/speccrew-test-execute/SKILL.md +283 -0
- package/.speccrew/skills/speccrew-test-execute/templates/BUG-REPORT-TEMPLATE.md +50 -0
- package/.speccrew/skills/speccrew-test-execute/templates/TEST-REPORT-TEMPLATE.md +57 -0
- package/.speccrew/skills/speccrew-workflow-diagnose/SKILL.md +155 -0
- package/LICENSE +21 -0
- package/README.ar.md +318 -0
- package/README.en.md +318 -0
- package/README.es.md +318 -0
- package/README.md +340 -0
- package/bin/cli.js +62 -0
- package/lib/commands/doctor.js +138 -0
- package/lib/commands/init.js +231 -0
- package/lib/commands/list.js +114 -0
- package/lib/commands/uninstall.js +117 -0
- package/lib/commands/update.js +351 -0
- package/lib/ide-adapters.js +73 -0
- package/lib/utils.js +104 -0
- package/package.json +28 -0
- package/workspace-template/docs/configs/document-templates.json +667 -0
- package/workspace-template/docs/configs/platform-mapping.json +194 -0
- package/workspace-template/docs/configs/tech-stack-mappings.json +313 -0
- package/workspace-template/docs/configs/validation-rules.json +87 -0
- package/workspace-template/docs/rules/mermaid-rule.md +114 -0
- package/workspace-template/docs/solutions/Agent/346/212/200/350/203/275/345/256/232/344/271/211+/351/234/200/346/261/202/346/226/207/346/241/243+UML/344/275/277/347/224/250/346/250/241/346/235/277/357/274/210ISA-95/345/205/255/346/256/265/345/274/217/350/236/215/345/220/210/347/211/210/357/274/211.md +586 -0
- package/workspace-template/docs/solutions/agent-knowledge-map.md +238 -0
- package/workspace-template/docs/solutions/bizs-knowledge-pipeline.md +678 -0
- package/workspace-template/docs/solutions/harness.md +410 -0
- package/workspace-template/docs/solutions/knowledge-incremental-sync-spec.md +943 -0
- package/workspace-template/docs/solutions/techs-knowledge-pipeline.md +803 -0
- package/workspace-template/docs/solutions/workspace-structure.md +318 -0
|
@@ -0,0 +1,946 @@
|
|
|
1
|
+
# {{platform_name}} Testing Conventions
|
|
2
|
+
|
|
3
|
+
<cite>
|
|
4
|
+
**Files Referenced in This Document**
|
|
5
|
+
{{#each source_files}}
|
|
6
|
+
- [{{name}}]({{path}})
|
|
7
|
+
{{/each}}
|
|
8
|
+
</cite>
|
|
9
|
+
|
|
10
|
+
> **Target Audience**: devcrew-designer-{{platform_id}}, devcrew-dev-{{platform_id}}, devcrew-test-{{platform_id}}
|
|
11
|
+
|
|
12
|
+
## Table of Contents
|
|
13
|
+
|
|
14
|
+
1. [Testing Framework & Toolchain](#1-testing-framework--toolchain)
|
|
15
|
+
2. [Test Organization & Naming (Platform-Specific)](#2-test-organization--naming-platform-specific)
|
|
16
|
+
3. [Test Layering & Boundaries](#3-test-layering--boundaries)
|
|
17
|
+
4. [Unit Testing Patterns (Platform-Specific)](#4-unit-testing-patterns-platform-specific)
|
|
18
|
+
5. [Integration Testing Patterns (Platform-Specific)](#5-integration-testing-patterns-platform-specific)
|
|
19
|
+
6. [Exception Testing](#6-exception-testing)
|
|
20
|
+
7. [Mocking Strategy (Platform-Specific)](#7-mocking-strategy-platform-specific)
|
|
21
|
+
8. [Test Data Management (Platform-Specific)](#8-test-data-management-platform-specific)
|
|
22
|
+
9. [Coverage Requirements](#9-coverage-requirements)
|
|
23
|
+
10. [Test Reuse & Maintenance](#10-test-reuse--maintenance)
|
|
24
|
+
11. [Security Testing](#11-security-testing)
|
|
25
|
+
12. [Performance Testing (Platform-Specific)](#12-performance-testing-platform-specific)
|
|
26
|
+
13. [Test Environment & Configuration](#13-test-environment--configuration)
|
|
27
|
+
14. [CI/CD Integration](#14-cicd-integration)
|
|
28
|
+
15. [Anti-Patterns & Pitfalls](#15-anti-patterns--pitfalls)
|
|
29
|
+
16. [Appendix](#appendix)
|
|
30
|
+
|
|
31
|
+
## 1. Testing Framework & Toolchain
|
|
32
|
+
|
|
33
|
+
<!-- AI-TAG: TEST_FRAMEWORK -->
|
|
34
|
+
<!-- List frameworks for THIS platform's language/runtime. Backend examples: JUnit5/Mockito (Java), pytest (Python), Jest/Supertest (Node.js). Frontend examples: Jest/Vitest (Vue/React), Cypress/Playwright (E2E). Mobile examples: Jest (React Native), flutter_test (Flutter). -->
|
|
35
|
+
|
|
36
|
+
### Primary Testing Frameworks
|
|
37
|
+
|
|
38
|
+
| Framework | Version | Purpose | Scope |
|
|
39
|
+
|-----------|---------|---------|-------|
|
|
40
|
+
{{#each testing_frameworks}}
|
|
41
|
+
| {{name}} | {{version}} | {{purpose}} | {{scope}} |
|
|
42
|
+
{{/each}}
|
|
43
|
+
|
|
44
|
+
### Auxiliary Tools
|
|
45
|
+
|
|
46
|
+
<!-- Fill with: assertion libraries, coverage tools, reporting tools -->
|
|
47
|
+
|
|
48
|
+
| Tool | Category | Purpose | Integration |
|
|
49
|
+
|------|----------|---------|-------------|
|
|
50
|
+
{{#each auxiliary_tools}}
|
|
51
|
+
| {{name}} | {{category}} | {{purpose}} | {{integration}} |
|
|
52
|
+
{{/each}}
|
|
53
|
+
|
|
54
|
+
**Section Source**
|
|
55
|
+
{{#each test_framework_sources}}
|
|
56
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
57
|
+
{{/each}}
|
|
58
|
+
|
|
59
|
+
## 2. Test Organization & Naming (Platform-Specific)
|
|
60
|
+
|
|
61
|
+
<!-- AI-TAG: TEST_ORGANIZATION -->
|
|
62
|
+
<!-- Backend: typically src/test/java mirroring src/main/java. Frontend: typically src/__tests__ or *.spec.ts co-located with source. Describe the convention used in THIS platform. -->
|
|
63
|
+
|
|
64
|
+
### Test Directory Structure
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
{{test_directory_structure}}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```mermaid
|
|
71
|
+
graph TB
|
|
72
|
+
{{#each test_components}}
|
|
73
|
+
{{id}}["{{name}}"]
|
|
74
|
+
{{/each}}
|
|
75
|
+
{{#each test_relations}}
|
|
76
|
+
{{from}} --> {{to}}
|
|
77
|
+
{{/each}}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Diagram Source**
|
|
81
|
+
{{#each structure_sources}}
|
|
82
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
83
|
+
{{/each}}
|
|
84
|
+
|
|
85
|
+
### Test File Naming Conventions
|
|
86
|
+
|
|
87
|
+
| Test Type | Naming Pattern | Example | Scenario Naming Rule |
|
|
88
|
+
|-----------|---------------|---------|---------------------|
|
|
89
|
+
{{#each test_file_naming}}
|
|
90
|
+
| {{type}} | {{pattern}} | {{example}} | {{scenario_rule}} |
|
|
91
|
+
{{/each}}
|
|
92
|
+
|
|
93
|
+
### Test Class to Source Class Mapping
|
|
94
|
+
|
|
95
|
+
<!-- Fill with: correspondence rules between test classes and classes under test -->
|
|
96
|
+
|
|
97
|
+
| Source Class Location | Test Class Location | Naming Convention |
|
|
98
|
+
|----------------------|--------------------|--------------------|
|
|
99
|
+
{{#each class_mapping}}
|
|
100
|
+
| {{source_location}} | {{test_location}} | {{convention}} |
|
|
101
|
+
{{/each}}
|
|
102
|
+
|
|
103
|
+
### Test Method Naming Template
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
test<MethodName>_<Scenario>_<ExpectedResult>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Examples:**
|
|
110
|
+
- `testCalculateDiscount_WithValidCoupon_ReturnsDiscountedPrice`
|
|
111
|
+
- `testCreateUser_WithDuplicateEmail_ThrowsUserExistsException`
|
|
112
|
+
- `testProcessPayment_WhenTimeout_ThrowsPaymentException`
|
|
113
|
+
|
|
114
|
+
**Section Source**
|
|
115
|
+
{{#each test_organization_sources}}
|
|
116
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
117
|
+
{{/each}}
|
|
118
|
+
|
|
119
|
+
## 3. Test Layering & Boundaries
|
|
120
|
+
|
|
121
|
+
<!-- AI-TAG: TEST_LAYERING -->
|
|
122
|
+
<!-- Fill with: test layer definitions, scope, dependencies, and granularity standards -->
|
|
123
|
+
|
|
124
|
+
### Test Layer Definitions
|
|
125
|
+
|
|
126
|
+
| Layer | Scope | Dependencies Allowed | Forbidden | Granularity |
|
|
127
|
+
|-------|-------|---------------------|-----------|-------------|
|
|
128
|
+
{{#each test_layers}}
|
|
129
|
+
| {{name}} | {{scope}} | {{dependencies}} | {{forbidden}} | {{granularity}} |
|
|
130
|
+
{{/each}}
|
|
131
|
+
|
|
132
|
+
### Layer Decision Guide
|
|
133
|
+
|
|
134
|
+
<!-- Fill with: guidelines for choosing between unit, integration, and E2E tests -->
|
|
135
|
+
|
|
136
|
+
**When to Write Unit Tests:**
|
|
137
|
+
{{#each unit_test_when}}
|
|
138
|
+
- {{this}}
|
|
139
|
+
{{/each}}
|
|
140
|
+
|
|
141
|
+
**When to Write Integration Tests:**
|
|
142
|
+
{{#each integration_test_when}}
|
|
143
|
+
- {{this}}
|
|
144
|
+
{{/each}}
|
|
145
|
+
|
|
146
|
+
**When to Write E2E Tests:**
|
|
147
|
+
{{#each e2e_test_when}}
|
|
148
|
+
- {{this}}
|
|
149
|
+
{{/each}}
|
|
150
|
+
|
|
151
|
+
### Layer Isolation Rules
|
|
152
|
+
|
|
153
|
+
<!-- Fill with: rules for maintaining proper test isolation between layers -->
|
|
154
|
+
|
|
155
|
+
| Rule | Description | Enforcement |
|
|
156
|
+
|------|-------------|-------------|
|
|
157
|
+
{{#each layer_isolation_rules}}
|
|
158
|
+
| {{name}} | {{description}} | {{enforcement}} |
|
|
159
|
+
{{/each}}
|
|
160
|
+
|
|
161
|
+
**Section Source**
|
|
162
|
+
{{#each test_layering_sources}}
|
|
163
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
164
|
+
{{/each}}
|
|
165
|
+
|
|
166
|
+
## 4. Unit Testing Patterns (Platform-Specific)
|
|
167
|
+
|
|
168
|
+
<!-- AI-TAG: UNIT_TESTING -->
|
|
169
|
+
<!-- Fill with unit testing patterns specific to this platform. Backend: Service/Repository/Controller layer testing. Frontend: Component/Composable/Store testing. Provide examples in this platform's language. -->
|
|
170
|
+
|
|
171
|
+
### AAA Pattern (Arrange-Act-Assert)
|
|
172
|
+
|
|
173
|
+
```mermaid
|
|
174
|
+
flowchart TD
|
|
175
|
+
Arrange["Arrange: Setup test data<br/>- Initialize mocks<br/>- Prepare test data<br/>- Configure stubs"] -->
|
|
176
|
+
Act["Act: Execute the method<br/>- Call method under test<br/>- Capture return value<br/>- Trigger side effects"] -->
|
|
177
|
+
Assert["Assert: Verify results<br/>- Assert return value<br/>- Verify mock interactions<br/>- Check state changes"]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Diagram Source**
|
|
181
|
+
{{#each aaa_pattern_sources}}
|
|
182
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
183
|
+
{{/each}}
|
|
184
|
+
|
|
185
|
+
### Service Layer Unit Testing
|
|
186
|
+
|
|
187
|
+
<!-- Fill with: Service layer testing patterns (if backend) -->
|
|
188
|
+
|
|
189
|
+
**Pattern:**
|
|
190
|
+
{{service_layer_test_pattern}}
|
|
191
|
+
|
|
192
|
+
**Good Example:**
|
|
193
|
+
```{{language}}
|
|
194
|
+
{{service_test_good_example}}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Bad Example:**
|
|
198
|
+
```{{language}}
|
|
199
|
+
{{service_test_bad_example}}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Controller Layer Unit Testing (if applicable)
|
|
203
|
+
|
|
204
|
+
<!-- Fill with: Controller/API layer testing patterns (if backend) -->
|
|
205
|
+
|
|
206
|
+
**Pattern:**
|
|
207
|
+
{{controller_layer_test_pattern}}
|
|
208
|
+
|
|
209
|
+
**Good Example:**
|
|
210
|
+
```{{language}}
|
|
211
|
+
{{controller_test_good_example}}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Component Unit Testing (if frontend)
|
|
215
|
+
|
|
216
|
+
<!-- Fill with: Component testing patterns (if frontend) -->
|
|
217
|
+
|
|
218
|
+
**Pattern:**
|
|
219
|
+
{{component_test_pattern}}
|
|
220
|
+
|
|
221
|
+
**Good Example:**
|
|
222
|
+
```{{language}}
|
|
223
|
+
{{component_test_good_example}}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Section Source**
|
|
227
|
+
{{#each unit_testing_sources}}
|
|
228
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
229
|
+
{{/each}}
|
|
230
|
+
|
|
231
|
+
## 5. Integration Testing Patterns (Platform-Specific)
|
|
232
|
+
|
|
233
|
+
<!-- AI-TAG: INTEGRATION_TESTING -->
|
|
234
|
+
<!-- Fill with: database, API, and cross-service integration testing patterns -->
|
|
235
|
+
|
|
236
|
+
### Database Integration Testing
|
|
237
|
+
|
|
238
|
+
<!-- Fill with: Mapper/Repository testing patterns (if backend) -->
|
|
239
|
+
|
|
240
|
+
**Pattern:**
|
|
241
|
+
{{database_integration_pattern}}
|
|
242
|
+
|
|
243
|
+
**Test Setup:**
|
|
244
|
+
```{{language}}
|
|
245
|
+
{{database_test_example}}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### API Integration Testing
|
|
249
|
+
|
|
250
|
+
<!-- Fill with: API/controller integration testing patterns -->
|
|
251
|
+
|
|
252
|
+
**Pattern:**
|
|
253
|
+
{{api_integration_pattern}}
|
|
254
|
+
|
|
255
|
+
**Test Setup:**
|
|
256
|
+
```{{language}}
|
|
257
|
+
{{api_test_example}}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Cross-Service Integration Testing (if applicable)
|
|
261
|
+
|
|
262
|
+
<!-- Fill with: microservice integration testing patterns (if applicable) -->
|
|
263
|
+
|
|
264
|
+
**Pattern:**
|
|
265
|
+
{{cross_service_pattern}}
|
|
266
|
+
|
|
267
|
+
**Test Setup:**
|
|
268
|
+
```{{language}}
|
|
269
|
+
{{cross_service_test_example}}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Frontend Integration Testing (if frontend platform)
|
|
273
|
+
|
|
274
|
+
<!-- AI-TAG: FRONTEND_INTEGRATION_TEST -->
|
|
275
|
+
<!-- Fill with frontend integration testing patterns. If backend platform, skip this subsection. -->
|
|
276
|
+
|
|
277
|
+
#### Component + Store Integration
|
|
278
|
+
|
|
279
|
+
| Test Scenario | Setup | Verification |
|
|
280
|
+
|--------------|-------|-------------|
|
|
281
|
+
| scenario | setup_approach | verification_approach |
|
|
282
|
+
|
|
283
|
+
```lang
|
|
284
|
+
// Example: Component integration with state store
|
|
285
|
+
frontend_store_integration_example
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
#### Component + API Mock Integration
|
|
289
|
+
|
|
290
|
+
| Test Scenario | Mock Strategy | Verification |
|
|
291
|
+
|--------------|--------------|-------------|
|
|
292
|
+
| scenario | mock_strategy | verification_approach |
|
|
293
|
+
|
|
294
|
+
```lang
|
|
295
|
+
// Example: Component integration with mocked API
|
|
296
|
+
frontend_api_integration_example
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
#### Route Navigation Testing
|
|
300
|
+
|
|
301
|
+
| Test Scenario | Setup | Verification |
|
|
302
|
+
|--------------|-------|-------------|
|
|
303
|
+
| scenario | setup_approach | verification_approach |
|
|
304
|
+
|
|
305
|
+
### Integration Test Data Management
|
|
306
|
+
|
|
307
|
+
| Strategy | When to Use | Implementation |
|
|
308
|
+
|----------|------------|----------------|
|
|
309
|
+
{{#each integration_data_strategies}}
|
|
310
|
+
| {{name}} | {{when_to_use}} | {{implementation}} |
|
|
311
|
+
{{/each}}
|
|
312
|
+
|
|
313
|
+
**Section Source**
|
|
314
|
+
{{#each integration_testing_sources}}
|
|
315
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
316
|
+
{{/each}}
|
|
317
|
+
|
|
318
|
+
## 6. Exception Testing
|
|
319
|
+
|
|
320
|
+
<!-- AI-TAG: EXCEPTION_TESTING -->
|
|
321
|
+
<!-- Fill with: exception categories, coverage requirements, assertion standards -->
|
|
322
|
+
|
|
323
|
+
### Exception Categories and Coverage
|
|
324
|
+
|
|
325
|
+
| Exception Category | Examples | Must Test | Assertion Standard |
|
|
326
|
+
|-------------------|----------|-----------|-------------------|
|
|
327
|
+
{{#each exception_categories}}
|
|
328
|
+
| {{category}} | {{examples}} | {{must_test}} | {{assertion_standard}} |
|
|
329
|
+
{{/each}}
|
|
330
|
+
|
|
331
|
+
### Boundary Exception Scenarios Checklist
|
|
332
|
+
|
|
333
|
+
<!-- Fill with: common boundary exception scenarios to test -->
|
|
334
|
+
|
|
335
|
+
- [ ] Null input parameters
|
|
336
|
+
- [ ] Empty collections/strings
|
|
337
|
+
- [ ] Boundary values (min/max limits)
|
|
338
|
+
- [ ] Invalid enum values
|
|
339
|
+
- [ ] Malformed data formats
|
|
340
|
+
- [ ] Resource not found
|
|
341
|
+
- [ ] Permission denied
|
|
342
|
+
- [ ] Timeout scenarios
|
|
343
|
+
- [ ] Concurrent access conflicts
|
|
344
|
+
|
|
345
|
+
### Exception Testing Code Examples
|
|
346
|
+
|
|
347
|
+
**Good Example:**
|
|
348
|
+
```{{language}}
|
|
349
|
+
{{exception_test_good_example}}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
**Bad Example:**
|
|
353
|
+
```{{language}}
|
|
354
|
+
{{exception_test_bad_example}}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**Section Source**
|
|
358
|
+
{{#each exception_testing_sources}}
|
|
359
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
360
|
+
{{/each}}
|
|
361
|
+
|
|
362
|
+
## 7. Mocking Strategy (Platform-Specific)
|
|
363
|
+
|
|
364
|
+
<!-- AI-TAG: MOCKING_STRATEGY -->
|
|
365
|
+
<!-- Backend: focus on mocking repositories, external services, message queues. Frontend: focus on mocking HTTP requests, browser APIs, third-party libraries. Describe mocking tools and patterns used in THIS platform. -->
|
|
366
|
+
|
|
367
|
+
### Mock Scenarios and Granularity
|
|
368
|
+
|
|
369
|
+
| Component | Mock Granularity | Verification Required | Example |
|
|
370
|
+
|-----------|-----------------|----------------------|---------|
|
|
371
|
+
{{#each mock_scenarios}}
|
|
372
|
+
| {{component}} | {{granularity}} | {{verification}} | {{example}} |
|
|
373
|
+
{{/each}}
|
|
374
|
+
|
|
375
|
+
### Mock vs Spy Selection Guide
|
|
376
|
+
|
|
377
|
+
| Scenario | Use Mock | Use Spy |
|
|
378
|
+
|----------|----------|---------|
|
|
379
|
+
{{#each mock_spy_guide}}
|
|
380
|
+
| {{scenario}} | {{use_mock}} | {{use_spy}} |
|
|
381
|
+
{{/each}}
|
|
382
|
+
|
|
383
|
+
### Mock Verification Rules
|
|
384
|
+
|
|
385
|
+
<!-- Fill with: rules for verifying mock interactions -->
|
|
386
|
+
|
|
387
|
+
| Rule | Description | Example |
|
|
388
|
+
|------|-------------|---------|
|
|
389
|
+
{{#each mock_verification_rules}}
|
|
390
|
+
| {{name}} | {{description}} | {{example}} |
|
|
391
|
+
{{/each}}
|
|
392
|
+
|
|
393
|
+
### Core Mock Usage Patterns
|
|
394
|
+
|
|
395
|
+
**When/Then Pattern:**
|
|
396
|
+
```{{language}}
|
|
397
|
+
{{mock_when_then_example}}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**DoThrow Pattern:**
|
|
401
|
+
```{{language}}
|
|
402
|
+
{{mock_dothrow_example}}
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
**Verify Pattern:**
|
|
406
|
+
```{{language}}
|
|
407
|
+
{{mock_verify_example}}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
**Argument Matchers:**
|
|
411
|
+
```{{language}}
|
|
412
|
+
{{mock_matchers_example}}
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
**Section Source**
|
|
416
|
+
{{#each mocking_strategy_sources}}
|
|
417
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
418
|
+
{{/each}}
|
|
419
|
+
|
|
420
|
+
## 8. Test Data Management (Platform-Specific)
|
|
421
|
+
|
|
422
|
+
<!-- AI-TAG: TEST_DATA -->
|
|
423
|
+
<!-- Fill with: test data strategies, SQL scripts, TestDataFactory patterns -->
|
|
424
|
+
|
|
425
|
+
### Test Data Strategies
|
|
426
|
+
|
|
427
|
+
| Strategy | When to Use | Example | Pros/Cons |
|
|
428
|
+
|----------|------------|---------|-----------|
|
|
429
|
+
{{#each test_data_strategies}}
|
|
430
|
+
| {{name}} | {{when_to_use}} | {{example}} | {{pros_cons}} |
|
|
431
|
+
{{/each}}
|
|
432
|
+
|
|
433
|
+
### Backend Test Data (if backend platform)
|
|
434
|
+
|
|
435
|
+
<!-- AI-TAG: BACKEND_TEST_DATA -->
|
|
436
|
+
<!-- Fill with backend test data management patterns. If frontend platform, skip this subsection. -->
|
|
437
|
+
|
|
438
|
+
#### SQL Scripts Naming and Version Management
|
|
439
|
+
|
|
440
|
+
<!-- Fill with: SQL script organization rules (if backend with SQL) -->
|
|
441
|
+
|
|
442
|
+
| Script Type | Naming Convention | Location | Versioning |
|
|
443
|
+
|-------------|------------------|----------|------------|
|
|
444
|
+
{{#each sql_script_rules}}
|
|
445
|
+
| {{type}} | {{naming}} | {{location}} | {{versioning}} |
|
|
446
|
+
{{/each}}
|
|
447
|
+
|
|
448
|
+
#### TestDataFactory Pattern
|
|
449
|
+
|
|
450
|
+
<!-- Fill with: TestDataFactory implementation guidelines -->
|
|
451
|
+
|
|
452
|
+
**Pattern:**
|
|
453
|
+
{{testdatafactory_pattern}}
|
|
454
|
+
|
|
455
|
+
**Example:**
|
|
456
|
+
```{{language}}
|
|
457
|
+
{{testdatafactory_example}}
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
#### Large Dataset Testing
|
|
461
|
+
|
|
462
|
+
<!-- Fill with: guidelines for testing with large datasets -->
|
|
463
|
+
|
|
464
|
+
| Scenario | Approach | Considerations |
|
|
465
|
+
|----------|----------|----------------|
|
|
466
|
+
{{#each large_dataset_strategies}}
|
|
467
|
+
| {{scenario}} | {{approach}} | {{considerations}} |
|
|
468
|
+
{{/each}}
|
|
469
|
+
|
|
470
|
+
#### Test Data Isolation
|
|
471
|
+
|
|
472
|
+
<!-- Fill with: transaction rollback, dataset isolation strategies -->
|
|
473
|
+
|
|
474
|
+
| Isolation Method | Implementation | Use Case |
|
|
475
|
+
|-----------------|---------------|----------|
|
|
476
|
+
{{#each data_isolation_methods}}
|
|
477
|
+
| {{method}} | {{implementation}} | {{use_case}} |
|
|
478
|
+
{{/each}}
|
|
479
|
+
|
|
480
|
+
### Frontend Test Data (if frontend platform)
|
|
481
|
+
|
|
482
|
+
<!-- AI-TAG: FRONTEND_TEST_DATA -->
|
|
483
|
+
<!-- Fill with frontend test data management patterns. If backend platform, skip this subsection. -->
|
|
484
|
+
|
|
485
|
+
#### Mock Data Organization
|
|
486
|
+
|
|
487
|
+
| Category | Location | Naming | Example |
|
|
488
|
+
|----------|----------|--------|---------|
|
|
489
|
+
| API Response Mocks | mock_location | naming_pattern | example |
|
|
490
|
+
| Component Props Fixtures | fixture_location | naming_pattern | example |
|
|
491
|
+
| State Store Fixtures | fixture_location | naming_pattern | example |
|
|
492
|
+
|
|
493
|
+
#### Mock Data Factory
|
|
494
|
+
|
|
495
|
+
```lang
|
|
496
|
+
// Example: Factory function for generating test data
|
|
497
|
+
frontend_test_data_factory_example
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
#### MSW / API Mock Setup (if applicable)
|
|
501
|
+
|
|
502
|
+
| Item | Detail |
|
|
503
|
+
|------|--------|
|
|
504
|
+
| Mock Tool | mock_tool (e.g., MSW, axios-mock-adapter, fetch-mock) |
|
|
505
|
+
| Handler Location | handler_location |
|
|
506
|
+
| Setup Pattern | setup_pattern |
|
|
507
|
+
|
|
508
|
+
**Section Source**
|
|
509
|
+
{{#each test_data_sources}}
|
|
510
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
511
|
+
{{/each}}
|
|
512
|
+
|
|
513
|
+
## 9. Coverage Requirements
|
|
514
|
+
|
|
515
|
+
<!-- AI-TAG: COVERAGE -->
|
|
516
|
+
<!-- Fill with: coverage metrics, scope rules, incremental requirements -->
|
|
517
|
+
|
|
518
|
+
### Coverage Metrics
|
|
519
|
+
|
|
520
|
+
| Metric | Minimum | Target | Scope |
|
|
521
|
+
|--------|---------|--------|-------|
|
|
522
|
+
{{#each coverage_metrics}}
|
|
523
|
+
| {{metric}} | {{minimum}} | {{target}} | {{scope}} |
|
|
524
|
+
{{/each}}
|
|
525
|
+
|
|
526
|
+
### Coverage Scope Rules
|
|
527
|
+
|
|
528
|
+
<!-- Fill with: inclusion and exclusion rules for coverage calculation -->
|
|
529
|
+
|
|
530
|
+
**Include:**
|
|
531
|
+
{{#each coverage_include}}
|
|
532
|
+
- {{this}}
|
|
533
|
+
{{/each}}
|
|
534
|
+
|
|
535
|
+
**Exclude:**
|
|
536
|
+
{{#each coverage_exclude}}
|
|
537
|
+
- {{this}}
|
|
538
|
+
{{/each}}
|
|
539
|
+
|
|
540
|
+
### Incremental Code Coverage
|
|
541
|
+
|
|
542
|
+
<!-- Fill with: requirements for new code coverage -->
|
|
543
|
+
|
|
544
|
+
| Code Type | Minimum Coverage | Enforcement |
|
|
545
|
+
|-----------|-----------------|-------------|
|
|
546
|
+
{{#each incremental_coverage}}
|
|
547
|
+
| {{type}} | {{minimum}} | {{enforcement}} |
|
|
548
|
+
{{/each}}
|
|
549
|
+
|
|
550
|
+
### Low Coverage Exemption
|
|
551
|
+
|
|
552
|
+
<!-- Fill with: rules for exempting code from coverage requirements -->
|
|
553
|
+
|
|
554
|
+
| Exemption Category | Justification Required | Approval |
|
|
555
|
+
|-------------------|----------------------|----------|
|
|
556
|
+
{{#each coverage_exemptions}}
|
|
557
|
+
| {{category}} | {{justification}} | {{approval}} |
|
|
558
|
+
{{/each}}
|
|
559
|
+
|
|
560
|
+
### Prohibited Practices
|
|
561
|
+
|
|
562
|
+
<!-- Fill with: testing practices that are not allowed -->
|
|
563
|
+
|
|
564
|
+
| Prohibited Practice | Why | Correct Approach |
|
|
565
|
+
|--------------------|-----|-----------------|
|
|
566
|
+
{{#each prohibited_practices}}
|
|
567
|
+
| {{practice}} | {{reason}} | {{correct_approach}} |
|
|
568
|
+
{{/each}}
|
|
569
|
+
|
|
570
|
+
**Section Source**
|
|
571
|
+
{{#each coverage_sources}}
|
|
572
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
573
|
+
{{/each}}
|
|
574
|
+
|
|
575
|
+
## 10. Test Reuse & Maintenance
|
|
576
|
+
|
|
577
|
+
<!-- AI-TAG: TEST_MAINTENANCE -->
|
|
578
|
+
<!-- Fill with: utility classes, base classes, cleanup mechanisms -->
|
|
579
|
+
|
|
580
|
+
### Test Utility Classes
|
|
581
|
+
|
|
582
|
+
<!-- Fill with: standardized test utility classes -->
|
|
583
|
+
|
|
584
|
+
| Utility Class | Purpose | Location |
|
|
585
|
+
|--------------|---------|----------|
|
|
586
|
+
{{#each test_utilities}}
|
|
587
|
+
| {{name}} | {{purpose}} | {{location}} |
|
|
588
|
+
{{/each}}
|
|
589
|
+
|
|
590
|
+
### Test Base Classes and Shared Configuration
|
|
591
|
+
|
|
592
|
+
<!-- Fill with: base test classes and shared setup -->
|
|
593
|
+
|
|
594
|
+
| Base Class | Purpose | Common Setup |
|
|
595
|
+
|-----------|---------|--------------|
|
|
596
|
+
{{#each test_base_classes}}
|
|
597
|
+
| {{name}} | {{purpose}} | {{common_setup}} |
|
|
598
|
+
{{/each}}
|
|
599
|
+
|
|
600
|
+
### Outdated Test Cleanup
|
|
601
|
+
|
|
602
|
+
<!-- Fill with: process for identifying and removing obsolete tests -->
|
|
603
|
+
|
|
604
|
+
| Trigger | Action | Responsible |
|
|
605
|
+
|---------|--------|-------------|
|
|
606
|
+
{{#each cleanup_triggers}}
|
|
607
|
+
| {{trigger}} | {{action}} | {{responsible}} |
|
|
608
|
+
{{/each}}
|
|
609
|
+
|
|
610
|
+
### Test Code Refactoring Guidelines
|
|
611
|
+
|
|
612
|
+
<!-- Fill with: when and how to refactor test code -->
|
|
613
|
+
|
|
614
|
+
| Scenario | Refactoring Action | Verification |
|
|
615
|
+
|----------|-------------------|--------------|
|
|
616
|
+
{{#each refactoring_guidelines}}
|
|
617
|
+
| {{scenario}} | {{action}} | {{verification}} |
|
|
618
|
+
{{/each}}
|
|
619
|
+
|
|
620
|
+
**Section Source**
|
|
621
|
+
{{#each test_maintenance_sources}}
|
|
622
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
623
|
+
{{/each}}
|
|
624
|
+
|
|
625
|
+
## 11. Security Testing
|
|
626
|
+
|
|
627
|
+
<!-- AI-TAG: SECURITY_TESTING -->
|
|
628
|
+
<!-- Fill with: security test checklist, permission testing patterns -->
|
|
629
|
+
|
|
630
|
+
### Security Testing Checklist
|
|
631
|
+
|
|
632
|
+
| Security Concern | Test Approach | Priority | Verification |
|
|
633
|
+
|-----------------|---------------|----------|--------------|
|
|
634
|
+
{{#each security_concerns}}
|
|
635
|
+
| {{concern}} | {{test_approach}} | {{priority}} | {{verification}} |
|
|
636
|
+
{{/each}}
|
|
637
|
+
|
|
638
|
+
### Permission Testing Patterns (if applicable)
|
|
639
|
+
|
|
640
|
+
<!-- Fill with: role-based access control testing patterns -->
|
|
641
|
+
|
|
642
|
+
| Pattern | Use Case | Example |
|
|
643
|
+
|---------|----------|---------|
|
|
644
|
+
{{#each permission_patterns}}
|
|
645
|
+
| {{name}} | {{use_case}} | {{example}} |
|
|
646
|
+
{{/each}}
|
|
647
|
+
|
|
648
|
+
**Example:**
|
|
649
|
+
```{{language}}
|
|
650
|
+
{{permission_test_example}}
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
### Input Validation Testing
|
|
654
|
+
|
|
655
|
+
<!-- Fill with: input validation and sanitization testing -->
|
|
656
|
+
|
|
657
|
+
| Validation Type | Test Cases | Expected Behavior |
|
|
658
|
+
|----------------|-----------|-------------------|
|
|
659
|
+
{{#each validation_tests}}
|
|
660
|
+
| {{type}} | {{test_cases}} | {{expected}} |
|
|
661
|
+
{{/each}}
|
|
662
|
+
|
|
663
|
+
**Section Source**
|
|
664
|
+
{{#each security_testing_sources}}
|
|
665
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
666
|
+
{{/each}}
|
|
667
|
+
|
|
668
|
+
## 12. Performance Testing (Platform-Specific)
|
|
669
|
+
|
|
670
|
+
<!-- AI-TAG: PERFORMANCE_TESTING -->
|
|
671
|
+
<!-- Fill with: performance baselines, API standards, load testing scenarios -->
|
|
672
|
+
|
|
673
|
+
### Performance Baselines
|
|
674
|
+
|
|
675
|
+
| Metric | Threshold | Measurement Method | Test Environment |
|
|
676
|
+
|--------|-----------|-------------------|------------------|
|
|
677
|
+
{{#each performance_baselines}}
|
|
678
|
+
| {{metric}} | {{threshold}} | {{measurement}} | {{environment}} |
|
|
679
|
+
{{/each}}
|
|
680
|
+
|
|
681
|
+
### Backend Performance Testing (if backend platform)
|
|
682
|
+
|
|
683
|
+
<!-- AI-TAG: BACKEND_PERF_TEST -->
|
|
684
|
+
<!-- Fill with backend performance testing patterns. If frontend platform, skip this subsection. -->
|
|
685
|
+
|
|
686
|
+
#### API Performance Standards
|
|
687
|
+
|
|
688
|
+
<!-- Fill with: API response time requirements (if backend) -->
|
|
689
|
+
|
|
690
|
+
| API Type | Max Response Time | p95 Response Time | Concurrent Users |
|
|
691
|
+
|----------|------------------|-------------------|------------------|
|
|
692
|
+
{{#each api_performance_standards}}
|
|
693
|
+
| {{type}} | {{max_time}} | {{p95_time}} | {{concurrent}} |
|
|
694
|
+
{{/each}}
|
|
695
|
+
|
|
696
|
+
#### Load Testing Scenarios
|
|
697
|
+
|
|
698
|
+
<!-- Fill with: load testing scenarios and thresholds -->
|
|
699
|
+
|
|
700
|
+
| Scenario | Load Pattern | Duration | Success Criteria |
|
|
701
|
+
|----------|-------------|----------|-----------------|
|
|
702
|
+
{{#each load_test_scenarios}}
|
|
703
|
+
| {{scenario}} | {{load_pattern}} | {{duration}} | {{success_criteria}} |
|
|
704
|
+
{{/each}}
|
|
705
|
+
|
|
706
|
+
### Frontend Performance Testing (if frontend platform)
|
|
707
|
+
|
|
708
|
+
<!-- AI-TAG: FRONTEND_PERF_TEST -->
|
|
709
|
+
<!-- Fill with frontend performance testing patterns. If backend platform, skip this subsection. -->
|
|
710
|
+
|
|
711
|
+
#### Render Performance
|
|
712
|
+
|
|
713
|
+
| Metric | Target | Tool | Test Method |
|
|
714
|
+
|--------|--------|------|-------------|
|
|
715
|
+
| First Contentful Paint | target | tool | method |
|
|
716
|
+
| Largest Contentful Paint | target | tool | method |
|
|
717
|
+
| Time to Interactive | target | tool | method |
|
|
718
|
+
| Component Render Time | target | tool | method |
|
|
719
|
+
|
|
720
|
+
#### Bundle Size Monitoring
|
|
721
|
+
|
|
722
|
+
| Check | Threshold | Tool | CI Integration |
|
|
723
|
+
|-------|-----------|------|---------------|
|
|
724
|
+
| Total Bundle Size | max_size | tool | ci_step |
|
|
725
|
+
| Per-Route Chunk Size | max_size | tool | ci_step |
|
|
726
|
+
| Tree-Shaking Effectiveness | threshold | tool | ci_step |
|
|
727
|
+
|
|
728
|
+
#### Memory Leak Testing
|
|
729
|
+
|
|
730
|
+
| Scenario | Detection Method | Tool |
|
|
731
|
+
|----------|-----------------|------|
|
|
732
|
+
| scenario | detection_method | tool |
|
|
733
|
+
|
|
734
|
+
**Good Example**
|
|
735
|
+
```lang
|
|
736
|
+
// Good: Performance test with clear metrics
|
|
737
|
+
good_perf_test_example
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
**Bad Example**
|
|
741
|
+
```lang
|
|
742
|
+
// Bad: No performance assertions
|
|
743
|
+
bad_perf_test_example
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
### Test Execution Time Baselines
|
|
747
|
+
|
|
748
|
+
<!-- Fill with: maximum allowed test execution times -->
|
|
749
|
+
|
|
750
|
+
| Test Type | Max Execution Time | Typical Range |
|
|
751
|
+
|-----------|-------------------|---------------|
|
|
752
|
+
{{#each execution_time_baselines}}
|
|
753
|
+
| {{type}} | {{max_time}} | {{typical_range}} |
|
|
754
|
+
{{/each}}
|
|
755
|
+
|
|
756
|
+
**Section Source**
|
|
757
|
+
{{#each performance_testing_sources}}
|
|
758
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
759
|
+
{{/each}}
|
|
760
|
+
|
|
761
|
+
## 13. Test Environment & Configuration
|
|
762
|
+
|
|
763
|
+
<!-- AI-TAG: TEST_ENVIRONMENT -->
|
|
764
|
+
<!-- Fill with: environment configurations, isolation strategies -->
|
|
765
|
+
|
|
766
|
+
### Test Environment Configurations
|
|
767
|
+
|
|
768
|
+
| Test Type | Database | Config File | Profile | Properties |
|
|
769
|
+
|-----------|----------|-------------|---------|------------|
|
|
770
|
+
{{#each environment_configs}}
|
|
771
|
+
| {{type}} | {{database}} | {{config_file}} | {{profile}} | {{properties}} |
|
|
772
|
+
{{/each}}
|
|
773
|
+
|
|
774
|
+
### Configuration Isolation
|
|
775
|
+
|
|
776
|
+
<!-- Fill with: rules for isolating test configurations -->
|
|
777
|
+
|
|
778
|
+
| Isolation Level | Implementation | Scope |
|
|
779
|
+
|----------------|---------------|-------|
|
|
780
|
+
{{#each config_isolation}}
|
|
781
|
+
| {{level}} | {{implementation}} | {{scope}} |
|
|
782
|
+
{{/each}}
|
|
783
|
+
|
|
784
|
+
### Environment Variable Management
|
|
785
|
+
|
|
786
|
+
<!-- Fill with: handling of environment variables in tests -->
|
|
787
|
+
|
|
788
|
+
| Variable Type | Source | Override Strategy |
|
|
789
|
+
|--------------|--------|-------------------|
|
|
790
|
+
{{#each env_variables}}
|
|
791
|
+
| {{type}} | {{source}} | {{override}} |
|
|
792
|
+
{{/each}}
|
|
793
|
+
|
|
794
|
+
### Multi-Environment Switching
|
|
795
|
+
|
|
796
|
+
<!-- Fill with: strategies for running tests across environments -->
|
|
797
|
+
|
|
798
|
+
| Strategy | Use Case | Command/Config |
|
|
799
|
+
|----------|----------|----------------|
|
|
800
|
+
{{#each env_switching}}
|
|
801
|
+
| {{strategy}} | {{use_case}} | {{command}} |
|
|
802
|
+
{{/each}}
|
|
803
|
+
|
|
804
|
+
**Section Source**
|
|
805
|
+
{{#each test_environment_sources}}
|
|
806
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
807
|
+
{{/each}}
|
|
808
|
+
|
|
809
|
+
## 14. CI/CD Integration
|
|
810
|
+
|
|
811
|
+
<!-- AI-TAG: CICD_INTEGRATION -->
|
|
812
|
+
<!-- Fill with: pipeline stages, test execution strategies, coverage gates -->
|
|
813
|
+
|
|
814
|
+
### CI/CD Test Execution Strategy
|
|
815
|
+
|
|
816
|
+
| Pipeline Stage | Test Types | Failure Action | Timeout | Parallelism |
|
|
817
|
+
|---------------|------------|---------------|---------|-------------|
|
|
818
|
+
{{#each cicd_stages}}
|
|
819
|
+
| {{stage}} | {{test_types}} | {{failure_action}} | {{timeout}} | {{parallelism}} |
|
|
820
|
+
{{/each}}
|
|
821
|
+
|
|
822
|
+
### Coverage Gate Rules
|
|
823
|
+
|
|
824
|
+
<!-- Fill with: coverage thresholds that block pipeline progression -->
|
|
825
|
+
|
|
826
|
+
| Gate | Metric | Threshold | Block Action |
|
|
827
|
+
|------|--------|-----------|--------------|
|
|
828
|
+
{{#each coverage_gates}}
|
|
829
|
+
| {{gate}} | {{metric}} | {{threshold}} | {{block_action}} |
|
|
830
|
+
{{/each}}
|
|
831
|
+
|
|
832
|
+
### Test Report Archival
|
|
833
|
+
|
|
834
|
+
<!-- Fill with: requirements for test report storage -->
|
|
835
|
+
|
|
836
|
+
| Report Type | Format | Retention | Location |
|
|
837
|
+
|------------|--------|-----------|----------|
|
|
838
|
+
{{#each report_archival}}
|
|
839
|
+
| {{type}} | {{format}} | {{retention}} | {{location}} |
|
|
840
|
+
{{/each}}
|
|
841
|
+
|
|
842
|
+
### Flaky Test Handling
|
|
843
|
+
|
|
844
|
+
<!-- Fill with: process for handling flaky tests in CI/CD -->
|
|
845
|
+
|
|
846
|
+
| Scenario | Detection | Action | Follow-up |
|
|
847
|
+
|----------|-----------|--------|-----------|
|
|
848
|
+
{{#each flaky_test_handling}}
|
|
849
|
+
| {{scenario}} | {{detection}} | {{action}} | {{followup}} |
|
|
850
|
+
{{/each}}
|
|
851
|
+
|
|
852
|
+
**Section Source**
|
|
853
|
+
{{#each cicd_integration_sources}}
|
|
854
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
855
|
+
{{/each}}
|
|
856
|
+
|
|
857
|
+
## 15. Anti-Patterns & Pitfalls
|
|
858
|
+
|
|
859
|
+
<!-- AI-TAG: TEST_ANTIPATTERNS -->
|
|
860
|
+
<!-- Fill with: common anti-patterns and their better approaches -->
|
|
861
|
+
|
|
862
|
+
### Test Anti-Patterns
|
|
863
|
+
|
|
864
|
+
| Anti-Pattern | Description | Impact | Better Approach |
|
|
865
|
+
|-------------|-------------|--------|----------------|
|
|
866
|
+
{{#each anti_patterns}}
|
|
867
|
+
| {{name}} | {{description}} | {{impact}} | {{better_approach}} |
|
|
868
|
+
{{/each}}
|
|
869
|
+
|
|
870
|
+
### Common Failure Scenarios and Solutions
|
|
871
|
+
|
|
872
|
+
<!-- Fill with: frequent test failures and resolution strategies -->
|
|
873
|
+
|
|
874
|
+
| Failure Scenario | Root Cause | Quick Fix | Prevention |
|
|
875
|
+
|-----------------|------------|-----------|------------|
|
|
876
|
+
{{#each failure_scenarios}}
|
|
877
|
+
| {{scenario}} | {{root_cause}} | {{quick_fix}} | {{prevention}} |
|
|
878
|
+
{{/each}}
|
|
879
|
+
|
|
880
|
+
### Test Smell Detection
|
|
881
|
+
|
|
882
|
+
<!-- Fill with: indicators of poorly written tests -->
|
|
883
|
+
|
|
884
|
+
| Smell | Indicator | Refactoring |
|
|
885
|
+
|-------|-----------|-------------|
|
|
886
|
+
{{#each test_smells}}
|
|
887
|
+
| {{name}} | {{indicator}} | {{refactoring}} |
|
|
888
|
+
{{/each}}
|
|
889
|
+
|
|
890
|
+
**Section Source**
|
|
891
|
+
{{#each antipattern_sources}}
|
|
892
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
893
|
+
{{/each}}
|
|
894
|
+
|
|
895
|
+
## Appendix
|
|
896
|
+
|
|
897
|
+
### Testing Best Practices Summary
|
|
898
|
+
|
|
899
|
+
<!-- Fill with: concise summary of key testing best practices -->
|
|
900
|
+
|
|
901
|
+
{{#each testing_best_practices}}
|
|
902
|
+
- **{{title}}**: {{description}}
|
|
903
|
+
{{/each}}
|
|
904
|
+
|
|
905
|
+
### Common Test Scenarios
|
|
906
|
+
|
|
907
|
+
<!-- Fill with: examples of common testing scenarios -->
|
|
908
|
+
|
|
909
|
+
{{#each common_test_scenarios}}
|
|
910
|
+
#### {{name}}
|
|
911
|
+
|
|
912
|
+
{{description}}
|
|
913
|
+
|
|
914
|
+
```{{language}}
|
|
915
|
+
{{example}}
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
{{/each}}
|
|
919
|
+
|
|
920
|
+
### Test Commands Quick Reference
|
|
921
|
+
|
|
922
|
+
<!-- Fill with: common test execution commands -->
|
|
923
|
+
|
|
924
|
+
{{#each test_commands}}
|
|
925
|
+
#### {{name}}
|
|
926
|
+
|
|
927
|
+
```bash
|
|
928
|
+
{{command}}
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
{{description}}
|
|
932
|
+
|
|
933
|
+
{{/each}}
|
|
934
|
+
|
|
935
|
+
### Version History
|
|
936
|
+
|
|
937
|
+
| Version | Date | Author | Changes |
|
|
938
|
+
|---------|------|--------|---------|
|
|
939
|
+
{{#each version_history}}
|
|
940
|
+
| {{version}} | {{date}} | {{author}} | {{changes}} |
|
|
941
|
+
{{/each}}
|
|
942
|
+
|
|
943
|
+
**Section Source**
|
|
944
|
+
{{#each appendix_sources}}
|
|
945
|
+
- [{{name}}]({{path}}#L{{start}}-L{{end}})
|
|
946
|
+
{{/each}}
|