$30 off During Our Annual Pro Sale. View Details »
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
880
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
520
Azure Monitoring with Datadog Part 1
minato128
0
180
新メール配信基盤への移行 /ikyu-mail-platform
minato128
7
5.9k
デプロイ完全自動化から1年で起きたこと /ikyu-deploy
minato128
2
4.9k
Other Decks in Programming
See All in Programming
How Software Deployment tools have changed in the past 20 years
geshan
0
28k
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
1.2k
WebRTC と Rust と8K 60fps
tnoho
2
1.9k
[SF Ruby Conf 2025] Rails X
palkan
0
480
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
6.7k
エディターってAIで操作できるんだぜ
kis9a
0
690
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
26
22k
20 years of Symfony, what's next?
fabpot
2
330
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
170
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
10
11k
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
290
分散DBって何者なんだ... Spannerから学ぶRDBとの違い
iwashi623
0
180
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Practical Orchestrator
shlominoach
190
11k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Into the Great Unknown - MozCon
thekraken
40
2.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Automating Front-end Workflow
addyosmani
1371
200k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
710
Building an army of robots
kneath
306
46k
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