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
Test-driven development with PHPUnit
Search
Oliver Klee
June 23, 2018
Technology
1.4k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Test-driven development with PHPUnit
Oliver Klee
June 23, 2018
Transcript
53 slides
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
More Decks by Oliver Klee
See All by Oliver Klee
Testing von TYPO3-Extensions
oliverklee
0
38
Softwarequalität für öffentliche TYPO3-Extensions
oliverklee
0
88
Psychologische Sicherheit
oliverklee
0
53
Generative KI, Ethik und Nachhaltigkeit
oliverklee
0
300
Gewaltfreie Kommunikation: ein Crashkurs
oliverklee
0
160
Team-Management-Plattform
oliverklee
0
110
Vertrauen in Teams & Führung
oliverklee
0
350
Software-Qualität von TYPO3-Extensions automatisieren
oliverklee
0
73
Vertrauen in Teams & Führung
oliverklee
0
200
Other Decks in Technology
See All in Technology
New Relicのアラート対応をClaude Codeで自動修正するワークフローを作った話
manabuseki
3
740
猫でもわかるKiro初心者編(2026年11月版)
kentapapa
1
110
NutanixへのSSHアクセスの今後について
shadowhat
0
190
設計手法を「道具」として使いこなすために
a_suenami
7
1.8k
AI-DLCでソフトウェア開発の速さは 上がったのか?
rfdnxbro
0
180
SBOM 生成ツールで 2026 Minimum Elements はどこまで満たせるのか
gokken
0
180
Taking back control of your AI development
inesmontani
PRO
0
320
本の挿絵に困ったから挿絵メーカーを自作した
yoshimura_datam
1
120
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
5
18k
OpenTelemetryで変わった 新時代のCloudWatchメトリクス監視
tsukuboshi
0
510
一口馬主の募集馬をAIで診断してみた
yoshimura_datam
0
110
VTuberになってみた話
yoshimura_datam
0
120
Featured
See All Featured
Crafting Experiences
bethany
1
460
Optimising Largest Contentful Paint
csswizardry
37
4k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
680
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
540
Digital Ethics as a Driver of Design Innovation
axbom
PRO
2
570
WENDY [Excerpt]
tessaabrams
15
41k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
340
Highjacked: Video Game Concept Design
rkendrick25
PRO
2
600
Un-Boring Meetings
codingconduct
0
510
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
850
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
570