![Page 3: Brutal Refactoring Game @XP Vienna 2013 06 05](https://reader033.vdocuments.site/reader033/viewer/2022052410/554fb479b4c905ad218b5468/html5/thumbnails/3.jpg)
TodayTake a simple problemUse pair-programming
Language agnosticWrite code
Add functionality only when the code is clean
Refactor oftenRefactor a lot
www.mozaicworks.com
![Page 4: Brutal Refactoring Game @XP Vienna 2013 06 05](https://reader033.vdocuments.site/reader033/viewer/2022052410/554fb479b4c905ad218b5468/html5/thumbnails/4.jpg)
Code smell
A code smell is a hint that shows you might have a problem in your
system. '
www.mozaicworks.com
![Page 5: Brutal Refactoring Game @XP Vienna 2013 06 05](https://reader033.vdocuments.site/reader033/viewer/2022052410/554fb479b4c905ad218b5468/html5/thumbnails/5.jpg)
Code smell
SniffableEasy to spot
Does not always indicate a problem
www.mozaicworks.com
![Page 6: Brutal Refactoring Game @XP Vienna 2013 06 05](https://reader033.vdocuments.site/reader033/viewer/2022052410/554fb479b4c905ad218b5468/html5/thumbnails/6.jpg)
Refactoring
Changing a software system without changing the behavior of
the code and improving its internal structure
www.mozaicworks.com
![Page 7: Brutal Refactoring Game @XP Vienna 2013 06 05](https://reader033.vdocuments.site/reader033/viewer/2022052410/554fb479b4c905ad218b5468/html5/thumbnails/7.jpg)
Refactoring
Is NOT:
Re-engineeringRe-designRe-writing
www.mozaicworks.com
![Page 8: Brutal Refactoring Game @XP Vienna 2013 06 05](https://reader033.vdocuments.site/reader033/viewer/2022052410/554fb479b4c905ad218b5468/html5/thumbnails/8.jpg)
Problem
Tic-Tac-Toe
Board 3x3X plays first
0 plays secondResult: winner or draw
www.mozaicworks.com
![Page 9: Brutal Refactoring Game @XP Vienna 2013 06 05](https://reader033.vdocuments.site/reader033/viewer/2022052410/554fb479b4c905ad218b5468/html5/thumbnails/9.jpg)
Coding smells1) Lack of tests2) Name not from domain3) Name not expressing intent4) Unnecessary if5) Unnecessary else6) Duplication of constant7) Method does more than one thing
8) Primitive obsession
9) Feature envy10) Method too long (> 6 lines)11) Too many parameters (> 3)12) Test – not unitary13) Test – setup too complex14) Test – unclear Act15) Test - more than one assert16) Test – no assert17) Test – too many paths
www.mozaicworks.com
![Page 10: Brutal Refactoring Game @XP Vienna 2013 06 05](https://reader033.vdocuments.site/reader033/viewer/2022052410/554fb479b4c905ad218b5468/html5/thumbnails/10.jpg)
Contact me
Unit testing workshopRemote pair-programming
TDD workshopRefactoring workshop
Legacy code workshopLegacy code retreat
Code retreat
@adibolb
www.mozaicworks.com
![Page 11: Brutal Refactoring Game @XP Vienna 2013 06 05](https://reader033.vdocuments.site/reader033/viewer/2022052410/554fb479b4c905ad218b5468/html5/thumbnails/11.jpg)
Brutal Refactoring Game
http://www.mozaicworks.com [email protected]
@adibolb
Extend your mentoring & training capacity
Accelerate learning through communities of practice
Grow your functional leaders and top talents
www.mozaicworks.com
![Page 12: Brutal Refactoring Game @XP Vienna 2013 06 05](https://reader033.vdocuments.site/reader033/viewer/2022052410/554fb479b4c905ad218b5468/html5/thumbnails/12.jpg)
Read more
http://blog.adrianbolboaca.ro/2013/04/the-history-of-brutal-refactoring-game
www.mozaicworks.com