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
IIS URL Rewrite のユニットテストをしよう! /iis-url-rewrite-...
Search
minato128
October 07, 2017
Programming
940
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
IIS URL Rewrite のユニットテストをしよう! /iis-url-rewrite-unit-test
.NET Conf 2017 Tokyo, Japan の LT
https://csugjp.connpass.com/event/66004/
minato128
October 07, 2017
More Decks by minato128
See All by minato128
Cloudflare Use Cases at CADDi
minato128
2
720
Azure Monitoring with Datadog Part 1
minato128
0
220
新メール配信基盤への移行 /ikyu-mail-platform
minato128
7
6k
デプロイ完全自動化から1年で起きたこと /ikyu-deploy
minato128
2
5k
Other Decks in Programming
See All in Programming
Oxlintはいいぞ(続)
yug1224
1
480
リアルな遅延を測る仕様
kota_yata
1
130
プロポーザルを書いてもらう
pvcresin
0
590
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
400
引き算の組織 ― アウトカムとAIに全振りするために辞めたこと ― / Organization by Subtraction
hirokiyamamoto14
PRO
0
310
FastAPI の並行処理モデルを完全に理解する
hoto17296
8
3.2k
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
3.8k
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
470
AIの中の人になってみる
htkym
0
140
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
1
2k
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
7.9k
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.3k
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
420
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
550
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
420
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
400
[SF Ruby Conf 2025] Rails X
palkan
2
1.3k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
390
Code Review Best Practice
trishagee
74
20k
Transcript
IIS URL Rewrite の ユニットテストをしよう! 株式会社一休 宿泊事業本部 開発部 飯迫 正貴
2017/10/07 LT
IIS URL Rewrite とは?
IIS URL Rewrite とは? • URL Rewrite Module • https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-
module/using-the-url-rewrite-module • 設定に書いたルールに従ってURLを書き換えてくれる
課題
課題 • 便利な反面、継ぎ足し続けるとわけが分からなくなる • 負債化しやすい • 全体が理解できず、変更すると他が壊れるのではという恐怖 • ジェンガ状態 •
気軽にリファクタリングできない
www.ikyu.com/rewrite.config
きっかけ • ある日の会議の雑談 • わたし「そういえばRewriteがバグりやすいんですよねえ」 • CTO「はてなでは rewrite のテスト書いてたよ」 •
http://d.hatena.ne.jp/onishi/20101017/1287277579 • 数日後 • しばやん「テスト用のライブラリ作りました」 • http://blog.shibayan.jp/entry/20160620/1466392651
IIS Express TestKit
IIS Express TestKit • Rewrite Rule のテストが書けるハイパー便利ツール • Outbound Rule
も対応 • OSS • https://github.com/shibayan/iisexpress-testkit
IIS Express TestKit
Project Example
Rewrite Rule Example
Outbound Rule Example
運用してみた
運用してみた • 壊れるのを恐れず、気軽に変更できるようになった • 最高 • CI に Rewrite のユニットテストを追加
• 不正なRewriteがリリースされる事故がなくなった • データセンターからクラウドに移行したときにも活躍 • PaaSに乗せるためアプリを分割したらテストが通らなくなった • 通らなくなったもの=分割してなくなった部分のテスト => Rewriteも分割 • ユニットテストを書いたことで参照されてないルールがあぶり 出された • そしてリファクタリング
参照されてないルール
まとめ • IIS の URL Rewrite もユニットテストが書ける! • URL Rewrite
運用で困っている人は今すぐインストールして書 きましょう! • Install-Package IisExpressTestKit