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
izumix03
February 09, 2024
Business
220
0
Share
使い捨てAPIテストのすすめ
izumix03
February 09, 2024
Other Decks in Business
See All in Business
20260401_UPDATER_companysummary
updater_pr
0
120k
Matlantis株式会社 Company Deck
matlantis
0
610
白金鉱業meetup発表資料
tetsuroito
1
110
オッドナンバーとは何だったのか 〜ラブライブ!蓮ノ空女学院スクールアイドルクラブのスマートホン向けアプリ「Link!Like!ラブライブ!」の果たした役割〜
ceras123
1
170
malna-recruiting-pitch
malna
0
18k
健康食品EC
contentmetrics
0
190
【For Engineer】会社紹介資料_20260413
homie__recruit
0
120
FABRIC TOKYO会社紹介資料 / We are hiring(2026年04月02日更新)
yuichirom
36
390k
アジャイル原則を「使える言葉」にする / Making the Agile Principles Usable
fkino
5
930
【正社員】C-United 会社説明資料
chrecruit
0
530
みんなの産育休ガイドブック+《2026年版》(スパイダープラス)
spiderplus_cb
0
310
介護休業ガイドブック(スパイダープラス)
spiderplus_cb
0
290
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.2k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
310
We Have a Design System, Now What?
morganepeng
55
8.1k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Done Done
chrislema
186
16k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
210
Building Flexible Design Systems
yeseniaperezcruz
330
40k
ラッコキーワード サービス紹介資料
rakko
1
3M
Mind Mapping
helmedeiros
PRO
1
150
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リプレイス!