universal-dev-standards 3.5.1-beta.1 → 3.5.1-beta.11
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/bin/uds.js +2 -0
- package/bundled/core/ai-instruction-standards.md +205 -0
- package/bundled/core/anti-hallucination.md +684 -0
- package/bundled/core/changelog-standards.md +556 -0
- package/bundled/core/checkin-standards.md +935 -0
- package/bundled/core/code-review-checklist.md +684 -0
- package/bundled/core/commit-message-guide.md +915 -0
- package/bundled/core/documentation-structure.md +1117 -0
- package/bundled/core/documentation-writing-standards.md +487 -0
- package/bundled/core/error-code-standards.md +382 -0
- package/bundled/core/git-workflow.md +859 -0
- package/bundled/core/logging-standards.md +323 -0
- package/bundled/core/project-structure.md +354 -0
- package/bundled/core/refactoring-standards.md +636 -0
- package/bundled/core/spec-driven-development.md +207 -0
- package/bundled/core/test-completeness-dimensions.md +536 -0
- package/bundled/core/test-driven-development.md +995 -0
- package/bundled/core/testing-standards.md +3061 -0
- package/bundled/core/versioning.md +902 -0
- package/bundled/locales/README.md +88 -0
- package/bundled/locales/zh-CN/CHANGELOG.md +705 -0
- package/bundled/locales/zh-CN/CLAUDE.md +213 -0
- package/bundled/locales/zh-CN/MAINTENANCE.md +689 -0
- package/bundled/locales/zh-CN/README.md +707 -0
- package/bundled/locales/zh-CN/STANDARDS-MAPPING.md +177 -0
- package/bundled/locales/zh-CN/adoption/ADOPTION-GUIDE.md +392 -0
- package/bundled/locales/zh-CN/adoption/STATIC-DYNAMIC-GUIDE.md +302 -0
- package/bundled/locales/zh-CN/adoption/checklists/enterprise.md +332 -0
- package/bundled/locales/zh-CN/adoption/checklists/minimal.md +141 -0
- package/bundled/locales/zh-CN/adoption/checklists/recommended.md +272 -0
- package/bundled/locales/zh-CN/ai/MAINTENANCE.md +739 -0
- package/bundled/locales/zh-CN/ai/options/changelog/auto-generated.ai.yaml +76 -0
- package/bundled/locales/zh-CN/ai/options/changelog/keep-a-changelog.ai.yaml +99 -0
- package/bundled/locales/zh-CN/ai/options/code-review/automated-review.ai.yaml +120 -0
- package/bundled/locales/zh-CN/ai/options/code-review/pair-programming.ai.yaml +109 -0
- package/bundled/locales/zh-CN/ai/options/code-review/pr-review.ai.yaml +104 -0
- package/bundled/locales/zh-CN/ai/options/commit-message/bilingual.ai.yaml +105 -0
- package/bundled/locales/zh-CN/ai/options/commit-message/english.ai.yaml +79 -0
- package/bundled/locales/zh-CN/ai/options/commit-message/traditional-chinese.ai.yaml +100 -0
- package/bundled/locales/zh-CN/ai/options/documentation/api-docs.ai.yaml +140 -0
- package/bundled/locales/zh-CN/ai/options/documentation/markdown-docs.ai.yaml +89 -0
- package/bundled/locales/zh-CN/ai/options/documentation/wiki-style.ai.yaml +119 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/gitflow.ai.yaml +133 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/github-flow.ai.yaml +73 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/merge-commit.ai.yaml +88 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/rebase-ff.ai.yaml +113 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/squash-merge.ai.yaml +85 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/trunk-based.ai.yaml +117 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/dotnet.ai.yaml +108 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/go.ai.yaml +115 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/java.ai.yaml +113 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/kotlin.ai.yaml +123 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/nodejs.ai.yaml +101 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/php.ai.yaml +147 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/python.ai.yaml +116 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/ruby.ai.yaml +140 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/rust.ai.yaml +117 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/swift.ai.yaml +143 -0
- package/bundled/locales/zh-CN/ai/options/testing/contract-testing.ai.yaml +254 -0
- package/bundled/locales/zh-CN/ai/options/testing/e2e-testing.ai.yaml +116 -0
- package/bundled/locales/zh-CN/ai/options/testing/industry-pyramid.ai.yaml +144 -0
- package/bundled/locales/zh-CN/ai/options/testing/integration-testing.ai.yaml +90 -0
- package/bundled/locales/zh-CN/ai/options/testing/istqb-framework.ai.yaml +108 -0
- package/bundled/locales/zh-CN/ai/options/testing/performance-testing.ai.yaml +272 -0
- package/bundled/locales/zh-CN/ai/options/testing/security-testing.ai.yaml +160 -0
- package/bundled/locales/zh-CN/ai/options/testing/system-testing.ai.yaml +101 -0
- package/bundled/locales/zh-CN/ai/options/testing/unit-testing.ai.yaml +82 -0
- package/bundled/locales/zh-CN/ai/standards/anti-hallucination.ai.yaml +145 -0
- package/bundled/locales/zh-CN/ai/standards/changelog.ai.yaml +146 -0
- package/bundled/locales/zh-CN/ai/standards/checkin-standards.ai.yaml +170 -0
- package/bundled/locales/zh-CN/ai/standards/code-review.ai.yaml +148 -0
- package/bundled/locales/zh-CN/ai/standards/commit-message.ai.yaml +175 -0
- package/bundled/locales/zh-CN/ai/standards/documentation-structure.ai.yaml +124 -0
- package/bundled/locales/zh-CN/ai/standards/documentation-writing-standards.ai.yaml +190 -0
- package/bundled/locales/zh-CN/ai/standards/error-codes.ai.yaml +139 -0
- package/bundled/locales/zh-CN/ai/standards/git-workflow.ai.yaml +95 -0
- package/bundled/locales/zh-CN/ai/standards/logging.ai.yaml +128 -0
- package/bundled/locales/zh-CN/ai/standards/project-structure.ai.yaml +134 -0
- package/bundled/locales/zh-CN/ai/standards/spec-driven-development.ai.yaml +169 -0
- package/bundled/locales/zh-CN/ai/standards/test-completeness-dimensions.ai.yaml +220 -0
- package/bundled/locales/zh-CN/ai/standards/testing.ai.yaml +137 -0
- package/bundled/locales/zh-CN/ai/standards/versioning.ai.yaml +211 -0
- package/bundled/locales/zh-CN/core/ai-instruction-standards.md +213 -0
- package/bundled/locales/zh-CN/core/anti-hallucination.md +691 -0
- package/bundled/locales/zh-CN/core/changelog-standards.md +147 -0
- package/bundled/locales/zh-CN/core/checkin-standards.md +943 -0
- package/bundled/locales/zh-CN/core/code-review-guide.md +693 -0
- package/bundled/locales/zh-CN/core/commit-message-guide.md +129 -0
- package/bundled/locales/zh-CN/core/documentation-structure.md +173 -0
- package/bundled/locales/zh-CN/core/documentation-writing-standards.md +495 -0
- package/bundled/locales/zh-CN/core/error-code-standards.md +180 -0
- package/bundled/locales/zh-CN/core/git-workflow.md +193 -0
- package/bundled/locales/zh-CN/core/logging-standards.md +174 -0
- package/bundled/locales/zh-CN/core/project-structure.md +184 -0
- package/bundled/locales/zh-CN/core/refactoring-standards.md +642 -0
- package/bundled/locales/zh-CN/core/spec-driven-development.md +215 -0
- package/bundled/locales/zh-CN/core/test-completeness-dimensions.md +544 -0
- package/bundled/locales/zh-CN/core/test-driven-development.md +1002 -0
- package/bundled/locales/zh-CN/core/testing-standards.md +170 -0
- package/bundled/locales/zh-CN/core/versioning.md +177 -0
- package/bundled/locales/zh-CN/docs/AI-AGENT-ROADMAP.md +303 -0
- package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +990 -0
- package/bundled/locales/zh-CN/docs/OPERATION-WORKFLOW.md +1064 -0
- package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +333 -0
- package/bundled/locales/zh-CN/docs/WINDOWS-GUIDE.md +215 -0
- package/bundled/locales/zh-CN/integrations/codex/AGENTS.md +115 -0
- package/bundled/locales/zh-CN/integrations/codex/README.md +67 -0
- package/bundled/locales/zh-CN/integrations/gemini-cli/GEMINI.md +102 -0
- package/bundled/locales/zh-CN/integrations/gemini-cli/README.md +140 -0
- package/bundled/locales/zh-CN/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +269 -0
- package/bundled/locales/zh-CN/integrations/github-copilot/README.md +167 -0
- package/bundled/locales/zh-CN/integrations/github-copilot/copilot-instructions.md +263 -0
- package/bundled/locales/zh-CN/integrations/github-copilot/skills-mapping.md +192 -0
- package/bundled/locales/zh-CN/integrations/google-antigravity/INSTRUCTIONS.md +61 -0
- package/bundled/locales/zh-CN/integrations/google-antigravity/README.md +84 -0
- package/bundled/locales/zh-CN/integrations/opencode/AGENTS.md +111 -0
- package/bundled/locales/zh-CN/integrations/opencode/README.md +176 -0
- package/bundled/locales/zh-CN/integrations/opencode/skills-mapping.md +396 -0
- package/bundled/locales/zh-CN/integrations/openspec/AGENTS.md +301 -0
- package/bundled/locales/zh-CN/integrations/openspec/README.md +43 -0
- package/bundled/locales/zh-CN/integrations/spec-kit/AGENTS.md +184 -0
- package/bundled/locales/zh-CN/integrations/spec-kit/README.md +43 -0
- package/bundled/locales/zh-CN/options/commit-message/bilingual.md +161 -0
- package/bundled/locales/zh-CN/options/commit-message/english.md +137 -0
- package/bundled/locales/zh-CN/options/commit-message/traditional-chinese.md +162 -0
- package/bundled/locales/zh-CN/options/git-workflow/gitflow.md +147 -0
- package/bundled/locales/zh-CN/options/git-workflow/github-flow.md +124 -0
- package/bundled/locales/zh-CN/options/git-workflow/merge-commit.md +124 -0
- package/bundled/locales/zh-CN/options/git-workflow/rebase-ff.md +160 -0
- package/bundled/locales/zh-CN/options/git-workflow/squash-merge.md +117 -0
- package/bundled/locales/zh-CN/options/git-workflow/trunk-based.md +125 -0
- package/bundled/locales/zh-CN/options/project-structure/dotnet.md +183 -0
- package/bundled/locales/zh-CN/options/project-structure/go.md +226 -0
- package/bundled/locales/zh-CN/options/project-structure/java.md +213 -0
- package/bundled/locales/zh-CN/options/project-structure/nodejs.md +185 -0
- package/bundled/locales/zh-CN/options/project-structure/python.md +229 -0
- package/bundled/locales/zh-CN/options/testing/e2e-testing.md +207 -0
- package/bundled/locales/zh-CN/options/testing/integration-testing.md +230 -0
- package/bundled/locales/zh-CN/options/testing/system-testing.md +183 -0
- package/bundled/locales/zh-CN/options/testing/unit-testing.md +165 -0
- package/bundled/locales/zh-CN/skills/INTEGRATION-GUIDE.md +218 -0
- package/bundled/locales/zh-CN/skills/README.md +134 -0
- package/bundled/locales/zh-CN/skills/_shared/README.md +68 -0
- package/bundled/locales/zh-CN/skills/claude-code/CONTRIBUTING.template.md +151 -0
- package/bundled/locales/zh-CN/skills/claude-code/README.md +174 -0
- package/bundled/locales/zh-CN/skills/claude-code/ai-collaboration-standards/SKILL.md +175 -0
- package/bundled/locales/zh-CN/skills/claude-code/ai-collaboration-standards/anti-hallucination.md +223 -0
- package/bundled/locales/zh-CN/skills/claude-code/ai-collaboration-standards/certainty-labels.md +132 -0
- package/bundled/locales/zh-CN/skills/claude-code/changelog-guide/SKILL.md +237 -0
- package/bundled/locales/zh-CN/skills/claude-code/checkin-assistant/SKILL.md +407 -0
- package/bundled/locales/zh-CN/skills/claude-code/code-review-assistant/SKILL.md +154 -0
- package/bundled/locales/zh-CN/skills/claude-code/code-review-assistant/checkin-checklist.md +257 -0
- package/bundled/locales/zh-CN/skills/claude-code/code-review-assistant/review-checklist.md +246 -0
- package/bundled/locales/zh-CN/skills/claude-code/commands/bdd.md +142 -0
- package/bundled/locales/zh-CN/skills/claude-code/commands/methodology.md +274 -0
- package/bundled/locales/zh-CN/skills/claude-code/commit-standards/SKILL.md +191 -0
- package/bundled/locales/zh-CN/skills/claude-code/commit-standards/conventional-commits.md +264 -0
- package/bundled/locales/zh-CN/skills/claude-code/commit-standards/language-options.md +172 -0
- package/bundled/locales/zh-CN/skills/claude-code/documentation-guide/SKILL.md +421 -0
- package/bundled/locales/zh-CN/skills/claude-code/documentation-guide/documentation-structure.md +357 -0
- package/bundled/locales/zh-CN/skills/claude-code/documentation-guide/readme-template.md +412 -0
- package/bundled/locales/zh-CN/skills/claude-code/error-code-guide/SKILL.md +269 -0
- package/bundled/locales/zh-CN/skills/claude-code/git-workflow-guide/SKILL.md +218 -0
- package/bundled/locales/zh-CN/skills/claude-code/git-workflow-guide/branch-naming.md +220 -0
- package/bundled/locales/zh-CN/skills/claude-code/git-workflow-guide/git-workflow.md +321 -0
- package/bundled/locales/zh-CN/skills/claude-code/logging-guide/SKILL.md +285 -0
- package/bundled/locales/zh-CN/skills/claude-code/methodology-system/SKILL.md +131 -0
- package/bundled/locales/zh-CN/skills/claude-code/methodology-system/create-methodology.md +350 -0
- package/bundled/locales/zh-CN/skills/claude-code/methodology-system/runtime.md +279 -0
- package/bundled/locales/zh-CN/skills/claude-code/project-structure-guide/SKILL.md +143 -0
- package/bundled/locales/zh-CN/skills/claude-code/project-structure-guide/language-patterns.md +271 -0
- package/bundled/locales/zh-CN/skills/claude-code/refactoring-assistant/SKILL.md +162 -0
- package/bundled/locales/zh-CN/skills/claude-code/release-standards/SKILL.md +191 -0
- package/bundled/locales/zh-CN/skills/claude-code/release-standards/changelog-format.md +247 -0
- package/bundled/locales/zh-CN/skills/claude-code/release-standards/release-workflow.md +345 -0
- package/bundled/locales/zh-CN/skills/claude-code/release-standards/semantic-versioning.md +250 -0
- package/bundled/locales/zh-CN/skills/claude-code/requirement-assistant/SKILL.md +227 -0
- package/bundled/locales/zh-CN/skills/claude-code/requirement-assistant/requirement-checklist.md +325 -0
- package/bundled/locales/zh-CN/skills/claude-code/requirement-assistant/requirement-writing.md +399 -0
- package/bundled/locales/zh-CN/skills/claude-code/spec-driven-dev/SKILL.md +243 -0
- package/bundled/locales/zh-CN/skills/claude-code/tdd-assistant/SKILL.md +332 -0
- package/bundled/locales/zh-CN/skills/claude-code/tdd-assistant/language-examples.md +639 -0
- package/bundled/locales/zh-CN/skills/claude-code/tdd-assistant/tdd-workflow.md +486 -0
- package/bundled/locales/zh-CN/skills/claude-code/test-coverage-assistant/SKILL.md +282 -0
- package/bundled/locales/zh-CN/skills/claude-code/testing-guide/SKILL.md +234 -0
- package/bundled/locales/zh-CN/skills/claude-code/testing-guide/testing-pyramid.md +448 -0
- package/bundled/locales/zh-CN/skills/cline/README.md +58 -0
- package/bundled/locales/zh-CN/skills/copilot/README.md +61 -0
- package/bundled/locales/zh-CN/skills/copilot/copilot-instructions.md +79 -0
- package/bundled/locales/zh-CN/skills/cursor/README.md +58 -0
- package/bundled/locales/zh-CN/skills/windsurf/README.md +59 -0
- package/bundled/locales/zh-TW/CHANGELOG.md +707 -0
- package/bundled/locales/zh-TW/CLAUDE.md +213 -0
- package/bundled/locales/zh-TW/MAINTENANCE.md +683 -0
- package/bundled/locales/zh-TW/README.md +687 -0
- package/bundled/locales/zh-TW/STANDARDS-MAPPING.md +177 -0
- package/bundled/locales/zh-TW/adoption/ADOPTION-GUIDE.md +392 -0
- package/bundled/locales/zh-TW/adoption/STATIC-DYNAMIC-GUIDE.md +299 -0
- package/bundled/locales/zh-TW/adoption/checklists/enterprise.md +332 -0
- package/bundled/locales/zh-TW/adoption/checklists/minimal.md +141 -0
- package/bundled/locales/zh-TW/adoption/checklists/recommended.md +272 -0
- package/bundled/locales/zh-TW/ai/MAINTENANCE.md +754 -0
- package/bundled/locales/zh-TW/ai/options/changelog/auto-generated.ai.yaml +76 -0
- package/bundled/locales/zh-TW/ai/options/changelog/keep-a-changelog.ai.yaml +99 -0
- package/bundled/locales/zh-TW/ai/options/code-review/automated-review.ai.yaml +120 -0
- package/bundled/locales/zh-TW/ai/options/code-review/pair-programming.ai.yaml +109 -0
- package/bundled/locales/zh-TW/ai/options/code-review/pr-review.ai.yaml +104 -0
- package/bundled/locales/zh-TW/ai/options/commit-message/bilingual.ai.yaml +105 -0
- package/bundled/locales/zh-TW/ai/options/commit-message/english.ai.yaml +79 -0
- package/bundled/locales/zh-TW/ai/options/commit-message/traditional-chinese.ai.yaml +100 -0
- package/bundled/locales/zh-TW/ai/options/documentation/api-docs.ai.yaml +140 -0
- package/bundled/locales/zh-TW/ai/options/documentation/markdown-docs.ai.yaml +89 -0
- package/bundled/locales/zh-TW/ai/options/documentation/wiki-style.ai.yaml +119 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/gitflow.ai.yaml +133 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/github-flow.ai.yaml +73 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/merge-commit.ai.yaml +88 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/rebase-ff.ai.yaml +113 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/squash-merge.ai.yaml +85 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/trunk-based.ai.yaml +117 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/dotnet.ai.yaml +108 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/go.ai.yaml +115 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/java.ai.yaml +113 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/kotlin.ai.yaml +123 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/nodejs.ai.yaml +101 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/php.ai.yaml +147 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/python.ai.yaml +116 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/ruby.ai.yaml +140 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/rust.ai.yaml +117 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/swift.ai.yaml +143 -0
- package/bundled/locales/zh-TW/ai/options/testing/contract-testing.ai.yaml +254 -0
- package/bundled/locales/zh-TW/ai/options/testing/e2e-testing.ai.yaml +116 -0
- package/bundled/locales/zh-TW/ai/options/testing/industry-pyramid.ai.yaml +144 -0
- package/bundled/locales/zh-TW/ai/options/testing/integration-testing.ai.yaml +90 -0
- package/bundled/locales/zh-TW/ai/options/testing/istqb-framework.ai.yaml +108 -0
- package/bundled/locales/zh-TW/ai/options/testing/performance-testing.ai.yaml +272 -0
- package/bundled/locales/zh-TW/ai/options/testing/security-testing.ai.yaml +160 -0
- package/bundled/locales/zh-TW/ai/options/testing/system-testing.ai.yaml +101 -0
- package/bundled/locales/zh-TW/ai/options/testing/unit-testing.ai.yaml +82 -0
- package/bundled/locales/zh-TW/ai/standards/anti-hallucination.ai.yaml +145 -0
- package/bundled/locales/zh-TW/ai/standards/changelog.ai.yaml +146 -0
- package/bundled/locales/zh-TW/ai/standards/checkin-standards.ai.yaml +170 -0
- package/bundled/locales/zh-TW/ai/standards/code-review.ai.yaml +148 -0
- package/bundled/locales/zh-TW/ai/standards/commit-message.ai.yaml +175 -0
- package/bundled/locales/zh-TW/ai/standards/documentation-structure.ai.yaml +124 -0
- package/bundled/locales/zh-TW/ai/standards/documentation-writing-standards.ai.yaml +190 -0
- package/bundled/locales/zh-TW/ai/standards/error-codes.ai.yaml +139 -0
- package/bundled/locales/zh-TW/ai/standards/git-workflow.ai.yaml +95 -0
- package/bundled/locales/zh-TW/ai/standards/logging.ai.yaml +128 -0
- package/bundled/locales/zh-TW/ai/standards/project-structure.ai.yaml +134 -0
- package/bundled/locales/zh-TW/ai/standards/spec-driven-development.ai.yaml +169 -0
- package/bundled/locales/zh-TW/ai/standards/test-completeness-dimensions.ai.yaml +220 -0
- package/bundled/locales/zh-TW/ai/standards/testing.ai.yaml +137 -0
- package/bundled/locales/zh-TW/ai/standards/versioning.ai.yaml +211 -0
- package/bundled/locales/zh-TW/core/ai-instruction-standards.md +213 -0
- package/bundled/locales/zh-TW/core/anti-hallucination.md +691 -0
- package/bundled/locales/zh-TW/core/changelog-standards.md +564 -0
- package/bundled/locales/zh-TW/core/checkin-standards.md +943 -0
- package/bundled/locales/zh-TW/core/code-review-checklist.md +693 -0
- package/bundled/locales/zh-TW/core/commit-message-guide.md +809 -0
- package/bundled/locales/zh-TW/core/documentation-structure.md +1125 -0
- package/bundled/locales/zh-TW/core/documentation-writing-standards.md +495 -0
- package/bundled/locales/zh-TW/core/error-code-standards.md +384 -0
- package/bundled/locales/zh-TW/core/git-workflow.md +860 -0
- package/bundled/locales/zh-TW/core/logging-standards.md +325 -0
- package/bundled/locales/zh-TW/core/project-structure.md +362 -0
- package/bundled/locales/zh-TW/core/refactoring-standards.md +642 -0
- package/bundled/locales/zh-TW/core/spec-driven-development.md +215 -0
- package/bundled/locales/zh-TW/core/test-completeness-dimensions.md +544 -0
- package/bundled/locales/zh-TW/core/test-driven-development.md +1004 -0
- package/bundled/locales/zh-TW/core/testing-standards.md +2158 -0
- package/bundled/locales/zh-TW/core/versioning.md +909 -0
- package/bundled/locales/zh-TW/docs/AI-AGENT-ROADMAP.md +303 -0
- package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +990 -0
- package/bundled/locales/zh-TW/docs/OPERATION-WORKFLOW.md +1064 -0
- package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +333 -0
- package/bundled/locales/zh-TW/docs/WINDOWS-GUIDE.md +215 -0
- package/bundled/locales/zh-TW/integrations/codex/AGENTS.md +115 -0
- package/bundled/locales/zh-TW/integrations/codex/README.md +113 -0
- package/bundled/locales/zh-TW/integrations/gemini-cli/GEMINI.md +102 -0
- package/bundled/locales/zh-TW/integrations/gemini-cli/README.md +140 -0
- package/bundled/locales/zh-TW/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +269 -0
- package/bundled/locales/zh-TW/integrations/github-copilot/README.md +167 -0
- package/bundled/locales/zh-TW/integrations/github-copilot/copilot-instructions.md +263 -0
- package/bundled/locales/zh-TW/integrations/github-copilot/skills-mapping.md +192 -0
- package/bundled/locales/zh-TW/integrations/google-antigravity/INSTRUCTIONS.md +61 -0
- package/bundled/locales/zh-TW/integrations/google-antigravity/README.md +84 -0
- package/bundled/locales/zh-TW/integrations/opencode/AGENTS.md +111 -0
- package/bundled/locales/zh-TW/integrations/opencode/README.md +176 -0
- package/bundled/locales/zh-TW/integrations/opencode/skills-mapping.md +396 -0
- package/bundled/locales/zh-TW/integrations/openspec/AGENTS.md +301 -0
- package/bundled/locales/zh-TW/integrations/openspec/README.md +43 -0
- package/bundled/locales/zh-TW/integrations/spec-kit/AGENTS.md +184 -0
- package/bundled/locales/zh-TW/integrations/spec-kit/README.md +43 -0
- package/bundled/locales/zh-TW/options/commit-message/bilingual.md +161 -0
- package/bundled/locales/zh-TW/options/commit-message/english.md +137 -0
- package/bundled/locales/zh-TW/options/commit-message/traditional-chinese.md +162 -0
- package/bundled/locales/zh-TW/options/git-workflow/gitflow.md +147 -0
- package/bundled/locales/zh-TW/options/git-workflow/github-flow.md +124 -0
- package/bundled/locales/zh-TW/options/git-workflow/merge-commit.md +124 -0
- package/bundled/locales/zh-TW/options/git-workflow/rebase-ff.md +160 -0
- package/bundled/locales/zh-TW/options/git-workflow/squash-merge.md +117 -0
- package/bundled/locales/zh-TW/options/git-workflow/trunk-based.md +125 -0
- package/bundled/locales/zh-TW/options/project-structure/dotnet.md +183 -0
- package/bundled/locales/zh-TW/options/project-structure/go.md +226 -0
- package/bundled/locales/zh-TW/options/project-structure/java.md +213 -0
- package/bundled/locales/zh-TW/options/project-structure/nodejs.md +185 -0
- package/bundled/locales/zh-TW/options/project-structure/python.md +229 -0
- package/bundled/locales/zh-TW/options/testing/e2e-testing.md +207 -0
- package/bundled/locales/zh-TW/options/testing/integration-testing.md +230 -0
- package/bundled/locales/zh-TW/options/testing/system-testing.md +183 -0
- package/bundled/locales/zh-TW/options/testing/unit-testing.md +165 -0
- package/bundled/locales/zh-TW/skills/INTEGRATION-GUIDE.md +218 -0
- package/bundled/locales/zh-TW/skills/README.md +132 -0
- package/bundled/locales/zh-TW/skills/_shared/README.md +68 -0
- package/bundled/locales/zh-TW/skills/claude-code/CONTRIBUTING.template.md +151 -0
- package/bundled/locales/zh-TW/skills/claude-code/README.md +174 -0
- package/bundled/locales/zh-TW/skills/claude-code/ai-collaboration-standards/SKILL.md +175 -0
- package/bundled/locales/zh-TW/skills/claude-code/ai-collaboration-standards/anti-hallucination.md +223 -0
- package/bundled/locales/zh-TW/skills/claude-code/ai-collaboration-standards/certainty-labels.md +132 -0
- package/bundled/locales/zh-TW/skills/claude-code/changelog-guide/SKILL.md +237 -0
- package/bundled/locales/zh-TW/skills/claude-code/checkin-assistant/SKILL.md +407 -0
- package/bundled/locales/zh-TW/skills/claude-code/code-review-assistant/SKILL.md +154 -0
- package/bundled/locales/zh-TW/skills/claude-code/code-review-assistant/checkin-checklist.md +257 -0
- package/bundled/locales/zh-TW/skills/claude-code/code-review-assistant/review-checklist.md +246 -0
- package/bundled/locales/zh-TW/skills/claude-code/commands/bdd.md +142 -0
- package/bundled/locales/zh-TW/skills/claude-code/commands/methodology.md +274 -0
- package/bundled/locales/zh-TW/skills/claude-code/commit-standards/SKILL.md +191 -0
- package/bundled/locales/zh-TW/skills/claude-code/commit-standards/conventional-commits.md +264 -0
- package/bundled/locales/zh-TW/skills/claude-code/commit-standards/language-options.md +172 -0
- package/bundled/locales/zh-TW/skills/claude-code/documentation-guide/SKILL.md +421 -0
- package/bundled/locales/zh-TW/skills/claude-code/documentation-guide/documentation-structure.md +357 -0
- package/bundled/locales/zh-TW/skills/claude-code/documentation-guide/readme-template.md +412 -0
- package/bundled/locales/zh-TW/skills/claude-code/error-code-guide/SKILL.md +269 -0
- package/bundled/locales/zh-TW/skills/claude-code/git-workflow-guide/SKILL.md +218 -0
- package/bundled/locales/zh-TW/skills/claude-code/git-workflow-guide/branch-naming.md +220 -0
- package/bundled/locales/zh-TW/skills/claude-code/git-workflow-guide/git-workflow.md +321 -0
- package/bundled/locales/zh-TW/skills/claude-code/logging-guide/SKILL.md +285 -0
- package/bundled/locales/zh-TW/skills/claude-code/methodology-system/SKILL.md +131 -0
- package/bundled/locales/zh-TW/skills/claude-code/methodology-system/create-methodology.md +350 -0
- package/bundled/locales/zh-TW/skills/claude-code/methodology-system/runtime.md +279 -0
- package/bundled/locales/zh-TW/skills/claude-code/project-structure-guide/SKILL.md +143 -0
- package/bundled/locales/zh-TW/skills/claude-code/project-structure-guide/language-patterns.md +271 -0
- package/bundled/locales/zh-TW/skills/claude-code/refactoring-assistant/SKILL.md +162 -0
- package/bundled/locales/zh-TW/skills/claude-code/release-standards/SKILL.md +191 -0
- package/bundled/locales/zh-TW/skills/claude-code/release-standards/changelog-format.md +247 -0
- package/bundled/locales/zh-TW/skills/claude-code/release-standards/release-workflow.md +345 -0
- package/bundled/locales/zh-TW/skills/claude-code/release-standards/semantic-versioning.md +250 -0
- package/bundled/locales/zh-TW/skills/claude-code/requirement-assistant/SKILL.md +227 -0
- package/bundled/locales/zh-TW/skills/claude-code/requirement-assistant/requirement-checklist.md +325 -0
- package/bundled/locales/zh-TW/skills/claude-code/requirement-assistant/requirement-writing.md +399 -0
- package/bundled/locales/zh-TW/skills/claude-code/spec-driven-dev/SKILL.md +243 -0
- package/bundled/locales/zh-TW/skills/claude-code/tdd-assistant/SKILL.md +332 -0
- package/bundled/locales/zh-TW/skills/claude-code/tdd-assistant/language-examples.md +639 -0
- package/bundled/locales/zh-TW/skills/claude-code/tdd-assistant/tdd-workflow.md +486 -0
- package/bundled/locales/zh-TW/skills/claude-code/test-coverage-assistant/SKILL.md +282 -0
- package/bundled/locales/zh-TW/skills/claude-code/testing-guide/SKILL.md +234 -0
- package/bundled/locales/zh-TW/skills/claude-code/testing-guide/testing-pyramid.md +448 -0
- package/bundled/locales/zh-TW/skills/cline/README.md +58 -0
- package/bundled/locales/zh-TW/skills/copilot/README.md +61 -0
- package/bundled/locales/zh-TW/skills/copilot/copilot-instructions.md +79 -0
- package/bundled/locales/zh-TW/skills/cursor/README.md +58 -0
- package/bundled/locales/zh-TW/skills/windsurf/README.md +59 -0
- package/bundled/skills/claude-code/CONTRIBUTING.template.md +141 -0
- package/bundled/skills/claude-code/README.md +196 -0
- package/bundled/skills/claude-code/ai/standards/checkin.ai.yaml +21 -0
- package/bundled/skills/claude-code/ai/standards/commit.ai.yaml +20 -0
- package/bundled/skills/claude-code/ai/standards/refactoring.ai.yaml +34 -0
- package/bundled/skills/claude-code/ai/standards/testing.ai.yaml +41 -0
- package/bundled/skills/claude-code/ai-collaboration-standards/SKILL.md +175 -0
- package/bundled/skills/claude-code/ai-collaboration-standards/anti-hallucination.md +215 -0
- package/bundled/skills/claude-code/ai-collaboration-standards/certainty-labels.md +124 -0
- package/bundled/skills/claude-code/changelog-guide/SKILL.md +232 -0
- package/bundled/skills/claude-code/checkin-assistant/SKILL.md +402 -0
- package/bundled/skills/claude-code/code-review-assistant/SKILL.md +220 -0
- package/bundled/skills/claude-code/code-review-assistant/checkin-checklist.md +249 -0
- package/bundled/skills/claude-code/code-review-assistant/review-checklist.md +238 -0
- package/bundled/skills/claude-code/commands/README.md +78 -0
- package/bundled/skills/claude-code/commands/bdd.md +142 -0
- package/bundled/skills/claude-code/commands/changelog.md +57 -0
- package/bundled/skills/claude-code/commands/check.md +91 -0
- package/bundled/skills/claude-code/commands/commit.md +48 -0
- package/bundled/skills/claude-code/commands/config.md +97 -0
- package/bundled/skills/claude-code/commands/coverage.md +58 -0
- package/bundled/skills/claude-code/commands/docs.md +75 -0
- package/bundled/skills/claude-code/commands/init.md +88 -0
- package/bundled/skills/claude-code/commands/methodology.md +268 -0
- package/bundled/skills/claude-code/commands/release.md +50 -0
- package/bundled/skills/claude-code/commands/requirement.md +54 -0
- package/bundled/skills/claude-code/commands/review.md +50 -0
- package/bundled/skills/claude-code/commands/spec.md +69 -0
- package/bundled/skills/claude-code/commands/tdd.md +86 -0
- package/bundled/skills/claude-code/commands/update.md +122 -0
- package/bundled/skills/claude-code/commit-standards/SKILL.md +249 -0
- package/bundled/skills/claude-code/commit-standards/conventional-commits.md +256 -0
- package/bundled/skills/claude-code/commit-standards/language-options.md +164 -0
- package/bundled/skills/claude-code/documentation-guide/SKILL.md +416 -0
- package/bundled/skills/claude-code/documentation-guide/documentation-structure.md +349 -0
- package/bundled/skills/claude-code/documentation-guide/readme-template.md +404 -0
- package/bundled/skills/claude-code/error-code-guide/SKILL.md +264 -0
- package/bundled/skills/claude-code/git-workflow-guide/SKILL.md +226 -0
- package/bundled/skills/claude-code/git-workflow-guide/branch-naming.md +212 -0
- package/bundled/skills/claude-code/git-workflow-guide/git-workflow.md +313 -0
- package/bundled/skills/claude-code/logging-guide/SKILL.md +280 -0
- package/bundled/skills/claude-code/methodology-system/SKILL.md +215 -0
- package/bundled/skills/claude-code/methodology-system/create-methodology.md +450 -0
- package/bundled/skills/claude-code/methodology-system/runtime.md +271 -0
- package/bundled/skills/claude-code/project-structure-guide/SKILL.md +143 -0
- package/bundled/skills/claude-code/project-structure-guide/language-patterns.md +263 -0
- package/bundled/skills/claude-code/refactoring-assistant/SKILL.md +205 -0
- package/bundled/skills/claude-code/release-standards/SKILL.md +191 -0
- package/bundled/skills/claude-code/release-standards/changelog-format.md +239 -0
- package/bundled/skills/claude-code/release-standards/release-workflow.md +337 -0
- package/bundled/skills/claude-code/release-standards/semantic-versioning.md +242 -0
- package/bundled/skills/claude-code/requirement-assistant/SKILL.md +222 -0
- package/bundled/skills/claude-code/requirement-assistant/requirement-checklist.md +317 -0
- package/bundled/skills/claude-code/requirement-assistant/requirement-writing.md +391 -0
- package/bundled/skills/claude-code/spec-driven-dev/SKILL.md +238 -0
- package/bundled/skills/claude-code/tdd-assistant/SKILL.md +384 -0
- package/bundled/skills/claude-code/tdd-assistant/language-examples.md +1276 -0
- package/bundled/skills/claude-code/tdd-assistant/tdd-workflow.md +659 -0
- package/bundled/skills/claude-code/test-coverage-assistant/SKILL.md +277 -0
- package/bundled/skills/claude-code/testing-guide/SKILL.md +317 -0
- package/bundled/skills/claude-code/testing-guide/testing-pyramid.md +440 -0
- package/package.json +4 -2
- package/src/commands/check.js +38 -6
- package/src/commands/init.js +20 -6
- package/src/commands/list.js +7 -2
- package/src/commands/skills.js +0 -2
- package/src/commands/update.js +271 -0
- package/src/i18n/messages.js +161 -11
- package/src/utils/copier.js +63 -10
- package/src/utils/skills-installer.js +47 -11
- package/standards-registry.json +6 -3
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../../options/testing/e2e-testing.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2025-12-30
|
|
6
|
+
status: current
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 端對端 (E2E) 測試
|
|
10
|
+
|
|
11
|
+
> **語言**: [English](../../../../options/testing/e2e-testing.md) | 繁體中文
|
|
12
|
+
|
|
13
|
+
**上層標準**: [測試指南](../../core/testing.md)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 概述
|
|
18
|
+
|
|
19
|
+
端對端 (E2E) 測試驗證從開始到結束的完整使用者流程,模擬真實使用者與應用程式的互動。這些測試驗證所有整合元件能共同運作以提供預期的使用者體驗。
|
|
20
|
+
|
|
21
|
+
## 特性
|
|
22
|
+
|
|
23
|
+
| 屬性 | 值 |
|
|
24
|
+
|------|------|
|
|
25
|
+
| 範圍 | 完整使用者旅程 |
|
|
26
|
+
| 相依性 | 所有真實(類生產)|
|
|
27
|
+
| 執行速度 | 每個測試數分鐘 |
|
|
28
|
+
| 環境 | 完整堆疊部署 |
|
|
29
|
+
| 數量 | 僅關鍵路徑 |
|
|
30
|
+
|
|
31
|
+
## 適用情境
|
|
32
|
+
|
|
33
|
+
- 關鍵業務流程(結帳、註冊)
|
|
34
|
+
- 使用者驗收測試
|
|
35
|
+
- 部署煙霧測試
|
|
36
|
+
- 跨瀏覽器相容性
|
|
37
|
+
- 無障礙驗證
|
|
38
|
+
|
|
39
|
+
## 何時撰寫 E2E 測試
|
|
40
|
+
|
|
41
|
+
### 應該撰寫
|
|
42
|
+
|
|
43
|
+
| 情境 | 範例 |
|
|
44
|
+
|------|------|
|
|
45
|
+
| 關鍵營收路徑 | 結帳、訂閱 |
|
|
46
|
+
| 使用者驗證 | 登入、註冊、密碼重設 |
|
|
47
|
+
| 核心功能 | 主要產品功能 |
|
|
48
|
+
| 法規遵循 | GDPR 同意、無障礙 |
|
|
49
|
+
| 跨系統流程 | 多服務交易 |
|
|
50
|
+
|
|
51
|
+
### 不應該撰寫
|
|
52
|
+
|
|
53
|
+
| 情境 | 更好的替代方案 |
|
|
54
|
+
|------|----------------|
|
|
55
|
+
| 邊界案例 | 單元測試 |
|
|
56
|
+
| API 驗證 | 整合測試 |
|
|
57
|
+
| 元件行為 | 元件測試 |
|
|
58
|
+
| 錯誤訊息 | 單元測試 |
|
|
59
|
+
|
|
60
|
+
## 框架範例
|
|
61
|
+
|
|
62
|
+
### Playwright(推薦)
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
// tests/e2e/checkout.spec.js
|
|
66
|
+
import { test, expect } from '@playwright/test';
|
|
67
|
+
|
|
68
|
+
test.describe('結帳流程', () => {
|
|
69
|
+
test.beforeEach(async ({ page }) => {
|
|
70
|
+
// 以測試使用者登入
|
|
71
|
+
await page.goto('/login');
|
|
72
|
+
await page.fill('[data-testid="email"]', 'test@example.com');
|
|
73
|
+
await page.fill('[data-testid="password"]', 'testpass123');
|
|
74
|
+
await page.click('[data-testid="login-button"]');
|
|
75
|
+
await expect(page).toHaveURL('/dashboard');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('使用信用卡完成購買', async ({ page }) => {
|
|
79
|
+
// 加入購物車
|
|
80
|
+
await page.goto('/products/widget-pro');
|
|
81
|
+
await page.click('[data-testid="add-to-cart"]');
|
|
82
|
+
await expect(page.locator('[data-testid="cart-count"]')).toHaveText('1');
|
|
83
|
+
|
|
84
|
+
// 前往結帳
|
|
85
|
+
await page.click('[data-testid="checkout-button"]');
|
|
86
|
+
await expect(page).toHaveURL('/checkout');
|
|
87
|
+
|
|
88
|
+
// 填寫配送資訊
|
|
89
|
+
await page.fill('[data-testid="address"]', '123 Test St');
|
|
90
|
+
await page.fill('[data-testid="city"]', 'Test City');
|
|
91
|
+
await page.fill('[data-testid="zip"]', '12345');
|
|
92
|
+
await page.click('[data-testid="continue-to-payment"]');
|
|
93
|
+
|
|
94
|
+
// 填寫付款資訊(測試卡號)
|
|
95
|
+
await page.fill('[data-testid="card-number"]', '4242424242424242');
|
|
96
|
+
await page.fill('[data-testid="card-expiry"]', '12/25');
|
|
97
|
+
await page.fill('[data-testid="card-cvc"]', '123');
|
|
98
|
+
|
|
99
|
+
// 完成購買
|
|
100
|
+
await page.click('[data-testid="place-order"]');
|
|
101
|
+
|
|
102
|
+
// 驗證成功
|
|
103
|
+
await expect(page).toHaveURL(/\/order-confirmation/);
|
|
104
|
+
await expect(page.locator('[data-testid="order-number"]')).toBeVisible();
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Page Object 模式
|
|
110
|
+
|
|
111
|
+
使用 page object 組織測試以提高可維護性:
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
// pages/CheckoutPage.js
|
|
115
|
+
export class CheckoutPage {
|
|
116
|
+
constructor(page) {
|
|
117
|
+
this.page = page;
|
|
118
|
+
this.addressInput = page.locator('[data-testid="address"]');
|
|
119
|
+
this.placeOrderButton = page.locator('[data-testid="place-order"]');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async fillShipping(address, city, zip) {
|
|
123
|
+
await this.addressInput.fill(address);
|
|
124
|
+
await this.page.fill('[data-testid="city"]', city);
|
|
125
|
+
await this.page.fill('[data-testid="zip"]', zip);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async placeOrder() {
|
|
129
|
+
await this.placeOrderButton.click();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## 最佳實踐
|
|
135
|
+
|
|
136
|
+
### 1. 使用 Data-TestId 屬性
|
|
137
|
+
|
|
138
|
+
```html
|
|
139
|
+
<!-- 好:穩定的選擇器 -->
|
|
140
|
+
<button data-testid="submit-order">下訂單</button>
|
|
141
|
+
|
|
142
|
+
<!-- 不好:脆弱的選擇器 -->
|
|
143
|
+
<button class="btn btn-primary order-btn">下訂單</button>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 2. 隔離測試資料
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
test.beforeEach(async ({ request }) => {
|
|
150
|
+
// 透過 API 建立隔離的測試資料
|
|
151
|
+
const response = await request.post('/api/test/setup', {
|
|
152
|
+
data: { scenario: 'checkout-test' }
|
|
153
|
+
});
|
|
154
|
+
testData = await response.json();
|
|
155
|
+
});
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 3. 處理不穩定性
|
|
159
|
+
|
|
160
|
+
```javascript
|
|
161
|
+
// 重試不穩定的斷言
|
|
162
|
+
await expect(async () => {
|
|
163
|
+
const count = await page.locator('.item').count();
|
|
164
|
+
expect(count).toBe(3);
|
|
165
|
+
}).toPass({ timeout: 10000 });
|
|
166
|
+
|
|
167
|
+
// 等待網路閒置
|
|
168
|
+
await page.waitForLoadState('networkidle');
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 4. 平行執行測試
|
|
172
|
+
|
|
173
|
+
```javascript
|
|
174
|
+
// playwright.config.js
|
|
175
|
+
export default {
|
|
176
|
+
workers: process.env.CI ? 4 : undefined,
|
|
177
|
+
fullyParallel: true,
|
|
178
|
+
projects: [
|
|
179
|
+
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
|
|
180
|
+
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
|
|
181
|
+
{ name: 'mobile', use: { ...devices['iPhone 12'] } },
|
|
182
|
+
],
|
|
183
|
+
};
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## 常見框架
|
|
187
|
+
|
|
188
|
+
| 框架 | 語言 | 最適合 |
|
|
189
|
+
|------|------|--------|
|
|
190
|
+
| Playwright | JS/TS/Python/C# | 跨瀏覽器、現代 |
|
|
191
|
+
| Cypress | JavaScript | 元件 + E2E |
|
|
192
|
+
| Selenium | 多語言 | 舊系統、企業 |
|
|
193
|
+
| Puppeteer | JavaScript | Chrome 專用 |
|
|
194
|
+
|
|
195
|
+
## 相關選項
|
|
196
|
+
|
|
197
|
+
- [單元測試](./unit-testing.md) - 測試個別元件
|
|
198
|
+
- [整合測試](./integration-testing.md) - 測試元件互動
|
|
199
|
+
- [系統測試](./system-testing.md) - 測試完整系統
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 授權條款
|
|
204
|
+
|
|
205
|
+
本文件採用 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權條款。
|
|
206
|
+
|
|
207
|
+
**來源**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../../options/testing/integration-testing.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2025-12-30
|
|
6
|
+
status: current
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 整合測試 (IT/SIT)
|
|
10
|
+
|
|
11
|
+
> **語言**: [English](../../../../options/testing/integration-testing.md) | 繁體中文
|
|
12
|
+
|
|
13
|
+
**上層標準**: [測試指南](../../core/testing.md)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 縮寫說明
|
|
18
|
+
|
|
19
|
+
整合測試層級在業界有兩種常見的縮寫:
|
|
20
|
+
|
|
21
|
+
| 縮寫 | 全名 | 常見用法 |
|
|
22
|
+
|------|------|----------|
|
|
23
|
+
| **IT** | Integration Testing | 敏捷/DevOps 社群(Martin Fowler、Google Testing Blog) |
|
|
24
|
+
| **SIT** | System Integration Testing | 企業/ISTQB 環境、傳統 QA 環境 |
|
|
25
|
+
|
|
26
|
+
兩者指的是相同的測試概念。本文件交替使用 IT/SIT。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 概述
|
|
31
|
+
|
|
32
|
+
整合測試驗證不同模組、服務或元件是否能正確地協同運作。這些測試驗證整合單元之間的互動和資料流,同時可能使用真實的相依性如資料庫或外部服務。
|
|
33
|
+
|
|
34
|
+
## 特性
|
|
35
|
+
|
|
36
|
+
| 屬性 | 值 |
|
|
37
|
+
|------|------|
|
|
38
|
+
| 範圍 | 多個元件協同運作 |
|
|
39
|
+
| 相依性 | 真實與模擬混合 |
|
|
40
|
+
| 執行速度 | 秒到分鐘 |
|
|
41
|
+
| 隔離性 | 部分——測試真實整合 |
|
|
42
|
+
| 數量 | 中等數量的測試 |
|
|
43
|
+
|
|
44
|
+
## 適用情境
|
|
45
|
+
|
|
46
|
+
- 測試 API 端點與資料庫
|
|
47
|
+
- 驗證服務間通訊
|
|
48
|
+
- 驗證層間資料流
|
|
49
|
+
- 測試第三方整合
|
|
50
|
+
- 驗證設定和連線
|
|
51
|
+
|
|
52
|
+
## 測試金字塔位置
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
/\
|
|
56
|
+
/ \ E2E 測試(少)
|
|
57
|
+
/----\
|
|
58
|
+
/ ★★★ \ 整合測試 ← 這一層
|
|
59
|
+
/--------\
|
|
60
|
+
/ \ 單元測試(多)
|
|
61
|
+
/------------\
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 整合測試類型
|
|
65
|
+
|
|
66
|
+
### 1. 元件整合
|
|
67
|
+
|
|
68
|
+
測試內部元件間的互動:
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
// 測試:UserService + UserRepository + Database
|
|
72
|
+
describe('UserService Integration', () => {
|
|
73
|
+
let userService;
|
|
74
|
+
let database;
|
|
75
|
+
|
|
76
|
+
beforeAll(async () => {
|
|
77
|
+
database = await TestDatabase.connect();
|
|
78
|
+
const userRepository = new UserRepository(database);
|
|
79
|
+
userService = new UserService(userRepository);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
afterAll(async () => {
|
|
83
|
+
await database.disconnect();
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('should create and retrieve user', async () => {
|
|
87
|
+
const created = await userService.createUser({
|
|
88
|
+
name: 'John',
|
|
89
|
+
email: 'john@example.com'
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const retrieved = await userService.getUser(created.id);
|
|
93
|
+
|
|
94
|
+
expect(retrieved.name).toBe('John');
|
|
95
|
+
expect(retrieved.email).toBe('john@example.com');
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 2. API 整合
|
|
101
|
+
|
|
102
|
+
使用真實服務測試 REST/GraphQL 端點:
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
# Python/pytest 範例
|
|
106
|
+
class TestUserAPI:
|
|
107
|
+
def test_create_user_endpoint(self, test_client, test_database):
|
|
108
|
+
# 執行
|
|
109
|
+
response = test_client.post('/api/users', json={
|
|
110
|
+
'name': 'John Doe',
|
|
111
|
+
'email': 'john@example.com'
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
# 驗證
|
|
115
|
+
assert response.status_code == 201
|
|
116
|
+
assert response.json()['name'] == 'John Doe'
|
|
117
|
+
|
|
118
|
+
# 驗證資料庫
|
|
119
|
+
user = test_database.query(User).filter_by(email='john@example.com').first()
|
|
120
|
+
assert user is not None
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 3. 資料庫整合
|
|
124
|
+
|
|
125
|
+
使用真實資料庫測試資料存取層:
|
|
126
|
+
|
|
127
|
+
```java
|
|
128
|
+
// Java/JUnit 範例
|
|
129
|
+
@SpringBootTest
|
|
130
|
+
@Transactional
|
|
131
|
+
class UserRepositoryIntegrationTest {
|
|
132
|
+
|
|
133
|
+
@Autowired
|
|
134
|
+
private UserRepository userRepository;
|
|
135
|
+
|
|
136
|
+
@Test
|
|
137
|
+
void shouldFindUsersByRole() {
|
|
138
|
+
// 安排
|
|
139
|
+
userRepository.save(new User("admin", Role.ADMIN));
|
|
140
|
+
userRepository.save(new User("user1", Role.USER));
|
|
141
|
+
|
|
142
|
+
// 執行
|
|
143
|
+
List<User> admins = userRepository.findByRole(Role.ADMIN);
|
|
144
|
+
|
|
145
|
+
// 驗證
|
|
146
|
+
assertThat(admins).hasSize(1);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## 最佳實踐
|
|
152
|
+
|
|
153
|
+
### 1. 隔離測試資料
|
|
154
|
+
|
|
155
|
+
```javascript
|
|
156
|
+
describe('Order Integration', () => {
|
|
157
|
+
beforeEach(async () => {
|
|
158
|
+
// 每個測試都從乾淨狀態開始
|
|
159
|
+
await database.truncate(['orders', 'order_items']);
|
|
160
|
+
await seedProducts();
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 2. 使用交易進行清理
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
@pytest.fixture
|
|
169
|
+
def db_session():
|
|
170
|
+
"""提供測試的交易範圍。"""
|
|
171
|
+
connection = engine.connect()
|
|
172
|
+
transaction = connection.begin()
|
|
173
|
+
session = Session(bind=connection)
|
|
174
|
+
|
|
175
|
+
yield session
|
|
176
|
+
|
|
177
|
+
session.close()
|
|
178
|
+
transaction.rollback()
|
|
179
|
+
connection.close()
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 3. 測試真實情境
|
|
183
|
+
|
|
184
|
+
```javascript
|
|
185
|
+
it('should handle checkout with out-of-stock item', async () => {
|
|
186
|
+
// 設置:庫存有限的產品
|
|
187
|
+
await inventory.setStock('SKU-001', 1);
|
|
188
|
+
|
|
189
|
+
// 第一筆訂單成功
|
|
190
|
+
const order1 = await checkout.process({ sku: 'SKU-001', qty: 1 });
|
|
191
|
+
expect(order1.status).toBe('confirmed');
|
|
192
|
+
|
|
193
|
+
// 第二筆訂單因庫存不足失敗
|
|
194
|
+
await expect(checkout.process({ sku: 'SKU-001', qty: 1 }))
|
|
195
|
+
.rejects.toThrow('Out of stock');
|
|
196
|
+
});
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## 應該測試什麼
|
|
200
|
+
|
|
201
|
+
| 情境 | 原因 |
|
|
202
|
+
|------|------|
|
|
203
|
+
| 資料庫查詢 | 驗證 SQL/ORM 正確運作 |
|
|
204
|
+
| API 端點 | 測試路由、中介軟體、回應 |
|
|
205
|
+
| 服務互動 | 驗證服務間合約 |
|
|
206
|
+
| 交易邊界 | 確保資料一致性 |
|
|
207
|
+
| 錯誤傳播 | 測試跨層錯誤處理 |
|
|
208
|
+
|
|
209
|
+
## 常見框架與工具
|
|
210
|
+
|
|
211
|
+
| 類別 | 工具 |
|
|
212
|
+
|------|------|
|
|
213
|
+
| 測試容器 | Testcontainers、Docker Compose |
|
|
214
|
+
| HTTP 模擬 | nock、WireMock、responses |
|
|
215
|
+
| 資料庫 | H2(Java)、SQLite(測試模式)|
|
|
216
|
+
| API 測試 | Supertest、REST Assured、httpx |
|
|
217
|
+
|
|
218
|
+
## 相關選項
|
|
219
|
+
|
|
220
|
+
- [單元測試](./unit-testing.md) - 測試個別元件
|
|
221
|
+
- [系統測試](./system-testing.md) - 測試完整系統
|
|
222
|
+
- [E2E 測試](./e2e-testing.md) - 測試使用者流程
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 授權條款
|
|
227
|
+
|
|
228
|
+
本文件採用 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權條款。
|
|
229
|
+
|
|
230
|
+
**來源**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../../options/testing/system-testing.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2025-12-30
|
|
6
|
+
status: current
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 系統測試
|
|
10
|
+
|
|
11
|
+
> **語言**: [English](../../../../options/testing/system-testing.md) | 繁體中文
|
|
12
|
+
|
|
13
|
+
**上層標準**: [測試指南](../../core/testing.md)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 概述
|
|
18
|
+
|
|
19
|
+
系統測試針對指定需求驗證完整、整合的系統。它在接近生產環境的環境中測試整個應用程式,驗證功能性和非功能性需求。
|
|
20
|
+
|
|
21
|
+
## 特性
|
|
22
|
+
|
|
23
|
+
| 屬性 | 值 |
|
|
24
|
+
|------|------|
|
|
25
|
+
| 範圍 | 整個應用系統 |
|
|
26
|
+
| 相依性 | 所有真實元件 |
|
|
27
|
+
| 執行速度 | 分鐘到小時 |
|
|
28
|
+
| 環境 | 類生產環境 |
|
|
29
|
+
| 數量 | 精選的測試集 |
|
|
30
|
+
|
|
31
|
+
## 適用情境
|
|
32
|
+
|
|
33
|
+
- 驗證完整使用者流程
|
|
34
|
+
- 測試系統級需求
|
|
35
|
+
- 效能和負載測試
|
|
36
|
+
- 安全性測試
|
|
37
|
+
- 發布前回歸測試
|
|
38
|
+
|
|
39
|
+
## 系統測試類型
|
|
40
|
+
|
|
41
|
+
### 1. 功能測試
|
|
42
|
+
|
|
43
|
+
驗證系統符合功能需求:
|
|
44
|
+
|
|
45
|
+
```gherkin
|
|
46
|
+
# 行為驅動規格
|
|
47
|
+
Feature: 使用者註冊
|
|
48
|
+
|
|
49
|
+
Scenario: 使用有效資料成功註冊
|
|
50
|
+
Given 我在註冊頁面
|
|
51
|
+
When 我輸入有效的註冊資料
|
|
52
|
+
And 我提交註冊表單
|
|
53
|
+
Then 我應該收到確認郵件
|
|
54
|
+
And 我的帳戶應該在資料庫中建立
|
|
55
|
+
And 我應該被重導到歡迎頁面
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 2. 效能測試
|
|
59
|
+
|
|
60
|
+
驗證系統在負載下的效能:
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
// k6 負載測試範例
|
|
64
|
+
export const options = {
|
|
65
|
+
stages: [
|
|
66
|
+
{ duration: '2m', target: 100 }, // 升溫
|
|
67
|
+
{ duration: '5m', target: 100 }, // 維持 100 使用者
|
|
68
|
+
{ duration: '2m', target: 200 }, // 尖峰到 200
|
|
69
|
+
{ duration: '5m', target: 200 }, // 維持 200
|
|
70
|
+
{ duration: '2m', target: 0 }, // 降溫
|
|
71
|
+
],
|
|
72
|
+
thresholds: {
|
|
73
|
+
http_req_duration: ['p(95)<500'], // 95% 低於 500ms
|
|
74
|
+
http_req_failed: ['rate<0.01'], // 錯誤率低於 1%
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 3. 安全性測試
|
|
80
|
+
|
|
81
|
+
測試系統安全控制:
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
# 安全測試情境
|
|
85
|
+
security_tests:
|
|
86
|
+
authentication:
|
|
87
|
+
- test: "暴力破解保護"
|
|
88
|
+
steps:
|
|
89
|
+
- 嘗試 5 次失敗登入
|
|
90
|
+
- 驗證帳戶鎖定
|
|
91
|
+
- 驗證鎖定通知郵件
|
|
92
|
+
|
|
93
|
+
- test: "Session 管理"
|
|
94
|
+
steps:
|
|
95
|
+
- 登入並取得 session token
|
|
96
|
+
- 驗證 token 在逾時後過期
|
|
97
|
+
- 驗證登出時 token 失效
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 4. 可靠性測試
|
|
101
|
+
|
|
102
|
+
測試系統在不利條件下的行為:
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
# 混沌工程測試
|
|
106
|
+
class ReliabilityTest:
|
|
107
|
+
def test_database_failover(self):
|
|
108
|
+
"""系統應優雅處理資料庫故障轉移。"""
|
|
109
|
+
# 安排
|
|
110
|
+
app = TestApplication()
|
|
111
|
+
app.start()
|
|
112
|
+
|
|
113
|
+
# 執行:模擬主資料庫故障
|
|
114
|
+
app.database.simulate_failure('primary')
|
|
115
|
+
|
|
116
|
+
# 驗證:系統使用副本繼續運作
|
|
117
|
+
response = app.client.get('/api/health')
|
|
118
|
+
assert response.status_code == 200
|
|
119
|
+
assert response.json()['database'] == 'degraded'
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## 測試環境
|
|
123
|
+
|
|
124
|
+
### 環境需求
|
|
125
|
+
|
|
126
|
+
| 面向 | 需求 |
|
|
127
|
+
|------|------|
|
|
128
|
+
| 基礎設施 | 鏡像生產拓撲 |
|
|
129
|
+
| 資料 | 真實、匿名化的生產資料 |
|
|
130
|
+
| 規模 | 至少生產環境 10% 容量 |
|
|
131
|
+
| 隔離 | 與開發/測試環境分離 |
|
|
132
|
+
| 監控 | 啟用完整可觀測性 |
|
|
133
|
+
|
|
134
|
+
## 測試報告
|
|
135
|
+
|
|
136
|
+
### 報告結構
|
|
137
|
+
|
|
138
|
+
```markdown
|
|
139
|
+
# 系統測試報告
|
|
140
|
+
|
|
141
|
+
## 摘要
|
|
142
|
+
- **日期**: 2024-01-15
|
|
143
|
+
- **版本**: v2.3.0
|
|
144
|
+
- **環境**: system-test-01
|
|
145
|
+
- **時長**: 4 小時 32 分鐘
|
|
146
|
+
|
|
147
|
+
## 結果總覽
|
|
148
|
+
| 類別 | 通過 | 失敗 | 跳過 |
|
|
149
|
+
|------|------|------|------|
|
|
150
|
+
| 功能 | 145 | 3 | 2 |
|
|
151
|
+
| 效能 | 12 | 0 | 0 |
|
|
152
|
+
| 安全 | 28 | 1 | 0 |
|
|
153
|
+
|
|
154
|
+
## 效能指標
|
|
155
|
+
- 平均回應時間: 234ms
|
|
156
|
+
- 95 百分位: 456ms
|
|
157
|
+
- 錯誤率: 0.02%
|
|
158
|
+
- 吞吐量: 1,200 req/sec
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 最佳實踐
|
|
162
|
+
|
|
163
|
+
1. **在類生產環境測試**
|
|
164
|
+
2. **使用真實資料量**
|
|
165
|
+
3. **包含非功能性需求**
|
|
166
|
+
4. **自動化回歸測試**
|
|
167
|
+
5. **清楚記錄測試情境**
|
|
168
|
+
6. **執行期間監控**
|
|
169
|
+
7. **執行後清理測試資料**
|
|
170
|
+
|
|
171
|
+
## 相關選項
|
|
172
|
+
|
|
173
|
+
- [單元測試](./unit-testing.md) - 測試個別元件
|
|
174
|
+
- [整合測試](./integration-testing.md) - 測試元件互動
|
|
175
|
+
- [E2E 測試](./e2e-testing.md) - 測試使用者流程
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 授權條款
|
|
180
|
+
|
|
181
|
+
本文件採用 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權條款。
|
|
182
|
+
|
|
183
|
+
**來源**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
|