![Page 1: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/1.jpg)
An Agile Approach to Technical Debt
Is The Only Way
Jakub Holý @ iterate no
![Page 2: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/2.jpg)
Origins
![Page 3: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/3.jpg)
by Jon Baldock nz @ flickr
We've all been there - mess of code
![Page 4: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/4.jpg)
by Ignaz Wiradi @ wikimedia
What we would like to have- clean, structured, fitting
![Page 5: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/5.jpg)
by cotallo-nonocot @ flickr
What we do have. It (likely) started with st. small & clean but requirements evolved while the design of the code did not - only hacked & patched
![Page 6: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/6.jpg)
God class
● 15 kLOC● 300 properties● 320 methods● 50 constants● used everywhere
by mandalinarossa @ flickr
Example of legacy - a typical monstrous god class that we were confronted with.
![Page 7: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/7.jpg)
The pain!
It was pain!
![Page 8: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/8.jpg)
True cost of legacy
Pain <= Time wasted in code archeology, money & time wasted due to bugs being introduced.Legacy code matters to business for real money are wasted there.
![Page 9: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/9.jpg)
Escape???
![Page 10: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/10.jpg)
Refactor!
The only way out is to improve the design
![Page 11: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/11.jpg)
?
How do we get from L to R? The sad answer is we don't.It took centuries to build R. We can never get from L to R in a reasonable time. There is too much mess, too much to fix.
![Page 12: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/12.jpg)
Code Churn
Michael Feathers: Getting Empirical about Refactoring
Code-churn driven refactoring: improve where it matters & pays off most - complex & changed often
![Page 13: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/13.jpg)
=> Boy Scout Refactoring
● Only task-related● Time-boxed● Always● (+ TDD)
Refactoring can go on forever => focus, time-box. Task related => in code that matters most now/in near future. (We: 1/3 every task devoted to refactoring.)
![Page 14: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/14.jpg)
Refactoring: Improving the Design of Existing CodeMartin Fowler
Working Effectively with Legacy CodeMichael Feathers
Behead Your Legacy Beast: The Mikado MethodD. Brolund, O. Ellnestam
![Page 15: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/15.jpg)
It worked!
![Page 16: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/16.jpg)
Required:
Management endorsement
![Page 17: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/17.jpg)
True cost of legacy
Show to your management; Legacy code = lot of money lost.
![Page 18: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/18.jpg)
Challenge
Large-scale refactorings● risky => avoid● sometimes necessary● boy scout rule doesn't help
![Page 19: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/19.jpg)
Summary
● Design needs love● Continuous, focused, time-boxed refactoring● True cost of legacy
![Page 20: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/20.jpg)
You too can do it!
![Page 21: Dissolving Technical Debt on Agile Projects - Smidig 2012](https://reader033.vdocuments.us/reader033/viewer/2022060109/5557ad70d8b42a4a5d8b4f1d/html5/thumbnails/21.jpg)
TeachLearnUnify
ObserveEvaluateAdjust
改善
Recommended
Retrospectives: Group code reviews:
Something that worked great for us