To become really good at anything takes a lot of practice. Apprenticeships and formal mentoring, common in medieval times, are rare today. To create quality code we need solid practices like Test Driven Development and Pair Programming or Mobbing. In this software craftsmanship workshop attendees practiced those skills on in a code kata.
8. • Programmers restructure system by improving the design of exis8ng code
without changing its behavior
– to remove duplica8on, improve communica8on, simplify, or add flexibility
• Refactoring is not random change, instead it’s driven by learning from our
tests and from iden8fying and fixing code smells
• DRY (Don’t Repeat Yourself)
• Refactoring can occur just prior or just a/er wri8ng new code
• Test, code, refactor, re-test
– Very short cycles – refactor in baby steps
Refactoring
When fixing bugs, write a Red test, BEFORE fixing the bug. Test will run Green when bug fixed.
When working with legacy code make sure to write automated tests BEFORE refactoring code,
If tests didn’t exist.
cbell@CamilleBellConsul$ng.com 8
10. Mob Programming
• Whole team works together
• On the same thing
• At the same 8me
• In the same space
• Using the same computer
• Driver rotates
• Everyone par8cipates
• Great for training & prac8ce
• Great for collabora8on
• Everyone up to speed faster
• Some teams mob always, others frequently
• Features delivered faster – single piece flow /wo handoffs
cbell@CamilleBellConsul$ng.com 10
1