From Nordic Testing Days 2019
Nordic Testing Days9 ways to test yourspaghetti codeMads Opheim@MadsOpheim1
View Slide
Tere!I’m Mads.I’m a developer2
Spaghetticode?3
The 9 ways4
51. Test allorTest small
62. Set yourdependencies
7
Singletons8
3. Package-protectproblematic parts9
Tools for your toolbox10
4. Do simple refactorings toget your code under test11
In general: untanglingand looking at one part at atime12
You’re not as smartas you think you are13
Well-designed codeis testable code14
155. Help your team
You’ll forget things16
6. Run your tests - and care17
7. Feature toggles18
8. One mile at a time19
Refactor in separatecommits20
9. Test-drivendevelopment21
Test-drivenspaghetti22
TDD on legacy codein practice23
Tip 10, 11 and onwards24
25The Deadline For KunngjøringIs Four Weeks()
26Properties For NamsmannMainly Follow The SameRules as Hovedstevnevitne()
You’ll do stupid things -and that’s ok27
Be consistent28
Give memore@lisacrispin,@lisihocke,@techgirl1908,@maaretp...29
Key takeaways301. Good code design improves testability2. TDD on spaghetti code: TDD + testspaghetti code3. Write tests for you legacy code -you can do it!
Thank you!@MadsOpheim[email protected]31