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
Oliver Klee
October 13, 2024
Programming
0
38
Testing von TYPO3-Extensions
Oliver Klee
October 13, 2024
Tweet
Share
More Decks by Oliver Klee
See All by Oliver Klee
Team-Management-Plattform
oliverklee
0
40
Vertrauen in Teams & Führung
oliverklee
0
190
Software-Qualität von TYPO3-Extensions automatisieren
oliverklee
0
19
Vertrauen in Teams & Führung
oliverklee
0
120
Software-Qualität von Extensions automatisieren
oliverklee
1
28
Content-Synchronisierung
oliverklee
0
120
Gewaltfreie Kommunikation: ein Crashkurs
oliverklee
0
260
Motivationspsychologie und Gamification in Non-Profit-Organisationen
oliverklee
0
160
Test-driven development with PHPUnit
oliverklee
0
250
Other Decks in Programming
See All in Programming
Using AI Tools Around Software Development
inouehi
0
700
ワンバイナリWebサービスのススメ
mackee
10
7.6k
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
0
210
iOSアプリ開発もLLMで自動運転する
hiragram
6
2.3k
Interface vs Types ~型推論が過多推論~
hirokiomote
1
240
TypeScript LSP の今までとこれから
quramy
1
440
カクヨムAndroidアプリのリブート
numeroanddev
0
260
人には人それぞれのサービス層がある
shimabox
3
630
ドメインモデリングにおける抽象の役割、tagless-finalによるDSL構築、そして型安全な最適化
knih
3
700
統一感のある Go コードを生成 AI の力で手にいれる
otakakot
0
840
AIエージェントによるテストフレームワーク Arbigent
takahirom
0
350
20250528 AWS Startupイベント登壇資料:AIコーディングの取り組み
procrustes5
0
140
Featured
See All Featured
Practical Orchestrator
shlominoach
188
11k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.6k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Done Done
chrislema
184
16k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
YesSQL, Process and Tooling at Scale
rocio
172
14k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
42
2.4k
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