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
72
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
40
Gewaltfreie Kommunikation: ein Crashkurs
oliverklee
0
130
Motivationspsychologie und Gamification in Non-Profit-Organisationen
oliverklee
0
94
Test-driven development with PHPUnit
oliverklee
0
190
Writing PHPUnit tests for TYPO3 extensions
oliverklee
0
180
Software quality for TYPO3 projects: A story of cheese, games and tools
oliverklee
0
260
Gamification für Arbeit in Communities
oliverklee
0
110
Software quality, cheese and games
oliverklee
0
340
Test-driven development with PHPUnit
oliverklee
0
300
Other Decks in Programming
See All in Programming
20240706_CDKConf
takuyay0ne
0
1.2k
小さな開発会社を作った理由
polidog
0
1.9k
HMSコンペ 11th Solution (team : kansai-kaggler)
t88
1
680
実用的かつリーズナブルな 「Azure × Gemini × LINE」~キャラクターBot 実装ライブデモ~
tomodo_ysys
1
170
入社1ヶ月でここまでやった!Findy Toolsインフラ支援の最適化
rvirus0817
6
1.4k
日付と正規化
megmogmog1965
0
140
Webエディタライブラリ 「CodeMirror」から学ぶ Webアプリ開発のテクニック
ryosukeigarashi
0
250
コード生成を伴うLLMエージェント - 2024.07.18 Tokyo AI
smiyawaki0820
11
4.1k
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Berlin
prof18
0
110
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
1.9k
AWS CDKにおける「再利用性」を考える / aws-cdk-reusability
gotok365
6
1.3k
12年前の『型システム入門』翻訳の思い出話
mame
11
1.2k
Featured
See All Featured
Embracing the Ebb and Flow
colly
81
4.3k
Build your cross-platform service in a week with App Engine
jlugia
227
17k
The Mythical Team-Month
searls
217
43k
How GitHub (no longer) Works
holman
305
140k
Code Reviewing Like a Champion
maltzj
517
39k
The Pragmatic Product Professional
lauravandoore
29
6.1k
Scaling GitHub
holman
458
140k
Documentation Writing (for coders)
carmenintech
63
4.2k
Building Effective Engineering Teams - LeadDev
addyosmani
47
2.2k
Writing Fast Ruby
sferik
623
60k
GraphQLの誤解/rethinking-graphql
sonatard
59
9.6k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
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