brutal refactoring game @hamburg 2012 11 28
TRANSCRIPT
TodayTake a simple problemUse pair-programming
Language agnosticWrite code
Add functionality only when the code is clean
Refactor oftenRefactor a lot
www.mozaicworks.com
Code smell
A code smell is a hint that shows you might have a problem in your
system. '
www.mozaicworks.com
Code smell
SniffableEasy to spot
Does not always indicate a problem
www.mozaicworks.com
Refactoring
Changing a software system without changing the behavior of
the code and improving its internal structure
www.mozaicworks.com
Refactoring
Is NOT:
Re-engineeringRe-designRe-writing
www.mozaicworks.com
Problem
Tic-Tac-Toe
Board 3x3X plays first
0 plays secondResult: winner or draw
www.mozaicworks.com
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
Contact us
Unit testing workshopRemote pair-programming
TDD workshopRefactoring workshop
Legacy code workshopLegacy code retreat
Code retreat
@adibolb
www.mozaicworks.com
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