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
CSC307 Lecture 12
javiergs
PRO
0
460
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
530
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
370
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
200
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
11
2.6k
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1.2k
15年目のiOSアプリを1から作り直す技術
teakun
1
610
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.3k
株式会社 Sun terras カンパニーデック
sunterras
0
2k
Python’s True Superpower
hynek
0
200
Windows on Ryzen and I
seosoft
0
210
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
170
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
660
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
120
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
150
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
68
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
200
Into the Great Unknown - MozCon
thekraken
40
2.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
AI: The stuff that nobody shows you
jnunemaker
PRO
3
360
Done Done
chrislema
186
16k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
210
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