Bassam Ismail Engineering Manager at Axelerant
π skippednote
Slide 6
Slide 7
dd.skippednote.dev
Slide 8
Why should we test our code?
Slide 9
οΏ½οΏ½
Slide 10
To catch π before our users can
Slide 11
Makes refactoring possible
Slide 12
Helps write cleaner code
Slide 13
Acts as executable documentation
Slide 14
Because all of us arenβt a 10x engineer
Slide 15
What should we test in our code?
Slide 16
Slide 17
Slide 18
Slide 19
Slide 20
Manual Tests
Automated Test
Slide 21
π§ π§ββ
Slide 22
π°π° π°
π°
π’
π
Slide 23
Jargon π
Slide 24
Test
Slide 25
Slide 26
Test Suite
Slide 27
Slide 28
Dummy / Fake
Slide 29
Slide 30
Mocks
Slide 31
Slide 32
Slide 33
π°π° π°
π°
π’
π
Slide 34
Static Code Analysis
Slide 35
Slide 36
Slide 37
Static Code Analysis β easy to achieve 100% coverage β runs automatically in your IDE/Editor β helps reduce language grammar and syntax error
Slide 38
Type Checking
Slide 39
Slide 40
Slide 41
Type Checking β helps prevent JavaScript gotchas β provides great tooling and IDE support β static code analysis beyond ESLint/TSLint
Slide 42
Unit Testing
Slide 43
RED
Refactor*
Green
Slide 44
Unit Testing β lets us test in isolation β easy to write and fast to run β helps improve code design
Slide 45
π‘ use test specific attributes for querying
Slide 46
Slide 47
π‘ use regex when querying text
Slide 48
Slide 49
Snapshot Testing
Slide 50
Slide 51
Snapshot Testing β easy to write and run β warn against markup changes β help capture current state of our application β prevent UI bugs*
Slide 52
Integration Testing
Slide 53
2 Unit 0 Integration
Slide 54
Slide 55
Slide 56
Integration Testing β Same benefits as Unit Testing β comparatively easy to write fast to run β helps improve code design β Helps test components together β Faster than E2E
Slide 57
E2E Testing
Slide 58
οΏ½οΏ½ οΏ½οΏ½ οΏ½οΏ½ οΏ½οΏ½
Slide 59
Slide 60
E2E Testing β Tests like a real user β Exposes browser inconsistencies β Covers the whole application stack β Slower than integration, however, no mock
Slide 61
π‘ extract repeating step to commands
Slide 62
Slide 63
a11y Testing
Slide 64
Slide 65
Slide 66
a11y Testing β makes application accessible β meet legal implications π β write good and semantic HTML code β become a better human being