Legacy Code is Fear @Codecamp Iasi 25 10 2014
-
Upload
adi-bolboaca -
Category
Technology
-
view
83 -
download
1
Transcript of Legacy Code is Fear @Codecamp Iasi 25 10 2014
![Page 2: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/2.jpg)
Me
Adi BolboacăProgrammer
Organizational & TechnicalTrainer & Coach www.mozaicworks.com
![Page 3: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/3.jpg)
Legacy code scenario
Current situation vs Better situation
Not knowing what the actual code doesVs
Gradually understanding the code and changing it to the minimum
www.mozaicworks.com
![Page 4: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/4.jpg)
Legacy code scenario
Reasons why to change existing code:
Fix a bugAdd a feature
Have automated tests for the system core
www.mozaicworks.com
![Page 5: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/5.jpg)
Legacy code scenario
Reasons why not to change existing code:
It looks uglyI would like to see nicer code
I want to update to newest framework...
www.mozaicworks.com
![Page 6: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/6.jpg)
Current situation
You need to add some features to an existing old projectwww.mozaicworks.com
![Page 7: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/7.jpg)
Current situation
They tell you that you have a very short time to do it www.mozaicworks.com
![Page 8: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/8.jpg)
Current situation
You are afraid to change the system www.mozaicworks.com
![Page 10: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/10.jpg)
Current situation
And you tell your manager: I cannot do it
www.mozaicworks.com
![Page 13: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/13.jpg)
Current situation
Your company loses money.Your customer loses money.
www.mozaicworks.com
![Page 15: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/15.jpg)
Better situation
Someone signs a contract to add some features to an existing old
project www.mozaicworks.com
![Page 16: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/16.jpg)
Better situation
Your team starts writing characterization tests to understand the change www.mozaicworks.com
![Page 17: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/17.jpg)
Better situation
Your team writes end-to-end tests to understand the external
dependencies
www.mozaicworks.com
![Page 18: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/18.jpg)
Better situation
Your team splits the end-to-end tests into integration tests and
unit tests
www.mozaicworks.com
![Page 19: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/19.jpg)
Better situation
Your team starts adding more unit tests around the area that needs
to be modified
www.mozaicworks.com
![Page 20: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/20.jpg)
Better situation
Every member of the team is using the refactoring skills to improve
the design
www.mozaicworks.com
![Page 21: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/21.jpg)
Better situation
Your team adds the new feature. It is fully test automated.
www.mozaicworks.com
![Page 22: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/22.jpg)
Better situation
Your testers make the final exploratory and manual tests
www.mozaicworks.com
![Page 24: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/24.jpg)
Better situation
Your company wins money and respect from your customer.
Your customer wins money and has trust in you.
www.mozaicworks.com
![Page 25: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/25.jpg)
The problem: Legacy code is fear
Our unknowns are making us afraid
Automating tests minimizes the unknowns
By automating tests we can increase confidence
www.mozaicworks.com
![Page 27: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/27.jpg)
Find the known unknowns of the team
Talk with the team
Find what they do not know: domain knowledge, programming languages, unit testing, acceptance testing, frameworks,
etc
www.mozaicworks.com
![Page 28: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/28.jpg)
Make small scale experiments
Use a smaller problem at first
Learn how to write charaterization tests for that problem
Use coding dojos and mob programming to practice together
www.mozaicworks.com
![Page 29: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/29.jpg)
The littany against fear
I must not fear. Fear is the mind-killer.
Fear is the little-death that brings total obliteration. I will face my fear.
I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to
see its path. Where the fear has gone there will be nothing.... only I
will remain
Dune by Frank Herbertwww.mozaicworks.com
![Page 30: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/30.jpg)
Solve the legacy code fear: invest
Invest in the future business agility of your company
www.mozaicworks.com
![Page 31: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/31.jpg)
Solve the legacy code fear: learn
Find the unknowns of the teamMake a medium-term learning program
Make small scale experimentsLearn
Extend to bigger scale experimentsLearn
Do a small change request in productionLearn
www.mozaicworks.com
![Page 32: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/32.jpg)
What's next?
Read the Working Effectively with Legacy code book by Michael Feathers
Find a good trainer to help the team learn
Build learning program with team&trainer
Learn from each experiencewww.mozaicworks.com
![Page 34: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/34.jpg)
Thank you!
Working Fast and SAFE with Existing Code workshop
Product Inception
Code retreat
www.mozaicworks.com
See the slides at http://www.slideshare.net/adibolb
![Page 35: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/35.jpg)
Extend your mentoring & training capacityAccelerate learning through communities of practiceGrow your functional leaders and top talents
http://www.mozaicworks.com
@adibolb
![Page 36: Legacy Code is Fear @Codecamp Iasi 25 10 2014](https://reader034.fdocuments.us/reader034/viewer/2022042716/55a2bddf1a28ab59268b463e/html5/thumbnails/36.jpg)
References
http://upload.wikimedia.org/wikipedia/commons/7/7f/Snake_warning_sign.jpghttp://upload.wikimedia.org/wikipedia/commons/4/44/CatLolCatExample.jpghttp://upload.wikimedia.org/wikipedia/commons/8/88/I_IZ_SERIUS_ADMNIM_THIZ_IZ_SERIUS_BIZNIS_lolcat.jpghttp://pixabay.com/p-160097/?no_redirecthttp://www.damemagazine.com/sites/default/files/styles/feature_wide/public/field/image/biological-clock.jpg?itok=WSI67yEZhttp://fc01.deviantart.net/fs71/i/2012/149/6/9/no__9gag__by_hujikari-d51hu4l.jpg http://upload.wikimedia.org/wikipedia/commons/1/12/We_Can_Do_It!.jpghttp://upload.wikimedia.org/wikipedia/commons/2/25/Dive_hand_signal_Descend.pnghttp://pixabay.com/go/?t=/static/uploads/photo/2012/04/18/13/01/sign-36968_150.png%3Fattachmenthttp://pixabay.com/static/uploads/photo/2014/06/03/19/38/plate-361516_640.jpg http://upload.wikimedia.org/wikipedia/commons/0/0c/Dive_hand_signal_OK_1.png
www.mozaicworks.com