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
230
0
Share
使い捨てAPIテストのすすめ
izumix03
February 09, 2024
Other Decks in Business
See All in Business
【簡易版】パーソルクロステクノロジー_システムインテグレーション領域のご紹介 / Introduction_of_persol-xtech_gs_es_dx_short
pxt_gs_ssol
0
160k
涅槃へGO!〜わたしの世界は、全てわたしの認識でできている〜
doiko123
0
680
製造業 R&D の情シスが CBs になって感じたこと & AWS WorkSpaces Secure BrowserでPoC前夜に難を逃れた話
tsunojun
2
220
開発時間2時間!gemma 4で動くローカルAIマルチエージェント構築(Python標準ライブラリ縛り)
hideyuki_ogawa
0
150
YassLab (株) サービス紹介 / Introduction of YassLab
yasslab
PRO
3
43k
政策共創事例集2025
polipoli
0
170
哲学ドリブン開発の全体像 ── 同じプロンプトで出力が変わるとき、何が起きているのか~Philosophy as Code
makitotashiro
0
170
【理学療法士・主任ケアマネの方急募】 入職祝い金 一律10万円支給キャンペーン
takanona25
0
230
Yot合同会社 会社紹介資料|ハイクラス領域エージェント職採用
yotllc
0
130
Smart Share Recruiting Deck
smartshare
0
300
Speee_2026年9月期第2四半期 決算説明資料
speee_pr
0
3.2k
FIGEO採用ピッチ資料
figeohr
0
120
Featured
See All Featured
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
420
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
230
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Bash Introduction
62gerente
615
210k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
520
Crafting Experiences
bethany
1
160
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
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リプレイス!