Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Test-driven development with PHPUnit
Search
Oliver Klee
June 23, 2018
Technology
0
1.3k
Test-driven development with PHPUnit
Oliver Klee
June 23, 2018
Tweet
Share
More Decks by Oliver Klee
See All by Oliver Klee
Gewaltfreie Kommunikation: ein Crashkurs
oliverklee
0
76
Team-Management-Plattform
oliverklee
0
64
Vertrauen in Teams & Führung
oliverklee
0
240
Software-Qualität von TYPO3-Extensions automatisieren
oliverklee
0
38
Vertrauen in Teams & Führung
oliverklee
0
150
Testing von TYPO3-Extensions
oliverklee
0
75
Software-Qualität von Extensions automatisieren
oliverklee
1
52
Content-Synchronisierung
oliverklee
0
160
Gewaltfreie Kommunikation: ein Crashkurs
oliverklee
0
320
Other Decks in Technology
See All in Technology
Amazon Quick Suite で始める手軽な AI エージェント
shimy
1
1.1k
AgentCoreとStrandsで社内d払いナレッジボットを作った話
motojimayu
1
280
年間40件以上の登壇を続けて見えた「本当の発信力」/ 20251213 Masaki Okuda
shift_evolve
PRO
1
140
AWS re:Invent 2025~初参加の成果と学び~
kubomasataka
0
150
AIプラットフォームにおけるMLflowの利用について
lycorptech_jp
PRO
1
180
Bedrock AgentCore Memoryの新機能 (Episode) を試してみた / try Bedrock AgentCore Memory Episodic functionarity
hoshi7_n
2
1.1k
mairuでつくるクレデンシャルレス開発環境 / Credential-less development environment using Mailru
mirakui
5
570
Kiro を用いたペアプロのススメ
taikis
3
1k
ペアーズにおけるAIエージェント 基盤とText to SQLツールの紹介
hisamouna
2
960
今年のデータ・ML系アップデートと気になるアプデのご紹介
nayuts
1
600
業務のトイルをバスターせよ 〜AI時代の生存戦略〜
staka121
PRO
2
230
Agent Skillsがハーネスの垣根を超える日
gotalab555
3
1.8k
Featured
See All Featured
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
180
The Limits of Empathy - UXLibs8
cassininazir
1
190
The Cult of Friendly URLs
andyhume
79
6.7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
25
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Google's AI Overviews - The New Search
badams
0
860
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
1
200
Marketing to machines
jonoalderson
1
4.3k
Exploring anti-patterns in Rails
aemeredith
2
200
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Transcript
Test-driven Development with PHPUnit Oliver Klee, 2018-06 @oliklee
[email protected]
This is Oliver Klee (me!) Workshop teacher •unit testing •extension
development •software quality •saying „no“, consent culture TYPO3 extension developer (wanna-be) singer @oliklee oliverklee oliverklee.de
unterstand TDD become test-infected have fun Workshop goals
Workshop Rules
Stand up for your tests
Workshop roadmap 1. Terms & concepts 2. Testing patterns 3.
Naming things 4. Code katas
Workshop roadmap 1. Terms & concepts 2. Testing patterns 3.
Naming things 4. Code katas
Unit Tests?
Manual testing is cumbersome
Automated testing is fast
Unit tests for the TYPO3 Core
> 4400 tests
< 14 seconds
Verify that your code does what you expect
Make sure that your changes won‘t break anything
Keep others from breaking your code
Don’t break anything even in complex projects
Create a safety net for refactoring or for TYPO3 updates
Improve the structure of your code
Green feels good!
https://github.com/oliverklee/tdd-reader /Exercises/tdd-exercises-en.md
Let’s get some terms straight
The two programming modes clean hacky
Testsuite Testcase Test Assertion Test Test Testcase
The life cycle of a test new FooTest(); setUp(); /**
@test */ lifeIsGood(); tearDown();
4 test phases set up setUp() code in the test
method exercise method call verify assert…() tear down tearDown()
Code test-first write test write code refactor
Workshop roadmap 1. Terms & concepts 2. Testing patterns 3.
Naming things 4. Code katas
Workshop roadmap 1. Terms & concepts 2. Testing patterns 3.
Naming things 4. Code katas
None
https://github.com/oliverklee/tdd-reader /Exercises/tdd-exercises-en.md
Test levels http://filipdefar.com/2015/06/tested-be-thy-name.html
Unit tests are small and fast
Integration tests test how components work together in TYPO3: „functional
tests“
Systemtests test the big picture
Test types
Blackbox tests test the public API
Whitebox tests inner workings test the
Functional tests
Acceptance tests Selenium Codeception
Anti- zombie tests-
Regression tests
Smoke tests
Smoke tests
Story tests for Behavior-driven development (BDD) Behat Codeception
Workshop roadmap 1. Terms & concepts 2. Testing patterns 3.
Naming things 4. Code katas
Workshop roadmap 1. Terms & concepts 2. Testing patterns 3.
Naming things 4. Code katas
Naming Tests
Use meaningful test names classCanBeInstantiated setTitleSetsTitle setSizeWithZeroThrowsException hasTitleForEmptyTitleReturnsFalse Name the
behavior. Name the preconditions. Name the method. Don’t use “works” or “works correctly”. measureFrubbleWorksCorrectly
None
Workshop roadmap 1. Terms & concepts 2. Testing patterns 3.
Naming things 4. Code katas
Workshop roadmap 1. Terms & concepts 2. Testing patterns 3.
Naming things 4. Code katas
None