Slide 1

Slide 1 text

Software richtig testen Ganz praktisch! Rainer Hahnekamp 6. März 2025

Slide 2

Slide 2 text

About Me... https://www.youtube.com/ @RainerHahnekamp https://www.ng-news.com https://github.com/softarc-consulting/sheriff ● Rainer Hahnekamp ANGULARarchitects.io NgRx Team (Trusted Collaborator) ● Developer / Trainer / Speaker @RainerHahnekamp Workshops NgRx • Testing • Spring • Quality

Slide 3

Slide 3 text

RainerHahnekamp Agenda 1. Testing Types 2. Testing Strategies 3. Live Coding

Slide 4

Slide 4 text

RainerHahnekamp Testing Types

Slide 5

Slide 5 text

RainerHahnekamp Testing Terms are not specified

Slide 6

Slide 6 text

Unit Tests Integration & Component Tests End-to-End (E2E) Tests

Slide 7

Slide 7 text

Component Service Service Service Directive Service Component Pipe Service Unit Test

Slide 8

Slide 8 text

Component Service Service Service Directive Service Component Pipe Service ~ Component Test

Slide 9

Slide 9 text

Component Service Service Service Directive Service Component Pipe Service Integration Test

Slide 10

Slide 10 text

E2E Test

Slide 11

Slide 11 text

RainerHahnekamp Testing Strategies

Slide 12

Slide 12 text

RainerHahnekamp Pros & Cons Unit Tests ✅ Fast ✅ Exploratory ✅ Bug easy to find ✅ Encore good Design ⛔ No Refactoring ⛔ High Maintainability ⛔ Low Coverage ⛔ Low Confidence Integration Tests ✅ High Coverage ✅ Support Refactoring ✅ Lower Maintenance ✅ High Confidence ⛔ Difficult Setup ⛔ Slower than Unit Tests End-to-End ✅ Great DX ✅ Highest ROI ✅ Real Environment ✅ No Technical Challenges ● CD, Async, DOM Events ⛔ Very Slow ⛔ High Coupling ⛔ Full E2E not always possible

Slide 13

Slide 13 text

The Right Balance "Fingerspitzengefühl"

Slide 14

Slide 14 text

RainerHahnekamp Is TDD possible?

Slide 15

Slide 15 text

Spotify - Honeycomb Kent Dodds' Trophy

Slide 16

Slide 16 text

RainerHahnekamp Jeremy Elbourn: Angular Lead Angular Q&A Session September 2024 As close to the real-world as practical. Services as Dependencies - Don't replace them - Try to come up with a fake - Last resort: Use a Mock

Slide 17

Slide 17 text

Coding Time