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
34
Softwarequalität für öffentliche TYPO3-Extensions
oliverklee
0
86
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
340
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
Del vibe coding a un Desarrollo (agéntico) fiable
jcabot
0
210
2026-11-16 JAWS-UG コンテナ支部 #31 ゆるLT大会 ECR のライフサイクルポリシーを いい感じに設定したい / ECR Lifecycle policy
masasuzu
3
610
Context parameters で作る!はじめての型クラス
kworkdev
PRO
1
180
From vibe coding to reliable (agentic) development
jcabot
0
210
HTTP QUERY時代の型安全な検索APIをKotlinで設計する
sansantech
PRO
1
130
AIエージェントのアーキテクチャ設計
nsatoh
0
490
【Oracle AI SPOTLIGHT ウェビナー】AI時代、狙われるデータと止められない業務をどう守るか?
oracle4engineer
PRO
1
140
Go でトランザクション、どう書いてますか?
knwoop
1
570
「正しいデータ」の定義をAI エージェントとつくるGoogleADKによるデータ品質定義の実践
takaha4k
0
120
共通基盤の実装に Kotlin - Quarkus を選定した理由と採用したアーキテクチャ
nealle
1
160
文書画像からの情報抽出を行うエージェントを、軌跡の正解データ無しで作れるか
sansantech
PRO
2
230
AWS Well-Arhitected Frameworkセキュリティの柱 について
miu_crescent
PRO
2
230
Featured
See All Featured
KATA
mclloyd
PRO
35
16k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Automating Front-end Workflow
addyosmani
1370
210k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
540
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
310
How to make the Groovebox
asonas
2
2.6k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Navigating Team Friction
lara
192
16k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.3k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
4
1.3k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k