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
930
1
Share
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
640
Azure Monitoring with Datadog Part 1
minato128
0
200
新メール配信基盤への移行 /ikyu-mail-platform
minato128
7
6k
デプロイ完全自動化から1年で起きたこと /ikyu-deploy
minato128
2
5k
Other Decks in Programming
See All in Programming
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
2026年のソフトウェア開発を考える(2026/05版) / Software Engineering Scrum Fest Niigata 2026 Edition
twada
PRO
23
12k
20260514_its_the_context_window_stupid.pdf
heita
0
990
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.8k
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
460
要はバランスからの卒業 #yumemi_grow
kajitack
0
160
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
170
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
3k
Agentic Elixir
whatyouhide
0
450
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
820
Kingdom of the Machine
yui_knk
2
1.5k
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
510
Featured
See All Featured
The Mindset for Success: Future Career Progression
greggifford
PRO
0
330
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
210
Heart Work Chapter 1 - Part 1
lfama
PRO
7
35k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
150
RailsConf 2023
tenderlove
30
1.4k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
210
How STYLIGHT went responsive
nonsquared
100
6.1k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
550
Darren the Foodie - Storyboard
khoart
PRO
3
3.3k
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