書籍「実践テスト駆動開発」 で紹介された TDD は、モックを多用した設計手法を使用して外側からソフトウェアを構築していく「アウトサイドイン」な TDD である。
これはケントベックの「テスト駆動開発」で紹介された、ドメイン周りのロジックから設計を行なっていく「インサイドアウト」な TDD とは異なる手法である。
このリポジトリでは、ロンドン派の TDD を検証する。
ベースとして下記の講座を活用する。
実現する機能は以下になる。
POST /api/v1/secrets
- 入力されたシークレット値を保存する
- シークレット値は後から URL ベースで取得できる
- 最低でも 3 文字
GET /api/v1/secrets/<secret value>
- 入力されたシークレット値を取得する
- 一度だけ取り出すことができる
- 取り出した後は削除される
- アクセスする URL には最低でも 10 文字の値が必要
- 存在しない場合エラーを返す
- 期限が失効していた場合は、エラーを返す
npm init -y
npm install --save-dev typescript @types/node vitest c8
npm install --save-dev \
eslint \
@typescript-eslint/parser \
@typescript-eslint/eslint-plugin \
prettier \
eslint-config-prettier \
eslint-plugin-import \
eslint-plugin-unused-imports
- https://github.com/shimopino/outside-in-tdd/tree/feature/1-environment-setup
- https://github.com/shimopino/outside-in-tdd/tree/feature/2-acceptance-test
- https://github.com/shimopino/outside-in-tdd/tree/feature/3-green-acceptance-test
- https://github.com/shimopino/outside-in-tdd/tree/feature/4-refactoring
- https://github.com/shimopino/outside-in-tdd/tree/feature/5-second-acceptance-test
- https://github.com/shimopino/outside-in-tdd/tree/feature/6-refactoring
- https://github.com/shimopino/outside-in-tdd/tree/feature/7-add-secret-retriver
- https://github.com/shimopino/outside-in-tdd/tree/feature/8-add-secret-repository
- https://github.com/shimopino/outside-in-tdd/tree/feature/9-pass-get-secrets-ac
- https://github.com/shimopino/outside-in-tdd/tree/feature/10-uncontrolled-error-handling
- https://github.com/shimopino/outside-in-tdd/tree/feature/11-acceptance-test-for-store-secret
- https://github.com/shimopino/outside-in-tdd/tree/feature/12-store-secret-controller
- https://github.com/shimopino/outside-in-tdd/tree/feature/13-secret-storer
- https://github.com/shimopino/outside-in-tdd/tree/feature/14-unhandling-error
- https://github.com/shimopino/outside-in-tdd/tree/feature/15-refactoring-3
- https://github.com/shimopino/outside-in-tdd/tree/feature/16-e2e