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
1
850
IIS URL Rewrite のユニットテストをしよう! /iis-url-rewrite-unit-test
.NET Conf 2017 Tokyo, Japan の LT
https://csugjp.connpass.com/event/66004/
minato128
October 07, 2017
Tweet
Share
More Decks by minato128
See All by minato128
Cloudflare Use Cases at CADDi
minato128
2
450
Azure Monitoring with Datadog Part 1
minato128
0
160
新メール配信基盤への移行 /ikyu-mail-platform
minato128
7
5.7k
デプロイ完全自動化から1年で起きたこと /ikyu-deploy
minato128
2
4.8k
Other Decks in Programming
See All in Programming
CursorはMCPを使った方が良いぞ
taigakono
0
120
Gleamという選択肢
comamoca
6
740
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
220
イベントストーミングから始めるドメイン駆動設計
jgeem
4
860
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
240
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
890
從零到一:搭建你的第一個 Observability 平台
blueswen
1
960
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
280
機械学習って何? 5分で解説頑張ってみる
kuroneko2828
0
220
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
960
Create a website using Spatial Web
akkeylab
0
290
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Stop Working from a Prison Cell
hatefulcrawdad
270
20k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
Done Done
chrislema
184
16k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
How to train your dragon (web standard)
notwaldorf
92
6.1k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
The World Runs on Bad Software
bkeepers
PRO
68
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
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