Devoxx Ukraine9 ways to test yourspaghetti codeMads Opheim@MadsOpheim
View Slide
Goal of this talk:You’ll be inspired andenabled to test yourlegacy code2
What isspaghetticode?3
Precondition:You are creativeThe computer is not4
1. Extract interface5
6
72. Set yourdependencies
8
Singletons9
3. Package-protectproblematic parts10
11
4. Consider removing final12
Well-designed code istestable code13
145. Help your team
6. Run your tests - and care15
7. Feature toggles16
8. One class !=one test class17
9. Test-drivendevelopment18
Test-drivenspaghetti19
Give memore@lisacrispin, @lisihocke,@techgirl1908...20
Key takeaways211. Good code design improves testability2. Short-term sacrifices are ok3. Write tests for you legacy code -you can do it!
спасибі!22@MadsOpheim[email protected]