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
TDD für Senior-Devs
Search
Oliver Klee
May 30, 2023
Programming
0
62
TDD für Senior-Devs
Oliver Klee
May 30, 2023
Tweet
Share
More Decks by Oliver Klee
See All by Oliver Klee
Content-Synchronisierung
oliverklee
0
16
Gewaltfreie Kommunikation: ein Crashkurs
oliverklee
0
53
Motivationspsychologie und Gamification in Non-Profit-Organisationen
oliverklee
0
82
Test-driven development with PHPUnit
oliverklee
0
170
Writing PHPUnit tests for TYPO3 extensions
oliverklee
0
140
Software quality for TYPO3 projects: A story of cheese, games and tools
oliverklee
0
210
Gamification für Arbeit in Communities
oliverklee
0
110
Software quality, cheese and games
oliverklee
0
290
Test-driven development with PHPUnit
oliverklee
0
270
Other Decks in Programming
See All in Programming
エンターテイメント業界で利用されるAWS
demuyan
0
200
Front-end application development, Symfony-style(s)
dunglas
2
1.9k
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
1.1k
コードレビューで学ぶ!Kotlinオブジェクト指向デザインパターン
akkie76
2
170
今、知っておきたい! 生成AIエージェントの世界
elith
3
340
チーム力を高めるスクラム実践法:カンバン公開と課題攻略について - ニフティのスクラムトーク Vol. 2 - NIFTY Tech Talk #18
niftycorp
PRO
1
110
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
850
元気予報
suu_mire0726
0
850
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
220
ゆるい個人開発のススメ
kuroppe1819
10
930
Semantic search with Django and pgvector
pauloxnet
0
230
Build with AI 2024 Seoul - 제로부터 시작하는 Flutter with Gemini 생활 - 박제창
itsmedreamwalker
0
200
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.5k
How to name files
jennybc
64
92k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
13
1.5k
Statistics for Hackers
jakevdp
789
220k
Why Our Code Smells
bkeepers
PRO
331
56k
What the flash - Photography Introduction
edds
64
11k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
226
16k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
Build The Right Thing And Hit Your Dates
maggiecrowley
23
2k
Clear Off the Table
cherdarchuk
82
310k
Faster Mobile Websites
deanohume
296
30k
Writing Fast Ruby
sferik
619
60k
Transcript
Test-driven- Development für Senior-Devs Oliver Klee, 2023-xx @
[email protected]
|
[email protected]
Unit- Tests?
Automatisierte Tests sind schnell
Sicher sein, dass der Code das Richtige tut
Verhindern, dass deine Änderungen etwas anderes kaputt machen
Verhindern, dass andere Leute deinen Code kaputtmachen
Auch bei komplexen Projekten nichts kaputt machen
Baue ein Sicherheitsnetz fürs Refactoring oder für TYPO3-Updates
Verbessere die Struktur des Codes
Finde die Ursache von Bugs
Grün fühlt sich gut an!
Lasst uns ein paar Begriffe klarstellen
Die zwei Programmier-Modi sauber hacky
4 Test-Phasen Setup (aufbauen) setUp() Code in der Testmethode Exercise
(ausführen) Methodenaufruf Verify (prüfen) assert…() Teardown (abbauen) tearDown()
Schreibe zuerst den Test Test schreiben Code schreiben refactoren
Wozu führt TDD? höhere Coverage minimaler Code erst denken,
dann coden Tests testen, was der Code machen soll (statt, was er tatsächlich tut) fokussiertes Coden sauberere Code-Struktur
Test- Namen
Benutze aussagekräftige Test-Namen classCanBeInstantiated setTitleSetsTitle setSizeWithZeroThrowsException hasTitleForEmptyTitleReturnsFalse Benenne das Verhalten.
Nenne die Vorbedingungen. Nenne die Methode. Benutze nicht „works“ oder „correctly“. measureFrubbleWorksCorrectly