Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
使い捨てAPIテストのすすめ
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
izumix03
February 09, 2024
Business
240
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
使い捨てAPIテストのすすめ
izumix03
February 09, 2024
Other Decks in Business
See All in Business
CompanyDeck_v7.0.pdf
xid
3
27k
dotcue採用ピッチ2606.pdf
dotcue
0
140
開発時間2時間!gemma 4で動くローカルAIマルチエージェント構築(Python標準ライブラリ縛り)
hideyuki_ogawa
0
300
ブランディングサービス紹介資料《抜粋版》
brandingtechnology
0
530
【簡易版】パーソルクロステクノロジー_システムインテグレーション領域のご紹介 / Introduction_of_persol-xtech_gs_es_dx_short
pxt_gs_ssol
0
170k
現実は、会話から生まれる。〜 1on1とチームの場を繋ぐ、社会構成主義的実践 〜
emi0726
1
250
"分からないまま走る"をやめたら不確実性に向き合えるチームになっていった話 ~開発指標で語るプロセス改善~
bicstone
1
230
jpax-introduction
jpax
0
1.3k
Eight Career Recruiting Pitch_2605
sredoa
0
1.3k
家族アルバム みてね 事業紹介 / Our Business
familyalbum
8
59k
株式会社ショーエイ_採用説明資料
shoeidex
0
160
okr and devops -- Why OKRs Fail and DevOps as the Practice to Make Them Work
ikuodanaka
0
150
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
420
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
180
BBQ
matthewcrist
89
10k
Ruling the World: When Life Gets Gamed
codingconduct
0
260
Done Done
chrislema
186
16k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
250
Git: the NoSQL Database
bkeepers
PRO
432
67k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Crafting Experiences
bethany
1
180
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Embracing the Ebb and Flow
colly
88
5.1k
Transcript
使い捨てAPIテストのすすめ ~取得系APIのリプレイスで使えるTips~ DeNA SOMPO Mobility 泉川 貴洋
WEB APIのリプレイって⼤変... 2 実際にやってよかったTips 使い捨てAPIテスト どういう仕様?複雑すぎる... テストもない... 既存APIと同じ挙動を保証?!!
3 泉川 貴洋 / いずみかわ たかひろ 所属 DeNA SOMPO Mobility
グロース本部プロダクト開発部 担当 Anyca サーバサイドエンジニア 出⾝ ⾹川県 家族構成 妻と2歳の娘の3⼈家族 @izumix0303
エニカとは 新型⾞‧⾼級⾞など1,300以上の⾞種に乗れる、 個⼈間を中⼼としたカーシェアサービス。 カーシェアを通じた理想のライフスタイルを提供 4
‧データ準備(登録, DB Dump,etc...) ‧リクエストと正解レスポンスを定義 ‧CIなどで継続的に実⾏ 5 使い捨てAPIテスト? ⼀般的なAPIテスト 使い捨てAPIテスト ‧データ準備(登録,
DB Dump,etc...) ‧リクエストだけ定義 ‧開発終わったら破棄 = 使い捨て
使い捨てAPIテストの構築⼿順 ①古いエンドポイント 旧 新 ②新エンドポイントを 別に作る ③テストを書く GET old/hoge/1 レスポンス取得
新旧のレスポンス⽐較! GET new/hoge/1 ④開発 DB
使い捨てAPIテストの作り⽅ ‧Jupyter Labで作る ‧pythonに変換して実⾏ ‧pytest-clarity で差分を⾒やすくする
Jupyter Labで作る 対話的に確認しながら作れる
Pythonに変換 Makefileの例 Pythonに変換しながら Pytestを実⾏ NOTEBOOKS:=$(shell find src/test -name "*.ipynb") PYS:=$(NOTEBOOKS:.ipynb=.py)
.PHONY: convert convert: $(PYS) %.py: %.ipynb $(VENV)/jupyter nbconvert --to python $< .PHONY: test test: convert $(VENV)/pytest -vv ./src/test/**/*.py include Makefile.venv
pytest-clarity で差分を⾒やすくする JSONの差分を、 ⾊付けして ⾒せてくれる
使い捨てAPIテストのメリット 作りやすさ 簡単に 作れる 質 保証内容が 確実 量 パターンも ⼗分確保
Let's 快適なAPIリプレイス!