自動テストはCI/CDの心臓部です。コード変更を統合・デプロイしても安全であるという信頼を与えるものです。良い自動テストがなければ、CI/CDは単にバグをより速く出荷する仕組みになってしまいます。テストの質はCI/CDパイプラインの価値を大きく左右します。
なぜ重要なのか
CI/CD AUTOMATES deployment — but automation is only safe if changes are VERIFIED:
→ automated TESTS verify each change works (and didn't break anything)
→ tests are the QUALITY GATE: pass → safe to proceed; fail → stop
→ WITHOUT good tests, CI/CD just deploys bugs to production faster (automation
amplifies whatever you have — good OR bad)
→ The confidence to deploy frequently/automatically COMES FROM the test suite.
パイプラインにおけるテストの種類
UNIT tests → test individual functions/components (fast, run on every change) — the bulk
INTEGRATION tests → test components working together (DB, APIs)
END-TO-END (E2E) tests → test full user flows (slower; often in staging)
OTHER → linting, static analysis, security scans, performance tests
→ The TEST PYRAMID: many fast unit tests, fewer integration, fewest E2E.
