Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Nordic Testing Days
9 ways to test your spaghetti code
Mads Opheim @MadsOpheim
1
Tere!
I’m Mads.I’m a developer
2
Spaghetticode?
3
The 9 ways
4
5
1. Test allorTest small
6
2. Set your dependencies
7
Singletons
8
3. Package-protect problematic parts
9
Tools for your toolbox
10
4. Do simple refactorings toget your code under test
11
In general: untangling and looking at one part at a time
12
You’re not as smart as you think you are
13
Well-designed code is testable code
14
15
5. Help your team
You’ll forget things
16
6. Run your tests - and care
17
7. Feature toggles
18
8. One mile at a time
19
Refactor in separate commits
20
9. Test-driven development
21
Test-driven spaghetti
22
TDD on legacy code in practice
23
Tip 10, 11 and onwards
24
25
The Deadline For Kunngjøring Is Four Weeks()
26
Properties For Namsmann Mainly Follow The Same Rules as Hovedstevnevitne()
You’ll do stupid things - and that’s ok
27
Be consistent
28
Give me more@lisacrispin, @lisihocke, @techgirl1908,@maaretp...
29
Key takeaways
30
1. Good code design improves testability2. TDD on spaghetti code: TDD + test
spaghetti code3. Write tests for you legacy code -
you can do it!