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
Snapshot testing (dpc)
Search
Freek Van der Herten
June 30, 2017
Technology
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Snapshot testing (dpc)
Freek Van der Herten
June 30, 2017
More Decks by Freek Van der Herten
See All by Freek Van der Herten
Uncharted packages (ode aan de code)
freekmurze
0
71
Uncharted packages (Laravel Live Denmark)
freekmurze
0
270
I shall define this only once
freekmurze
0
490
An Introduction to Snapshot testing
freekmurze
0
580
Event Sourcing In Laravel
freekmurze
0
290
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
890
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
930
A practical look at multitenancy in Laravel
freekmurze
1
410
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
800
Other Decks in Technology
See All in Technology
変化の早いClaude Codeを 書籍に落とし込む
oikon48
6
1.2k
AIQAのナレッジ構築について
qatonchan
1
150
Amazon Bedrock Managed Knowledge BaseDive Deep
ren8k
0
370
Webの技術とガジェットで子どもも大人も楽しめるワクワク体験を提供する / Qiita Tech Festa Day 2026
you
PRO
1
340
今こそ聞きたいソフトウェア設計 ドメイン駆動設計再入門
masuda220
PRO
7
1.7k
AI ネイティブな組織に Gemini Enterprise Agent Platform がなぜ必要なのか
asei
1
160
認知負荷をGemini で溶かす — GKE 基盤「Orbit」における AI エージェントの実践
sansantech
PRO
1
220
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
53k
運用を犠牲にせずコストを制御し事業成長を支える B2B SaaS ID管理基盤におけるS3 Tableのログストレージ活用
kaminashi
1
150
Redmine 7.0 新機能・機能強化解説(OSC2026京都ダイジェスト版)
vividtone
1
170
論語・武士道・産業革命から見る かわるもの、かわらないもの
ichimichi
8
2.2k
PLaMo 3.0 Primeの構造化出力サポート
pfn
PRO
0
170
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
820
Measuring & Analyzing Core Web Vitals
bluesmoon
9
950
Raft: Consensus for Rubyists
vanstee
141
7.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Facilitating Awesome Meetings
lara
57
7.1k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
240
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
119
120k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
460
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Building Adaptive Systems
keathley
44
3.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Transcript
A practical intro to snapshot testing
About me Freek Van der Herten Partner & developer at
SPATIE @freekmurze https://murze.be
About me phpantwerp.be Dries Vints @driesvints Frederick Vanbrabant @TheEdonian
Since 2003 Websites, applications and webshops Team 4 developers, 1
manager Specialization Laravel development
OPEN SOURCE SOFTWARE
± 120 packages on Packagist Laravel, Framework agnostic PHP ±
4 000 000 downloads in total, growing ±450 000 a month We create a lot of it Open source software
http://github-awards.com/users?type=world&language=php Open source software
LET’S TALK SNAPSHOT TESTING
A file on disk, let’s call in snapshot Test succeeds
if output matches snapshot If not, test will fail What?
Old name: characterization testing Popularized by Facebook Jest Testing interfaces
Where does it come from?
https://github.com/spatie/phpunit-snapshot-assertions assertMatchesSnapshot assertMatchesJsonSnapshot assertMatchesXmlSnapshot How can we do it in
PHP?
DEMO
WRAPPING UP
Advantages Very easy to get started with Can be used
to validate complex output Easily update all the tests in one go
Disadvantages Brittle Hard to pinpoint exact point of failure Bugs
can be easily written in the snapshots
https://github.com/spatie/phpunit-snapshot-assertions https://sebastiandedeyne.com/posts/2017/a-package-for-snapshot- testing-in-phpunit https://murze.be/2017/04/practical-introduction-snapshot-testing/ https://www.sitepoint.com/snapshot-testing-viable-php/ https://facebook.github.io/jest/docs/snapshot-testing.html Interesting links
QUESTIONS?
Thank you! https://speakerdeck.com/freekmurze/snapshot-testing-dpc https://spatie.be/opensource https://murze.be https://murze.be/newsletter/