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
Testing von TYPO3-Extensions
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Oliver Klee
October 13, 2024
Programming
0
86
Testing von TYPO3-Extensions
Oliver Klee
October 13, 2024
Tweet
Share
More Decks by Oliver Klee
See All by Oliver Klee
Gewaltfreie Kommunikation: ein Crashkurs
oliverklee
0
88
Team-Management-Plattform
oliverklee
0
72
Vertrauen in Teams & Führung
oliverklee
0
260
Software-Qualität von TYPO3-Extensions automatisieren
oliverklee
0
44
Vertrauen in Teams & Führung
oliverklee
0
160
Software-Qualität von Extensions automatisieren
oliverklee
1
55
Content-Synchronisierung
oliverklee
0
170
Gewaltfreie Kommunikation: ein Crashkurs
oliverklee
0
330
Motivationspsychologie und Gamification in Non-Profit-Organisationen
oliverklee
0
200
Other Decks in Programming
See All in Programming
dchart: charts from deck markup
ajstarks
3
990
CSC307 Lecture 03
javiergs
PRO
1
490
組織で育むオブザーバビリティ
ryota_hnk
0
180
並行開発のためのコードレビュー
miyukiw
0
180
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
100
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
240
CSC307 Lecture 04
javiergs
PRO
0
660
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
200
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
SourceGeneratorのススメ
htkym
0
200
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
4 Signs Your Business is Dying
shpigford
187
22k
The Cult of Friendly URLs
andyhume
79
6.8k
Git: the NoSQL Database
bkeepers
PRO
432
66k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Crafting Experiences
bethany
1
49
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Designing for Performance
lara
610
70k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
340
Done Done
chrislema
186
16k
Transcript
Testing von TYPO3-Extension Oliver Klee, 2024-10 @
[email protected]
|
[email protected]
Über mich Oliver „Oli“ Klee #bonn #workshop-teacher (seit 1999) #extension-dev
(seit 2005) #unit-testing-guy (seit 2008) #phpstan-guy #best-practices-team #game-cooking #metal
Workshops mit mir Extension-Entwicklung Test-driven-Development TYPO3-Extensions testen QA-Automatisierung Git &
Composer Refactoring
Unit- Tests?
Manuelles Testen ist mühsam
Automatisierte Tests sind schnell
Tests für den TYPO3-Core
Unit-Tests 406 (144) Tests/s
Functional-Tests 8,13 (1,97) Tests/s
Acceptance-Tests 0,009 (0,003) Tests/s
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
Testsuite Testcase Test Assertion Test Test Testcase
Lebenszyklus eines Tests new FooTest(); setUp(); /** @test */ lifeIsGood();
tearDown();
4 Test-Phasen Setup (aufbauen) setUp() Code in der Testmethode Exercise
(ausführen) Methodenaufruf Verify (prüfen) assert…() Teardown (abbauen) tearDown()
Test-driven-Development Test schreiben Code schreiben refactoren
Auswirkungen von TDD höhere Testabdeckung minimaler Code erst denken,
dann coden Tests testen, was der Code tun soll (anstatt, was er tut) fokussierter coden sauberere Code-Struktur
Test-Level http:// fi lipdefar.com/2015/06/tested-be-thy-name.html
Unit-Tests sind klein und schnell
Integrationstests testen das Zusammenspiel von Komponenten in TYPO3: „Functional
Tests“
Systemtests testen das große Ganze
Test-Typen
Blackbox-Tests testen das nach außen Sichtbare
Whitebox-Tests wie genau es innen funktioniert testen,
Akzeptanztests Selenium Codeception
Anti- Zombie- Tests-
Regressionstests
Smoketests
Smoketests
Story-Tests für Behavior-Driven Developmen t (BDD) Behat Codeception
Die Test-Pyramide Unit Functional/ Integration Acceptance System Photo by Eugene
Tkachenko on Unsplash: https://unsplash.com/photos/TF47p5PHW18
Tests benennen
Benutze aussagekräftige Test-Namen classCanBeInstantiated setTitleSetsTitle setSizeWithZeroThrowsException hasTitleForEmptyTitleReturnsFalse Benenne das Verhalten.
Nenne die Vorbedingungen. Nenne die Methode. Benutze nicht „works“ oder „correctly“. measureFrubbleWorksCorrectly