brutal refactoring game @xp vienna 2013 06 05

13
Brutal Refactoring Game www.mozaicworks.com

Upload: adi-bolboaca

Post on 11-May-2015

437 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Brutal Refactoring Game @XP Vienna 2013 06 05

Brutal Refactoring

Game

www.mozaicworks.com

Page 2: Brutal Refactoring Game @XP Vienna 2013 06 05

Me

Adi Bolboaca: Programmer, Trainer, Coach

www.mozaicworks.com

Page 3: Brutal Refactoring Game @XP Vienna 2013 06 05

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

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

Code smell

SniffableEasy to spot

Does not always indicate a problem

www.mozaicworks.com

Page 6: Brutal Refactoring Game @XP Vienna 2013 06 05

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

Refactoring

Is NOT:

Re-engineeringRe-designRe-writing

www.mozaicworks.com

Page 8: Brutal Refactoring Game @XP Vienna 2013 06 05

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

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

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

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 13: Brutal Refactoring Game @XP Vienna 2013 06 05

Brutal Refactoring Game

Q&A,Beer

& More...

www.mozaicworks.com