Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
できる!!! Validation !!! - builderscon tokyo 2017
Search
kazusuke sasezaki
January 13, 2024
220
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
できる!!! Validation !!! - builderscon tokyo 2017
builderscon tokyo 2017
kazusuke sasezaki
January 13, 2024
Transcript
28 slides
できる!!! Validation !!! @sasezaki
LT LT は は 15 15 分越えの 分越えの 世界から来ました 世界から来ました
... ...
みなさんは、普段 清く正しく美しく バリデートを実装してますか?
無理!
世界は欺瞞であふれてるのに 真偽なんて判定できるわけないだろ!
バリデートって一体何なんだろう?
「バリデート 」 が何を指してるかはっきりさせないと・・・ Web アプリケーションにおいて バリデーション ( 以下バリデーションとは アプリケーションの最初の段階で 行われる入力値検証、いわゆる
フォームバリデーションを指します ) CMS 四天王のバリデーション状況を調査したところ意外な結果になった | 徳丸浩の日記 ] http://blog.tokumaru.org/2015/06/cms.html Web アプリケーションにおいて バリデーション ( 以下バリデーションとは アプリケーションの最初の段階で 行われる入力値検証、いわゆる フォームバリデーションを指します ) CMS 四天王のバリデーション状況を調査したところ意外な結果になった | 徳丸浩の日記 ] http://blog.tokumaru.org/2015/06/cms.html assert 防御的プログラミング guard 例外 フィルタリング 入力エラー チェック スカラー値? 複合条件 ? 多次元配列 ? x-www-form-urlencoded / JsonSchema
末代まで遺恨を残す
バリデート…こんなスタンスで作業 始めがち
死ぬ
「空白 は はじいて」
死ぬ
「空白 は はじいて」
「このフィールドは アルファベットで」
死ぬ
「このフィールドは アルファベットで」
この正規表現を コピペすれば 楽になれるよ
死ぬ
「正常系じゃない場合の エラーメッセージの 取得をどうしよう? ・・・ あ、思いついた!」
死ぬ
None
※ 先ほどのコード例は、 "php validation library" で ググって一番トップに来る 星の数 4000
位のプロジェクトから の引用です。
「有効でない オブジェクトと 判定したら 例外だー!」
死ぬ
None
None
結論: 検証の結果、人類の存 在があやまりだった。
完
More Decks by kazusuke sasezaki
See All by kazusuke sasezaki
PHPでの .gitattributes
sasezaki
0
190
はじめてのミューテーション解析 / Mutation Testing
sasezaki
2
1.7k
こんなPHP開発者はイヤだ
sasezaki
2
3.9k
Introduction of Web scraping for PHP users
sasezaki
0
140
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Done Done
chrislema
187
17k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
470
WENDY [Excerpt]
tessaabrams
15
40k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
530
The SEO Collaboration Effect
kristinabergwall1
1
620
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
330