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
使い捨てAPIテストのすすめ
Search
izumix03
February 09, 2024
Business
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
使い捨てAPIテストのすすめ
izumix03
February 09, 2024
Transcript
12 slides
使い捨て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リプレイス!
Other Decks in Business
See All in Business
G-gen 会社概要
ggen
0
1.6k
AWS BuilderCardsを社内実践して見えたSales職への提案教育/Insights_from_Implementing_AWS_BuilderCards_Internally_Training_for_Sales_Roles_.pdf
masakiokuda
0
220
Session 5 - Teknik Lobby dan Negosiasi
adeputra13
0
540
ファブリカホールディングス_2027年3月期 第2四半期説明資料
fabrica_com
1
6.4k
話題のバングラデシュ人就労、最新の数字でまとめてみた(2026年10月31日時点)
shunkisugaya
0
550
株式会社TableCheck - 会社紹介 Company Profile
tablecheckac
0
11k
カンパニーデック
nessu_inc
0
1.2k
人は呼び方で行動が変わる / The Stance That Comes Before Scrum
aokiplayer
0
500
会社説明資料 | 株式会社Swish
takumi4327
0
190
G-gen カルチャー
ggen
0
1.3k
現場感と大局観 -具体と抽象の両端からチームと事業を動かす-
ymk1102
0
170
Clarity for Product People (short version)
arnekittler
0
810
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.8k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
990
The SEO identity crisis: Don't let AI make you average
varn
0
630
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
The Curse of the Amulet
leimatthew05
4
17k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Into the Great Unknown - MozCon
thekraken
41
2.8k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
Facilitating Awesome Meetings
lara
57
7.2k