technical mentoring, what works and not

33
Technical Mentoring What works and not [email protected] @stanlylau

Upload: stanly-lau

Post on 11-Apr-2017

64 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Technical Mentoring, What works and not

Technical MentoringWhat works and not

[email protected]

@stanlylau

Page 2: Technical Mentoring, What works and not

Lives in Singapore

Software development coach / mentor

Agile Singapore 2013, 2014, 2016

Page 3: Technical Mentoring, What works and not

http://www.marketingfirepower.info/the-minefield-you-didn’t-know-you-were-in

Page 4: Technical Mentoring, What works and not

Code Smells & Refactoring

Page 5: Technical Mentoring, What works and not

Original program:

Making changes:

More changes:

Without refactoring With refactoring

Small change

Refactor

Etc

Page 6: Technical Mentoring, What works and not

Mentoring “A structured self-development method that provides support to help individuals manage their own learning and realize their full potential. It is out of the reporting line, where the experience gap (not the status gap) and the mentee drive the relationship.”

Parsloe, 2000; Clutterbuck, 2004

Page 7: Technical Mentoring, What works and not

Experiments(informal)

Page 8: Technical Mentoring, What works and not

TDD workshop followed by pairing with team members for two weeks

Tried• 70% lectures, 30% exercises• Code exercises from public• Pairing happens randomLearned• Pairing related to code were slim• Assess the current state of automated build• Some people were defensive

Page 9: Technical Mentoring, What works and not

Tried• StringCalculator exercise• 20 people, most are new to TDDLearned• Most have trouble writing test first• Questions of applying on their existing systems• What if we focus only on refactoring first?

Community Mini-Coderetreat

Page 10: Technical Mentoring, What works and not

Refactoring Kata

Page 11: Technical Mentoring, What works and not
Page 12: Technical Mentoring, What works and not

Refactoring KataOutcome• They felt confident changing code• Inspired them to add tests at work• They added and was unmaintainable

Page 13: Technical Mentoring, What works and not

One-on-one MentoringTried• Prepare a few topics• Share with me their reflection/learningsLearned• Don’t know where to start in long method• Draw/Model the classes• Skills often mentioned

Page 14: Technical Mentoring, What works and not

One-on-one MentoringCommon mentioned skills• Hotkeys• Understanding Single Responsibility Principle • Return null vs empty list • Refactor multiple returns to single return• Distance of behavior and data (domain object) • Working with 3rd party webservice API • Name closer to the business language

Page 15: Technical Mentoring, What works and not

Tried• Remove mines on larger minefield• More guidance at the beginning & more questions later on• Ruby on Rails + Travis CI + Heroku + Github• Topics widen to continuous deliveryLearned / Outcome• More than half picked up fast• A few were inspired by the special project• Prod. release takes < 30 minutes instead of a day

2-week Mentoring with Senior Developers

Page 16: Technical Mentoring, What works and not

Four Stages of Competence

https://en.m.wikipedia.org/wiki/Four_stages_of_competence

Page 17: Technical Mentoring, What works and not

• Start with Code Smells & Refactoring Workshop• Code exercises from product’s codebase• Series of progressive one-day workshops• One-on-one sessions between workshops• Hands-on exercises then debrief• Maximum of 8 participants• Two co-leaders, me & another from the company• Platform for growing mentors

Technical Training Program

Page 18: Technical Mentoring, What works and not

Anonymised

Page 19: Technical Mentoring, What works and not

• One week of preparation• More than 10 exercises• Remove code smells always• Context limited to within the method• Repetition + little different• Respectfully intrude and challenge

Refactoring Workshop #1

Page 20: Technical Mentoring, What works and not
Page 21: Technical Mentoring, What works and not
Page 22: Technical Mentoring, What works and not

What aspects of the course were most successful in helping you to learn?

“Use Resharper hotkeys”

“Use real production code to practise”

“Approach towards a problem, especially all those shared examples are very commonly seen code smells.”

Page 23: Technical Mentoring, What works and not

What improvements to the course do you suggest?

“More examples on how to identify code smells such as primitive obsession”

“Sometimes I am lost after the trainer expect me to do the refactoring on the code”

“More sessions"

Page 24: Technical Mentoring, What works and not

• More than one week of preparation• 7 exercises• Context includes callers and call-ees• Lesser repetition• New code smells• Characterisation tests• Simplify code using library e.g. JSONConvert• Model/Draw the classes and interactions

Refactoring Workshop #2

Page 25: Technical Mentoring, What works and not
Page 26: Technical Mentoring, What works and not

What aspects of the course were most successful in helping you to learn?

“Hands on, new library feature introduction”

“Explanation on speculative generality with diagrams”

“Trying out by ourself how to identify and refactor”

Page 27: Technical Mentoring, What works and not

What improvements to the course do you suggest?

“No comment. But look forward for more workshops like this in future.”

“More practice examples to be more familiar in recognizing and tackle the similar code smell.”

“Give some starters before getting our hands dirty. Some of us might not be that creative and might not be able to make full use of the allotted time.”

Page 28: Technical Mentoring, What works and not

Assignments as a Pre-requisite

Tried• Part 1: Review a recent code that was refactored• Part 2: Remove the smells in a refactoring kata• I’ll respond with my thoughts about their codeLearned / Outcome• Excellent way to find out where they are• Opportunity to hear their thoughts

Page 29: Technical Mentoring, What works and not

Assignments as a Pre-requisite

“Actually I knew this code smell in my code but I don’t know any good way to remove this smell, so I hope I can attend workshop #2 to learn more about refactoring.”

Page 30: Technical Mentoring, What works and not

How many workshops does it take to reduce the smells in commits??

Page 31: Technical Mentoring, What works and not

Summary

Page 32: Technical Mentoring, What works and not

What works• Facilitative mentoring for effective learning• Skill to assess where individuals are• Appropriate challenge for progressive learning• A structure to facilitate follow up• Derive exercises from existing codebases• Engage and grow internal mentorsWhat’s not• Workshop/Training alone is insufficient• Weak self-awareness of communication style

Page 33: Technical Mentoring, What works and not

Thank [email protected]