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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
minato128
October 07, 2017
Programming
1
910
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
570
Azure Monitoring with Datadog Part 1
minato128
0
190
新メール配信基盤への移行 /ikyu-mail-platform
minato128
7
5.9k
デプロイ完全自動化から1年で起きたこと /ikyu-deploy
minato128
2
4.9k
Other Decks in Programming
See All in Programming
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
460
CSC307 Lecture 15
javiergs
PRO
0
230
Event Storming
hschwentner
3
1.3k
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.8k
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
970
SourceGeneratorのマーカー属性問題について
htkym
0
170
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
110
朝日新聞のデジタル版を支えるGoバックエンド ー価値ある情報をいち早く確実にお届けするために
junkiishida
1
390
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
590
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
410
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
11
2.5k
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.2k
[SF Ruby Conf 2025] Rails X
palkan
2
820
Marketing to machines
jonoalderson
1
5k
Speed Design
sergeychernyshev
33
1.6k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
450
Ruling the World: When Life Gets Gamed
codingconduct
0
160
Designing for Timeless Needs
cassininazir
0
150
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
250
GraphQLとの向き合い方2022年版
quramy
50
14k
The Limits of Empathy - UXLibs8
cassininazir
1
250
New Earth Scene 8
popppiees
1
1.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
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