Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
テストファーストで開発したら最高だった! / Developing With Test-...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
yazawa_tech
June 27, 2019
Technology
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
テストファーストで開発したら最高だった! / Developing With Test-First Was Great
yazawa_tech
June 27, 2019
Other Decks in Technology
See All in Technology
How to Design Configuration for Rails Applications
willnet
1
820
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
170
継続的なAIコスト最適化
bgpat
1
350
re:Invent初参加で変わったこと、2回目にやってみたいこと(JAWS-UG彩の国埼玉 #12)
mhrtech
2
240
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
200
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
190
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
310
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
980
S3 Filesで挑む! 八戸せんべい汁の食べ頃問題
usanchuu
0
100
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
110
事業成長とデータ活用を止めないためのマネジメントへ挑戦
hiracky16
0
400
AI × アーキテクト 第1・2章|生成AIの課題とアーキテクトの素養
daidaidai
0
170
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
1
590
Marketing to machines
jonoalderson
1
5.9k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
My Coaching Mixtape
mlcsv
0
360
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Abbi's Birthday
coloredviolet
4
10k
Amusing Abliteration
ianozsvald
1
350
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Technical Leadership for Architectural Decision Making
baasie
3
600
How GitHub (no longer) Works
holman
316
150k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Transcript
テストファーストで開発したら最高だった! 2019.06.27 @yazawa_tech
- 職種: Webアプリケーションエンジニア - 言語: Java | PHP | Go’
| Python’ | (Ruby) - 仕事: メール配信サービス開発 - マイブーム:
今日のゴール - 「テスト駆動開発」の概要を知ってもらうこと - 仕事でテストファーストを実践した時の話を知ってもらうこと - 「テストコード書いてみよう」と思ってもらうこと
テスト駆動開発とは - 「動作するきれいなコード」をゴールとする (Ron Jeffries) - レッド・グリーン・リファクタリング の順で開発する - レッド:
動作しない、時にはコンパイルすら通らないテストコードを書く - グリーン: そのテストを迅速に動作させる - リファクタリング: テストを通すために書いたコードの重複を削除する
ミッション: 契約金額見積API -2019年10月に消費税改正 (リリース済み) -8% → 10% -2019年10月以降のどこかでサービスの価格改定 -改定の時期は未確定 -消費税改正対応時のソースコードでは期待するアウトプットが出ない
-お金に関係する機能なので顧客影響がでかい -テストファーストで開発してみることにする
フロー 1. テストパターンを列挙する - 【契約】新規 | 変更, 【時期】同時 | 未来,
【金額】UP | DOWN 2. パターンの数だけ「テストメソッド」と「期待値」を書く - $this->assertSame($expected, $actual); 3. テストを実行する - vendor/bin/phpunit → 4. 失敗したテストケースがパスするようにコーディングしていく - この時点では, 汚くてもとにかくテストコードが通るように! 5. リファクタリング - まとめられるコードはまとめる, 変数名の修正や無駄なロジックがあれば削除する Failure
最高だったところ - やるべきことの「優先順位」が明確になる - まず ”全てのテストがパスすること” - 綺麗なコードや保守性の高いコードは ”最悪二の次” -
列挙したパターンに対して「絶対的自信」が持てる - 事前に関係者とパターンを使って認識合わせしておくと、なお良し - テストケースが仕様書にもなる - テストメソッドにコメントを付与して条件を記載 - デグレの心配もなし - リファクタリング後 / コミット前 / あらゆるフェーズでテストを実行!
Mark Elliot Zuckerberg “Done is better than perfect. ”
まとめ みんなもテストファーストで開発しよう!