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
Test-driven development for TYPO3
Search
Oliver Klee
June 21, 2014
Programming
0
150
Test-driven development for TYPO3
Slides of my workshop on T3DD14
Oliver Klee
June 21, 2014
Tweet
Share
More Decks by Oliver Klee
See All by Oliver Klee
Content-Synchronisierung
oliverklee
0
21
Gewaltfreie Kommunikation: ein Crashkurs
oliverklee
0
62
Motivationspsychologie und Gamification in Non-Profit-Organisationen
oliverklee
0
83
Test-driven development with PHPUnit
oliverklee
0
170
Writing PHPUnit tests for TYPO3 extensions
oliverklee
0
150
Software quality for TYPO3 projects: A story of cheese, games and tools
oliverklee
0
220
TDD für Senior-Devs
oliverklee
0
64
Gamification für Arbeit in Communities
oliverklee
0
110
Software quality, cheese and games
oliverklee
0
300
Other Decks in Programming
See All in Programming
try! Swift Tokyo 初参加報告LT
hinakko2
0
220
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
490
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.4k
Tailwind CSSを本気でカスタマイズする方法
fsubal
13
5.3k
Fast JSX: Don't clone props object #28768
yossydev
1
130
使ってみよう Azure AI Document Intelligence
kosmosebi
2
320
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
190
Elm Form Validation
bkuhlmann
0
510
Git Rebase
bkuhlmann
11
1.6k
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
270
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
Anthropic Cookbook のおすすめレシピ
schroneko
7
980
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
73
8.2k
Visualization
eitanlees
136
14k
Happy Clients
brianwarren
92
6.4k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Designing for humans not robots
tammielis
248
25k
Building Effective Engineering Teams - LeadDev
addyosmani
28
1.8k
Done Done
chrislema
178
15k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
187
16k
Automating Front-end Workflow
addyosmani
1356
200k
Web development in the modern age
philhawksworth
202
10k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
[RailsConf 2023] Rails as a piece of cake
palkan
23
4k
Transcript
Test-Driven Development for TYPO3 Oliver Klee, 2014-06-21 @oliklee
[email protected]
Unit tests?
Manual testing is cumbersome
Automated testing is fast
Unit tests for the Realty Manager extension
more than 1600 tests
in less than 60 seconds
Verify that your code does what you expect
Make sure that your changes won‘t break anything
Keep other coders from breaking your code
Don‘t break anything even in complex projects
Create a safety net for refactoring
Improve the structure of the code
Green feels good!
None
Know your tools
The phpunit extension has it all phpunit (TYPO3 extension) PHPUnit
(Composer package) Testrunner (back-end- module) Testrunner (CLI module) Testing framework for FE & DB
Let‘s get some terms straight
Test suite Test case Test Two tests meet in a
bar ... Assertion Test Test Test case
The life cycle of a unit test new FooTest(); setUp();
/** @test */ lifeIsGood(); tearDown();
Code test-first write test write code refactor
None
Use meaningful unit test names classCanBeInstantiated setTitleSetsTitle setSizeWithZeroThrowsException hasTitleForEmptyTitleReturnsFalse Name
the behavior. Name the preconditions. Mention the method. Dont‘t use "works" or "correctly". measureFrubbleWorksCorrectly