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_gs
pxt_gs_ssol
0
3.2k
AIで経理の仕事はどう変わるのか
shunsuke_takeuchi
PRO
0
250
GEO Experiments 2026: What We Tested, What Failed, and What Actually Works
thomaspeham
1
2.9k
CMB.TECH earnings call Q1 2026
cmbtech
PRO
0
1k
suisei.inc_ company deck
suisei2015
0
360
PIVOT:BPエントランスブック
sotaro04
0
130
SHIFT ASIA 会社説明資料 V2.4
shiftasiarec
0
3.5k
The STORY OF M5STACK 2026年 名古屋Station AI M5Stack名古屋ミートアップにて #M5JPTOUR2026
takasumasakazu
0
180
AI導入で変わる PdMとエンジニアの関係性
paulxl
0
130
"分からないまま走る"をやめたら不確実性に向き合えるチームになっていった話 ~開発指標で語るプロセス改善~
bicstone
1
160
ログラス会社紹介資料 / Loglass Company Deck
loglass2019
17
540k
CC採用候補者向けピッチ資料
crosscommunication
2
59k
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2k
Paper Plane (Part 1)
katiecoart
PRO
0
8.1k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
340
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Automating Front-end Workflow
addyosmani
1370
210k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Building an army of robots
kneath
306
46k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
440
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
820
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リプレイス!