Professional Documents
Culture Documents
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Samman Technical Coaching . . . . . . . . . . . . . . . . . . . iii
Why would an organization engage in Samman Technical
Coaching? . . . . . . . . . . . . . . . . . . . . . . . . . iv
Why would you choose to coach using the Samman method? v
Elevator pitch for Samman Technical Coaching . . . . . . . vi
What is in this book . . . . . . . . . . . . . . . . . . . . . . . . vii
How this book relates to my other books . . . . . . . . . . . viii
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . ix
Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . 35
Retrospectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Ask for Observations . . . . . . . . . . . . . . . . . . . . . . . 36
“Liked, Learned, Lacked” Observations . . . . . . . . . . . . . 37
Turn up the good . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Your private retrospective . . . . . . . . . . . . . . . . . . . . . 38
Retrospective skills are essential . . . . . . . . . . . . . . . . . 38
Remote Ensembles . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Seeing people’s faces . . . . . . . . . . . . . . . . . . . . . . . . 40
Be considerate and time your comments . . . . . . . . . . . . 41
Take breaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Make it quick to change typist . . . . . . . . . . . . . . . . . . 41
Typist lag is deadly . . . . . . . . . . . . . . . . . . . . . . . . . 42
Design discussions . . . . . . . . . . . . . . . . . . . . . . . . . 42
Retrospectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Learning Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Small steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Refactoring safely . . . . . . . . . . . . . . . . . . . . . . . . . 94
Legacy Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Testable Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Designing Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Behaviour-Driven Development . . . . . . . . . . . . . . . . . 96
Agile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Add your own ideas . . . . . . . . . . . . . . . . . . . . . . . . 97
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Working incrementally in small steps . . . . . . . . . . . . . 145
Refactoring safely . . . . . . . . . . . . . . . . . . . . . . . . . 145
Legacy Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Testable Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Designing Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Behaviour-Driven Development . . . . . . . . . . . . . . . . . 146
Teaching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Other . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Image attributions . . . . . . . . . . . . . . . . . . . . . . . . . 147
Foreword
Software development is best seen as a learning process where
running programs are the proof of learning, rather than a factory or
production process. That’s the first idea I found in Samman.
Learning works best together. Learning necessarily reaches beyond
the familiar. Fear of the unfamiliar slows & delays learning. Walking
a new path together along with an experienced guide reduces time
spent not learning because of fear. That’s the second idea I found in
Samman.
Learning is best experienced episodically. If you’re always stirring up
the pond, you never see the gold at the bottom. Learn a while. Digest
a while. Learn a while. That’s the third idea I found in Samman.
I first remember Ms. Bache from the XP 2002 conference in Alghero,
Sardinia. She asserted that unit tests wouldn’t help for the software
she was writing, then patiently waited while we fussed and argued.
Turns out she was right—there are programs where unit tests don’t
provide a double check of the behavior of the system.
In the 2 decades since, Ms. Bache has been working and communicat-
ing, continuing the program she started back then. Part of the project
is helping geeky teams learn and apply their learnings. Part of the
project is learning herself.
If you are haunted by the feeling that you and your team could be
doing so much more (wait, that’s my typical negative framing, let’s
try that again) if you are energized by dreams of working better
(that’s better), Samman is worth a try. Small cost, low risk, high
potential payoff. If, like me, you find you greatest satisfaction in
helping others reach their potential (“coach” is such a shallow word
for this experience), Samman is a set of mutually-supporting ideas to
make you more effective. I can’t wait to try it.
Kent Beck, December 2020
Introduction
There are 5000 lines of code in the file of code that appears on the
screen in front of you. One of the team members, Lars, explains he
has had several bug reports connected to a few of the private functions
defined here. Lars would like there to be some unit tests for this
code. Time to roll up your sleeves and get stuck in! You spend a few
minutes discussing possible approaches with the team and decide to
try a technique they haven’t used before. The ensemble gets rolling
with you initially in the navigation role. A couple of sessions later
everyone is taking their turn and the code is starting to be covered
by tests. Lars comments he likes the feeling of freedom to change the
design and get quick feedback in the form of passing or failing tests.
It should be easier to find and fix bugs in this code now.
At the same time you are also working with a second team. Their
task is to write a completely new piece of functionality. Patrik, (a
team member), has done some experiments, sketched out an overall
approach, but he hasn’t written much code or any unit tests yet.
People in this team don’t normally use tests to help drive their design
and they are curious to try it. You facilitate a whiteboard discussion
to create a rough test list and articulate an initial goal. You set up
the ensemble timer and ask Patrik to become the navigator and begin
writing the first test. With some prompting from you, he makes a good
start. When the timer pings he hands over to another team member.
A couple of rotations later everyone can see the test both compile and
fail. Success! The first step of TDD is complete. Making the test pass
turns out to be straightforward, so the next navigator soon moves
on to write the next test. Over the course of a few sessions Patrik and
everyone in his team will experience doing Test-Driven Development
in their production code. Patrik comments it was actually fun to write
the tests this way instead of afterwards.
One hour each day is set aside to do some practice and learn new
techniques. In one of these “Learning Hour” sessions both teams are
gathered and you have prepared some materials about the “Golden
Introduction iii
Rule of TDD”. You ask the group to call out five important things
to remember when doing Test-Driven Development. This is a quick
warmup to remind everyone what they already know about TDD,
and you write up what they say on the whiteboard. Nobody quite
expresses the golden rule although one person was close. You explain
the rule: Don’t create any production code without a failing test that
requires it! Next is the most fun part - writing code. Working in pairs
on a simple exercise, everyone tries to apply the golden rule. When
there are a few minutes left of the session, we stop coding to discuss
what happened. Several people found themselves writing the code
first by mistake. One person was doing well then wanted to create
new code in a refactoring step. Was that ok? A short discussion ensues.
At the end of the session everyone goes away with a sticky note or
a screenshot of the rule and homework to try the exercise again by
themselves.
Does this way of working sound interesting to you? It’s called the
Samman method and it’s a way of doing Technical Agile Coaching.
The rest of the book explains all about it.
• Learning Hour
• Ensemble Working
In the learning hour the coach uses exercises and active learning
techniques to teach the theory and practice of skills like Test-Driven
Development and Refactoring. In the Ensemble sessions the whole
Introduction iv
There is well respected research that shows exactly these effects. The
book Accelerate by Forsgren et al. explains the remarkable findings
from a multi-year study of software development organizations. They
studied many factors, and identified those that contribute most
strongly to business success. In particular they highlight the practice
of Continuous Delivery. That umbrella term includes several techni-
cal and organizational practices, including Test-Driven Development.
Introduction v
In follow-up research¹ the same authors also found that technical debt
directly reduces developer productivity.
• It’s challenging and interesting. You never know what code the
team is going to put up on your screen, and you never know how
people will react when you ask them to work as an ensemble, do
TDD, refactoring etc. There is a lot of variety in the interactions
and the kinds of problems you face.
• You can have a bigger effect than you would in other roles. You
get to influence several teams over a few weeks of coaching.
Over months and years you influence several organizations.
• Teaching is inherently rewarding - witnessing someone start to
understand a new concept and recognize how they can apply it
in their work. That feeling when you see that happen. Gold.
Acknowledgments
The main ideas in this coaching method were originally developed
by Llewellyn Falco, and I continue to learn a huge amount from
him. This all started in 2018 when I did some pair-coaching with
Llewellyn and I was impressed with the results he was seeing with
his teams. (You can read about that story towards the end of the book
in the section “How I became a Technical Coach”). I have adapted
Llewellyn’s ideas for my situation and further developed several
aspects of the coaching method. I came up with the name “Samman
Coaching”.
I’d like to thank Llewellyn Falco for so freely sharing his knowledge
and methods with me. I’d like to thank all my colleagues at ProAgile
for all their support and inspiration. I’d also like to thank all the
early readers of this book who gave me feedback, including Samuel
Ytterbrink, Olof Bjarnason, Alexandre Cuva, Per Hammer, Grzegorz
Gałęzowski, Dave Nicolette, J.B. Rainsberger, Ester Daniel Ytterbrink,
Bill Wake, Jo Van Eyck, Joe Wright, Ted M. Young, Dianing Yudono,
Lars Eckart, Clare Macrae, Heidi Helfand, Philippe Bourgau, Sam
Cranford, Thomas Sundberg. I really value you taking the time to
help me write a better book.
The purpose of Samman
Coaching
A Samman coach aims for improved development practices in the
teams they work with. This chapter explains what those practices are
and what outcomes to expect from the coaching.
Development techniques
The choice of these particular development techniques shouldn’t be
controversial, they have been used for years by Agile practitioners
and in DevOps communities. There are many books and training
videos out there explaining how to do them. Samman coaching is
a more effective method for introducing them. The next sections go
through the main practices we aim to introduce and promote.
Continuous Integration
With the rise of Agile methods, Continuous Delivery and DevOps,
development schedules are being compressed and teams are expected
to deliver working increments of software more frequently. In my
experience, the way to confidently deliver a new version of the
software every 1-2 week iteration is to integrate and test the software
at least every day, so you always have something ready. If you
want deliveries even more frequently then you need a corresponding
decrease in the length of time between integrations. In general it
means the developers should work only for a few hours between
synchronizing and integrating their code together.
In many organizations the developers are used to working alone in a
branch for days or weeks before integrating their work. They don’t
know the incremental design and refactoring techniques you need to
be able to integrate more often than that. In the worst case everything
looks fine until shortly before the intended release date, when big-
bang integration happens with a string of bug-causing, schedule-
delaying merge conflicts.
that a different future is possible. The coach helps them gain the skills
needed to go there.
Expected outcomes
Firstly, we aim for awareness of what good unit tests look like, what
continuous integration actually is, that it’s possible to safely refactor
code you don’t initially understand. Next we aim for the insight
that successfully meeting deadlines and delivering high quality code
means learning iterative and incremental development techniques.
Teams gain new aspirations to be good at these things.
In my experience after perhaps 10-20 coaching days most teams will
have reached those insights. These are the first steps on the road to
improving the way that team works and the quality of the code they
deliver. After that, it’s about building skills and anchoring ways of
working in habits and culture.
I first learnt about the methods explained in this book through pair-
coaching with Llewellyn Falco. I was impressed with the results he
was seeing. The outcomes I observed were firstly a clear attitude
change. People wanted to learn these techniques, they saw them as
valuable. Secondly there was one team in particular where they had
become really skilled. Over the course of many days and weeks with
the coach they had changed the way they designed and built their
software. I remember sitting at the back of the room observing this
team working as an ensemble. They were working together smoothly
and productively, creating code and tests in small increments with
high quality.
Those are the outcomes you should see from Samman coaching.
Changes in attitude, increases in skill, improved code quality. Over
time, more productive development teams.
Measuring outcomes
Most people like to see hard evidence that something works before
they spend a lot of money on it. Or at least, they might let you start
The purpose of Samman Coaching xiv
This section of the book goes into some detail about what a Samman
technical coach actually does in the ensemble sessions, and why it’s
such an important part of your work.
Ensemble Primer
For those of you who have not experienced working in an ensemble,
a short introduction could be helpful here. Many programmers have
tried pair programming, and conceptually, working in an ensemble
is the same but with more people. You still have only one computer
being used to write code. Everyone present is responsible for the code
being produced, even though only one person at a time is typing.
However, for an ensemble to work smoothly you need more structure
and roles than you generally have in a pair. There are three main roles,
and you rotate roles frequently.
Typist
The typist is the person who has the keyboard and mouse. You use
the development tools and operate the computer. The important rule
here is that you are not allowed to decide what code to write or what
tests to perform. The typist listens carefully to everyone present, and
most particularly to the navigator. You enter the code the ensemble
has decided on, to the best of your ability. The navigator is usually the
spokesperson for the ensemble, but the typist may also follow advice
from other people. You can always ask questions to clarify what is
wanted and ask for more detail.
The typist should be in full control of the editor, the testing tools, the
debugger, the commandline, the refactoring shortcuts - everything
to do with operating the computer. Things like entering new code,
browsing through existing code, running tests and making commits.
Navigator
The navigator speaks for the ensemble and explains to the typist
what code they should enter into the computer. They speak in words,
Ensemble Primer 4
Team-members
Everyone who isn’t the typist is a co-navigator in the ensemble.
We all develop the software together. The aim is that the whole
ensemble should instruct the typist with one coherent voice. Usually
that means appointing someone to “be the navigator”. They lead the
work, they are talking and making the detailed decisions. Everyone
else is in a supporting role, quietly waiting for an opportunity to
contribute. With a more experienced ensemble, this leadership role
may not be explicitly appointed, it could simply pass fluidly between
members without any formal handovers. People chip in when they
have something valuable to contribute, and stay quiet otherwise.
Teammembers support both the typist and the navigator. If you know
a good keyboard shortcut the typist doesn’t seem to be using, you
can suggest it. If you can see a way to reduce duplication or improve
design, you can suggest it. The important thing is to choose carefully
when and how to make the suggestion. You don’t want to distract or
cause context-switching or confusion. If the typist and navigator are
getting along well doing something else, wait with your comment.
Choosing your moment to speak and knowing when it’s better to stay
silent is a really important skill. Having said that, it is important that
every member of the ensemble should follow what’s going on. You
should always feel free to ask questions so you understand the code
that’s being written. Just pick your moment wisely.
Ensemble Primer 5
Group Discussions
There will be periods when no code is being entered, and instead we
are discussing what to do. This is a normal part of coding work: we
need to agree on a goal, an approach, a design, a next test case… Many
discussions become more productive when you all stand around a
whiteboard or shared online document and can collaboratively sketch
your ideas. During these discussions you pause the ensemble roles
and let everyone take part equally. It’s wise to have a bias to action -
don’t discuss too long before returning to the ensemble and writing
some code together.
Facilitator
It’s worth remembering that working as an ensemble is a skill that
takes some time for a group to learn. It helps to have a facilitator
whose job it is to keep things working smoothly. This is usually
someone different from the typist or navigator since it’s hard to facil-
itate at the same time as doing one of those other roles. This person
will spend their time reminding people of the working agreements,
making sure roles rotate regularly, and helping the ensemble to reflect
and improve their work together.
As the ensemble gains experience the facilitator may need to inter-
vene less often. It may become a part-time position or disappear alto-
gether. To be honest, I haven’t worked with many really experienced
long-term ensembles and I’m speculating here.
Rotating roles
Most ensembles have some kind of timer that alerts the group when
it’s time to rotate roles. Many build their own - it’s a fun little piece of
software to implement. You can customize it with your own alerting
mechanism and decide exactly how intrusive it should be and what it
should suggest. Many such tools have a list of names and prompt the
next people that it’s their turn to be the navigator and typist. Other
groups have a more informal switching mechanism.
Ensemble Primer 6
After a while longer you feel you understand the direction the
ensemble is taking, and what the current feature is all about. You
ask to join the ensemble rotation and are added to the list in the
timer. Typing is tricky at first but people soon tell you the keyboard
shortcuts for their coding environment. While in the ensemble you
are able to answer a couple of questions and help the navigator. When
it’s your turn you pick up the navigation and carry on without it
affecting the flow of work or overall direction of the ensemble. After
a few hours you are working smoothly in the ensemble, you have
influenced the code in many small ways. You have contributed some
of what you know and learnt more about the struggles and challenges
of this particular team.
Teach
As well as prepared learning hours, you will sometimes teach in the
ensemble sessions. An ideal teachable moment might arise when you
notice they need a particular technique that they haven’t used before.
You can outline some theory, go through some concepts, then mentor
them through using the technique straight afterwards. If you teach
something just as they need it, then you increase the chances they
will remember that technique and when to use it.
Perhaps you’re in an ensemble and you come across a long method in
the code. You want to suggest a refactoring ‘extract method object’,
but the team has only done ‘extract method’ before. They struggle
to understand what that new refactoring does. You pull out some
teaching materials and do some or all of:
It’s a real skill to spot these teachable moments, and to be able to bring
out relevant teaching materials quickly. Don’t be afraid to pause the
ensemble rotations and teach for a few minutes.
Mentor
This is where you help the team to apply specific techniques in their
codebase, and build their capabilities. The team should already have
some understanding of the theory of the technique, perhaps already
tried it in simple exercises. Now you lead them step by step, with a
lighter and lighter touch as they become more competent.
For example, you want them to start doing Test-Driven Development.
You notice they begin to write some production code for a new
feature, and there is no unit test for it yet. Ask them to pause the
new feature and write a test for it first. What you do then depends
on the competence of the team at writing unit tests. Perhaps it will be
enough just to remind them they should have one. Perhaps you will
need to step into the navigation role yourself and write the whole
test.
As the team gets more familiar with the skill you are mentoring
them in, spend less time navigating yourself. You want to build their
capabilities not show off your own! Hand back to a navigator from
the team and instead prompt them with ‘coaching questions’ as they
get stuck. Only take over the navigation if they are not making any
progress, or are heading rapidly in the wrong direction.
Coaching Behaviours in an Ensemble 13
Facilitate
A facilitator conducts a process without having an opinion about the
content. Usually you do have an opinion about a lot of what goes on
in the ensemble, but not everything. In certain situations, facilitation
can be the best way to help the team to move forwards.
For example, perhaps there are two design suggestions being put
forward, and the group can’t agree which is best. You think either
might work. Facilitate the process of setting up a new branch to try
suggestion 1 in a timebox, then starting over with suggestion 2 in a
different branch for an equivalent timebox. When both the suggested
approaches have been tried, facilitate a discussion about which design
to choose.
Coach
This word is used in many contexts. Here I’m talking about “Profes-
sional Coaching” as the ACI⁵ or ICF⁶ would call it. You partner with
people and support them to achieve their goals. You work from the
assumption that they have the answers within themselves, and your
job is to help them to fulfill their promise. A key tool is the ‘coaching
question’ that evokes action without telling them what you think the
action should be.
As a Samman technical coach you do have opinions about the
direction you want people to take. You want them to learn to work
together as an ensemble, do refactoring, TDD etc. Before you can do
this ‘Professional Coaching’, they need to not only aspire to use those
kinds of development techniques, but also be skilled enough to be
able to do them. In that case, asking ‘coaching questions’ becomes a
great way to help them to change their behaviour.
For example, a new team member takes the navigation role when the
previous navigator had just begun defining a new test case. The new
navigator gets stuck and don’t know what to write. You think they
⁵https://www.agilecoachinginstitute.com/
⁶https://coachfederation.org/
Coaching Behaviours in an Ensemble 14
know what the test is for but are temporarily flummoxed. Ask ‘what
is next on our list of scenarios?’. That could help them to remember
you have a list of scenarios for the current user story, and that the
name of the scenario will help them to name the new test case.
When they have named the test case, they still look stuck. Ask ‘What
would you assert if this scenario was working?’. Working backwards
from Assert to Act to Arrange when writing a test is a technique I’ll
have taught them in a learning hour, and that prompt may be enough
to get them to use it in this situation.
If this kind of prompting isn’t enough, I’ll switch to mentoring or
teaching.
Observe
You may not need to intervene. If the ensemble is working well,
your best strategy could be to stay in the background and observe
the interactions and the code that is being produced. By staying
quiet for a while, you can give your whole attention to language
and tone. You can get a feel for whether the rhythm of test-code-
refactor is sustainable. You can see with your own eyes that they
have learnt to use the development techniques you’ve been teaching
them. Probably, you will see some things that could be improved. You
might see things the other ensemble members are unaware of, that
they would change if they did.
For example, you might note that a particular person is saying things
that are useful but people are not listening properly. Perhaps they are
not even aware that they are discounting that person’s views. You
could note down what you see and bring it up in the retrospective.
Retrospect
When there is around 15-25 minutes left until the scheduled end of
the session, I will call a halt. Preferably just after we made a commit,
or I will suggest we round off and make a commit. It can happen a
few minutes before that if we reach a good point to stop. Occasionally
I lose track of time and forget to stop at all until the next session is
due to start - this is not a good thing!
The reason for stopping programming before the end, is to get the
team to spend some time reflecting on what happened, so they can
realize consciously what they have learnt. For example, Sam might
not have noticed how frequently they have been making commits,
until Jenny points it out. Once Sam has consciously acknowledged
what happened, he can ask questions about why that was a good thing
to do. He can start to examine how he usually behaves and reason
about it. If all he had done was experience frequent commits, then
gone back to his desk to work alone again, it’s possible that could
have led to a change in behaviour all by itself. By making him think
about it, though, you increase the chance he will consciously try to
change his behaviour.
Yes, and
In improvisational theater, they have this rule. Say ‘yes, and’ to your
fellow actors while you perform together. It means you should accept
whatever they give you, and build on it. I’ve only seen this kind of
theater a couple of times, but on both occasions bizarre and funny
situations arose, the actors clearly having a brilliant time creating
together.
If the actors instead say “No, but…” and start in another direction
entirely, it breaks the group flow and hinders the creativity. The actors
know it will be a better performance if they support one another.
This is the kind of spirit we want to cultivate in the ensemble. Do not
delete or undo what the previous navigators did before you. Refactor
but do not rewrite. Say ‘Yes, and’ to whatever your colleagues give
you.
and I had actually asked him to coach the ensemble while I took a
navigator role together with about six others who all worked in the
client organization. At one point I was lead navigator and writing a
new test case for a class that didn’t exist yet. I hadn’t quite worked out
what the best design was, whether to pass arguments to a constructor
or to have a static method. I had asked the typist to write the ‘arrange’
step one way and was going on to start writing the ‘act’ and ‘assert’
steps of the test.
My colleague stopped me and asked me to not write any more code
before getting it to compile. He wanted the code to be in a good state,
close to green, ready to hand over to the next navigator. Creating the
class would have been a couple of trivial clicks in the IDE. I wanted to
defer the design decision until I’d seen the whole test. He was insistent
that I not write any more code before having it compile. I held my
ground and asked to finish writing the test before creating the class.
We both got a bit angry, which was absolutely not a good way to
behave!
I don’t remember which of us suggested we take a time out but it was
exactly the right thing to do once we had got into that bad situation.
We all left the room, got coffee and calmed down. I realized that
since he was coaching I really should have deferred to his judgment.
Apologies were exchanged and relationships repaired. Us arguing was
a terrible example to set and I am still embarrassed when I think about
it. Even experienced coaches have a bad day sometimes!
that Christie lacks direction, the coach asks leading questions⁸ to help
her to find a direction. In this example the navigator was silent, but
if they give a plausible but vague answer you should also push for
more information.
Liz - “…” (looks worriedly at the code on the screen)
Coach - “What should we do now?”
Liz - “… make it work…” Coach - “what is it that is not working yet?”
Liz - “…” Coach - “we have some scenarios we wrote up earlier. Are
all of those working yet?”
Liz - “we haven’t done error handling for duplicate items yet”
Coach - “Should we write a test for that?”
On the other hand, you might find the navigator knows the direction
they want to take, and were just thinking for a moment
Charlie - “…” (looks worriedly at the code on the screen)
Coach - “What should we do now?”
Charlie - “We need a test for the error handling scenario”
Coach - “Great, let’s do that.”
As a coach, you should help the navigator to find a direction.
Can we do an experiment?
The ensemble is stuck discussing options and no code is being written.
There is general disagreement about whether it’s a good idea to
import a particular header file.
Coach - “This is an interesting discussion. Some people are saying
they think compile time would be reduced if we pre-declared the class
instead of importing the header file. Can we try it both ways and com-
pare the compile time? Deepak, can you navigate an experiment?”
Deepak - “Yes ok. Can you add the header import and check the
Coaching Situations Illustrated with Stories 25
Discover scenarios
The team has just started working on a new task. They would like to
work with TDD but have only done it before with simple code katas.
The coach might help facilitate scenario discovery and making a test
list. The coach steps up to the whiteboard.
Coach - “can someone explain this user story?”
Frank - “We receive a customer record from the mainframe and we
should process it then notify our users about the change”
Coach - “Can you think of a simple example?”
Frank - “A new customer record. We haven’t got it already.”
Coach - “Sounds like a good scenario. How do we know it’s new and
we haven’t got it already?”
Frank - “The externalId is not found when we search for it”
(Coach writes on the board: “new customer: externalId not found”)
Coach - “How will we know when we’ve processed it correctly?”
Frank - “We send out a notification about the new customer”
Coach - “Anything else? Should the new customer appear in searches?”
Frank - “Yes, it should appear in searches through the api.”
(Coach adds these details to the ‘new customer’ scenario)
Coach - “ok, what other scenarios are there?”
Coaching Situations Illustrated with Stories 26
1. Intention
2. Location
3. Details
In this case the navigator has direction, and has jumped straight into
the details. Firstly the coach gets them to explain their direction, and
also to raise their language from details to intentions. Then they give
a nudge. “Do you have a test for that?” reminds the navigator that
one of their aims is to do Test-Driven Development. The navigator
continues in the new direction.
Consume-First Design
Kris - “In the VehicleDiagnostics class we need a new method
determineEngineState.”
Typist - types
(ensemble timer goes off, Kris moves to typist and Trish steps up to
navigate)
Trish - “… uh … was this method supposed to return something?”
(silence)
Coach - “I think we should be doing Consume First. Where is this
new method used?”
Kris - “From the detectGeofenceIncident method. We only want to
send an incident alert if the engine is on.”
Coach - “Go to that method and add the call as if the determineEngineState
method already existed”
(typist brings up the method)
Coaching Situations Illustrated with Stories 30
Trish - “Ah ok. So we should add a condition on line 3 here. After the
fencedArea check, we need an ‘&&’ then call the determineEngineS-
tate. Pass this.vehicle as an argument. Check it equals ENGINE_ON,
which is an enum value that should already be in VehicleState…”
(typist writes this code)
1 TEST(Storage, writeFileNoCallback)
2 {
3 storage.writeFile(outputfile);
4 }
Hanbing - “then we’ll mock the cloud storage and check it gets a call
to putObject. We’ve already got a cloud mock, do the same as in that
other test. Put in some fake arguments for the moment - like path,
filename, data, length of data - say 4” (typist writes this code)
Coaching Situations Illustrated with Stories 32
1 TEST(Storage, writeFileNoCallback)
2 {
3 MockCloudStorage cloud;
4 EXPECT_CALL(cloud,
5 putObject("path", "filename", "data", 4)
6 ).Times(Exactly(1));
7 storage.writeFile(outputfile);
8 }
Hanbing - “We should construct the storage object - that’s the class
under test - shall we call it StorageImpl? Pass the cloud object to the
constructor.” (typist writes this code)
1 TEST(Storage, writeFileNoCallback)
2 {
3 MockCloudStorage cloud;
4 StorageImpl storage(cloud);
5 EXPECT_CALL(cloud,
6 putObject("path", "filename", "data", 4)
7 ).Times(Exactly(1));
8 storage.writeFile(outputfile);
9 }
Chapter Summary
An ensemble with direction works effectively towards a goal. In many
of these stories the coach helps the group to find direction. Sometimes
the ensemble has direction but the coach would like them to take
a different one. At all times the coach is modelling the behaviour
they want to see. They stay quiet when navigators are setting a
good direction and the ensemble is making progress towards a goal.
Otherwise they intervene with suggestions and leading questions.
Retrospectives
Each ensemble session should conclude with a short retrospective,
about 15 minutes of a two hour session. This is a chance to reflect
on what’s happened, process events, and encourage people to draw
lessons from what’s happened. Each ensemble session should be an
improvement on the previous one. You want to see increasing collab-
oration, new skills being used, people feeling happier. That doesn’t
happen all by itself, people need to decide to behave differently. Don’t
just plunge straight back into your other work, without reflecting on
how to improve.
When I am coaching I have with me a box containing a load of marker
pens and different coloured sticky notes. It’s useful since although all
companies have these things they can be hard to locate, and you’ll
be having a short retrospective several times a day. If you’re remote
you could have a template prepared in an online document or virtual
whiteboard.
When retrospectives are frequent and short, then the outcomes and
learnings are small. Problems can be acted on promptly and many
small learnings add up to a lot. If you hold longer retrospectives less
frequently, you get observations of bigger problems and the danger is
they get ignored.
There are many ways to do retrospectives, it helps to mix it up and
keep it fresh by using different techniques on different days. Here are
a few ideas.
• Liked
• Learned
• Lacked
When everyone has had a few minutes to write their notes, I ask them
in turn to go to the whiteboard and read their notes, sticking them on
the board as they talk. I encourage people to say if they have written
essentially the same thing, and we group together similar notes on
the board. We may have a short discussion about it, particularly
if the note is vague or novel. If notes are really vague (“liked the
discussions”) then try to get people to say more precisely (“discussion
about long methods”). If someone has not written any notes, let them
go last, and see if they can think of any observations to share now.
While the team members are writing observation notes, I will also
write a couple of notes that I will stick on the board. I prefer to
bring up positive things that have happened that I liked and want
to encourage.
Retrospectives 38
• Pick up where we left off when you meet this team again
• Remember what we did for the ‘Boss email’
• Record progress over many weeks of coaching
• Keep track of class and method names where we need to do
work
I usually only write a few bullet points, just enough to jog my memory.
Something like ‘xxx class - duplication’ or ‘encourage nnn to speak
up’. I might write about a design decision we made, or a test we should
write next time.
These notes form part of my personal retrospective. They are not for
sharing with the team, they are for my benefit. They help me to do
a better job the following day when I meet the team again. After a
few weeks I can look back and feel encouraged about how far we’ve
come.
proceeding and note how to improve it. If they get really good they
might start to do it during the session. Pulling out a sticky and making
some notes when something interesting happens.
Don’t drop the habit of retrospectives, even when the work seems to
be going really well. There is always something that could be better.
If you stop holding retrospectives then gradually the team will forget
to make observations any more.
Remote Ensembles
It’s perfectly possible to work as an ensemble where coach and team
members are all remote. With the covid-19 outbreak, I had to learn to
do this in rather a hurry. The technology to support remote ensembles
is pretty good these days.
A few things that are especially helpful in a remote setting:
I’m sure there is more than one way to set things up that achieves all
these goals. The rest of this chapter shares some ideas.
Take breaks
Staring at a screen is tiring. It seems to be more tiring than being all
together in the same room. Be kind to one another and take breaks
before you think you need them. At least every hour, take five minutes
to get a coffee or similar. I tend to instigate a common break half way
through each session, where everyone leaves their desk at once.
Design discussions
When working in an ensemble, you don’t spend all your time en-
tering code into the editor. It’s very important to build a common
understanding of what code you’re trying to write and what the test
Remote Ensembles 43
Retrospectives
The simplest thing I’ve found is for everyone to write their obser-
vations into the group chat. Another simple solution is people write
notes in a local document and taking turns to share their screen. A
shared cloud-based document works in a similar way.
Collaborative retrospective tools with virtual sticky notes or mindmaps
could also work. They might be more intuitively similar to what
you’re used to in the physical world. Beware of them taking a lot
of bandwidth and having lag. Try some and see what works for you.
Part 2: Learning
Hours
The second major part of Samman technical coaching is the learning
hour. These are short training sessions where people practice coding
skills and learn new techniques. When working with a team ensemble
you’re primarily a mentor and facilitator. In the learning hour you’re
more often acting as teacher and coach.
If you’re reading this book, chances are you have already been
doing some teaching. You probably already have some materials and
exercises that you’ve done with groups. You may have led workshops
at conferences, or given talks at meetups. Start there. Start with what
you have.
Now would be a good time to put this book down and make a quick
inventory of your existing teaching materials. Think through all the
situations where you’ve made a slide deck about technical practices,
or gone through a code kata with a pair or a group. If you’ve attended
a workshop or training session as a participant, perhaps you worked
on one of the exercises some more afterwards, and shared it with your
team.
It’s hard to take over someone else’s lesson plans and exercises. You’re
going to need a personal portfolio to use when you’re coaching. I’m
very happy to share the materials I use - and some of them are in
this section - but fundamentally teaching materials that you make
yourself will be much better. Find materials and exercises that appeal
to you from other people, but always adapt and tweak them so they
become your own.
45
First we should talk about why learning hours are such an important
part of your work.
Explaining Why you
should hold a Learning
Hour
People are not used to training happening like this, every day. There
even seems to be a school of thought that says you should do all your
learning in your spare time, that your employer shouldn’t be paying
for it. I strongly believe that for an organization to succeed in the
modern world, it needs to be a learning organization. If you meet
resistance to the idea of spending as much as an hour on learning
each day, this chapter will help you with some arguments and ideas
to help you persuade people.
It took me about 20 minutes to get down that slope, and I was in severe
need of a hot chocolate and a hug by the end! That gentle slope which I
could get down fairly effortlessly with a snowplow, suddenly became
a nearly impossible challenge. I was still skiing, I was still using the
same equipment on the same slope. The difference was the technique
I was trying to use to get down it.
I don’t know if you’ve ever tried skiing. If you did, chances are that
like me, you started with the ‘snowplow’ technique. You put your
skis in a V shape in front of you, weight firmly in the center, bend
your knees and gently slide down the slope. If you find yourself
accelerating too much, you widen the V, and it slows you down.
Widen the V more on one side than the other to turn. Well actually
it’s not quite as easy as it sounds. Most beginners get the hang of this
only after several lessons. I had an advantage - previous experience.
I was already fairly proficient at cross-country skiing, a related
technique. You mainly ski on the flat, as the name implies, and the
equipment is different. The skis are much longer, and your heels are
not attached, only your toes. It’s quite similar to hiking, following
trails up and down around the mountains. When you go downhill,
the slope on the trail is always gentle, and the technique you use is
not that different from the snowplow you do on alpine skis.
The trouble with snowplow, is that it works really well on gentle
slopes at slow speeds, but if you really want to have fun skiing fast in
the high mountains, you need a different technique. When you think
about it, the key to going really fast is better brakes! With parallel
turns, you slide with the skis parallel to one another instead of in a V.
You get your full weight onto both ski edges when you point them in
the same direction. It gives a much more powerful and controlled
braking effect, and it’s a completely different way of turning and
balancing.
Explaining Why you should hold a Learning Hour 48
The trouble is, on the beginner slopes that you use to learn parallel
turns, snowplow works perfectly well. It’s really tempting to just go
back to it, especially when you start getting tired or cold or frustrated.
Explaining Why you should hold a Learning Hour 49
Hubris
When I tried parallel turns for the first time, I was overconfident. I
wanted to try downhill skiing properly, feel the wind in my hair and
go whizzing down steep slopes. I had seen people doing parallel turns
and someone had explained the basic mechanics to me. I thought I
would be able to pick up the new technique easily. I didn’t take the
trouble to get an instructor to help me. I didn’t find a supportive group
of friends to learn together with. It didn’t go well!
Maybe I’m a little hard on myself. I did at least pick a smooth,
gentle, short skislope to begin with. Many people trying TDD will
start directly in their production code. That’s a bit like attempting
parallel turns on a steep slope with loose snow and moving obstacles
in the form of other wobbly beginners skiing around you. What could
possibly go wrong?!
In the learning hour, it should be like have a fun safe skiing lesson
together with friends. I’ll ask you to step outside of your comfort zone.
We might fall over or joke about a bit. Together we’ll learn some
techniques that will be useful when we get back to the production
code. Soon you and your whole team will be whizzing down the
mountain with the wind in your hair!
they had some guidance and got the right tools. I’ve seen developers
leave a learning hour, keen to try out what they have learnt to
improve their production code.
As a software developer, learning is part of your job. There are always
new tools and frameworks appearing that you should know about.
There are always better designs and ways of working being invented.
To remain competitive in a fast-moving world, where you are being
paid for knowledge-intensive, skilled work, you must keep learning
to stay relevant and useful.
The idea of doing an hour of learning daily is to make it normal. Learn-
ing is a useful and important part of your job, not something you try
to cram into lunchtimes or a conference once a year. Organizations
who give you work time for learning are the ones you want to stay
with, and give you the colleagues you enjoy working with the most.
Another benefit of doing learning hours daily, is it makes it less likely
people will miss all the training by being ill or tired one day. It gives
plenty of time between sessions for you to try out what you have
learnt, and come to the next one with questions.
Everything I’ve said here are all the same principles that led me to
recommend the ‘Coding Dojo’ format for many years. The learning
hour is basically a rather short, frequent dojo. Just as with learning
a sport or a musical instrument, usually frequent shorter sessions are
more effective.
It’s always good to throw open the invitation to learning hours more
widely than only the teams you are coaching. People in other job roles
like Product Owner or Scrum Master might be interested to come
along. Particularly if the session won’t involve much coding - perhaps
you’re going to play an agile game or simulation - do invite additional
people.
I also find it useful to invite aspiring Samman coaches or interested
developers from other parts of the client organization or even other
organizations. People start to understand what the coaching is about
when they see it happening. In the learning hour we generally only
work on exercises so there is less problem with NDAs and security
when it comes to bringing in external people.
The Theory and Practice
of Teaching and Learning
I have been a learner all my life, but I have no formal training as
a teacher. Some of the teachers who I’ve learnt most from have
been similarly untrained themselves, so clearly it’s not a prerequisite.
Having said that, it helps to know a little bit about pedagogy (theory
and practice of learning) before you set out to teach people.
Bloom’s taxonomy
Back in the 1950s, educators led by Benjamin Bloom came up with
a taxonomy to describe learning objectives. Since then this model
The Theory and Practice of Teaching and Learning 54
• Remembering
• Understanding
• Applying
• Analyzing
• Evaluating
• Creating
The verbs I’ve used to begin those sentences with are very deliberately
chosen. Each Bloom category comes with a list of verbs. In this
example these verbs map to categories like this:
• Describe ⇒ Remembering
• Compare ⇒ Understanding
• Use ⇒ Applying
The philosophy is very much that each person who comes to your
learning hour has a unique background, and what they are going
to learn needs to be integrated with what they already know for
it to stick. People are not some kind of empty vessel that you pour
knowledge into via talking at them in front of a deck of slides. People
are active participants, with their own goals and motivations to learn
things. As a teacher you can help them to see what’s possible, and to
support them as they decide to learn things.
To be more concrete and specific, when you plan a learning hour, you
include activities for each of the 4C’s:
A ‘trump’ is a kind of card that beats the others. Sharon Bowman has
come up with six ‘trumps’ to help you remember useful rules about
how the brain works. The aim is to help you to plan more interesting
and effective training. In the following sections I’ll summarize some
of her book “Using Brain Science to Make Training Stick” and relate
it to planning learning hours.
At a most basic level, you learn more when you’re feeling awake!
If you move around, it increases oxygen flow to the brain, stops
you falling asleep, and increases brain performance. The trick is
incorporate movement into the content of the training so that it
doesn’t take much time. Ideally, you want people to move out of a
sitting position at least every 10-15 minutes.
The Theory and Practice of Teaching and Learning 58
When you are writing you can’t think about anything else, it forces
you to concentrate. When you read, it’s easier for your mind to
wander. Writing also makes the information multi-sensory - you
physically move a pen on some paper as well as see the text on the
The Theory and Practice of Teaching and Learning 60
page. You can draw lines and boxes to situate the information in space
and relate it to other information. All those things make the content
easier to remember, but only if the learner does the writing. Watching
someone else write or draw lines and boxes is not as good.
Provide handouts, notes and quizzes that people can annotate. Ask
people to write conclusions and observations on sticky notes.
Deliberate Practice
The Bloom category ‘Applying’ is about being able to use a technique
competently. In order to apply a skill like Test-Driven Development,
there are several other skills you need to be able to apply and switch
between. In the Red-Green-Refactor cycle for example you need to:
• identify the next test case that will incrementally improve your
solution
• design the specifics of that test case and see it fail
• implement a solution design which is testable
• Refactor to improve your design
If you are weak in any one of those component skills, you will
struggle to do TDD. The great advantage of practice exercises is we
can find ones that let us work on those component skills individually.
Actually, you can break them down even further. For example within
‘Refactoring’ we have the skills ‘keyboard shortcuts’ and ‘identifying
duplication’. It’s not uncommon to find programmers who need
to practice these skills alone before attempting to refactor more
generally.
This process of focusing on practicing one small skill at a time
before composing them into a cohesive activity, is part of ‘deliberate
practice’. It’s a technique that helps people to improve their skills
more effectively. It’s different from the kind of practice that happens
when you just repeat something you can basically already do. De-
liberate practice will stretch you just the right amount to make you
uncomfortable and expose the need to improve.
For example, musicians often practice playing scales: sequences of
notes going up and down. They practice them first slowly then faster
and faster, maintaining accurate notes and even rhythm. Scales are
not very interesting to listen to, and most pieces of music you actually
want to play are a lot more varied than that. The thing is, those same
tunes will often contain a few short passages that are just scales. These
can be some of the hardest parts to play well. If you deliberately
practice scales, then it will enable you to play a variety of tunes better.
You isolate the hard part and practice it separately.
The Theory and Practice of Teaching and Learning 63
In the same way, you can practice a skill like refactoring by itself.
In real coding work, this may only be a small part of what you do,
but it can be a difficult part. By doing refactoring katas, applying
specific refactorings and learning how they change your design, you
can start to improve your coding as a whole. Deliberately practice
this one aspect by itself.
As a teacher, I want to plan a series of learning hours that will
be at just the right level so people don’t get bored, and don’t get
overwhelmed or frustrated. I want to build up skills and work towards
composing them into bigger skills like Test-Driven Development. I
tend to work with several themes that I swap between each learning
hour. Each time we return to a theme we’ve covered before, I’ll
increase the challenge-level of the exercise, or focus in on a particular
component skill, based on how well the group coped the previous
time.
In the next chapter we’ll look at some specific learning hour plans
illustrating all these pedagogical techniques.
Sample Learning Hours
This is a sample plan of what I might do for the themes, plans and
goals for ten learning hours with an organization I was new to. Once
I met the teams I would probably adjust the plan and substitute some
of these for other ones. I include it here as a reasonable starting point.
Each learning hour plan starts on a separate page in case you want to
print them out and use them as notes during the session.
Sample Learning Hours 65
Learning goals:
This learning hour is in the “Small steps” theme.
Session outline:
• 10 min Connect: divide into pairs, 3 benefits of TDD
• 15 min Concept: Demo leap years
• 20 min Concrete: Do Leap years in pairs
• 10 min Conclusions: Summary of main idea
Connect
Ask people to form pairs and introduce themselves if they don’t know
each other. Ask them to discuss the question ‘What are some of the
main benefits of doing Test-Driven Development?’. After 3 minutes,
ask each pair to report one thing they came up with to the group.
Sample Learning Hours 66
Concept
With your code visible to all, demonstrate completing the Leap Years
Kata¹⁰. I like to use cyber-dojo¹¹ because it makes the red-green
iterations visible.
Starting at a whiteboard, explain the purpose of the kata. Read the
description to the group, and/or display it on a slide. Write up all 4
examples given in the kata description on a whiteboard. Note that
these will turn into tests.
Then complete the exercise as a demo. Make it clear you interleave
designing tests and writing code.
Concrete
Conclusions
• Think about what we did today. If you had to explain the main
idea of TDD to someone else, what would you say?
• Write your explanation in a sentence or two on a post-it
Put up a flipchart with the question “What is the main idea of TDD?”
and make it look attractive with a lightbulb doodle or something. Ask
people to stick their post-it notes on it. If time is short, they can do
that on their way out. Otherwise, read some notes out to the group
before you part. Hang the poster somewhere prominent afterwards,
perhaps in the team area or coffee room.
If working remotely, they can each write their sentence or two in a
shared online document.
¹⁰https://sammancoaching.org/kata_descriptions/leap_years.html
¹¹https://cyber-dojo.org/
Sample Learning Hours 67
Learning goals
The theme is repeated from the first session: “Small steps”.
Session Outline
• 5 min connect: fast pass ‘Order of TDD steps’
• 10 min explain & elaborate test list for FizzBuzz
• 10 min demo FizzBuzz with triangulation
• 2 min reflect: summarize triangulation in own words
• 30 min FizzBuzz in pairs
• 5 min reflect: pairs discuss what they learnt today
Connect
Print out the list of steps below and hand a copy to each participant.
Ask them to spend one minute writing what order to do them in.
(This is a ‘Fast pass’ ‘Take a Guess’ activity)
• Refactor duplication
• Write a new test case that fails
• Review the requirements and note down a ‘todo list’ of test cases
Sample Learning Hours 68
When the minute is up, ask them to compare their answers with
their neighbour. After 1 more minute ask if anyone has questions
or inconsistencies between their answers. Answer their questions
yourself or if time allows, ask if anyone else in the group can answer
first before filling in any details they missed.
1 () -> print("1\n2\nFizz\n4\nBuzz\n...")
Explain that they could usefully write a pure function that takes an
integer and returns a string. This function could be called by the other
one, and will be easier to test, while still giving us good coverage of
the business rules.
You might then end up with test cases on the whiteboard looking
something like this:
1 1 -> "1"
2 3 -> "Fizz"
3 5 -> "Buzz"
4 6 -> "Fizz"
5 15 -> "FizzBuzz"
¹²https://sammancoaching.org/kata_descriptions/fizzbuzz.html
Sample Learning Hours 69
When you have half a dozen or so of those kinds of cases, ask them
to prioritize/sort them. Which is the easiest to implement? Which
order should we take them in? Hopefully they will notice you should
take a number that is not divisible by 3 or 5 to begin with. Write
numbers next to the examples (in a different colour pen) which order
to implement them as test cases.
Demonstrate how to TDD the first few test cases. Add extra cases
for triangulation purposes - eg if they only wrote up ‘1 - > “1”’ you
may end up doing ‘2 -> “2”’ as well. Explain the extra examples are
useful to force you to generalize the code. Add the new test cases to
the whiteboard.
When it comes to the test for the impure function that prints to the
console, I suggest you point out this is harder to test with a unit test
and we will leave automating that test for another day. For today it’s
enough to check the pure function.
I often use cyber-dojo for the demo, to make the TDD cycles more
visible.
Reflect
Concrete
Ask them to refactor first to make adding the new rules straightfor-
ward.
Conclusions
• In pairs, discuss how TDD felt, what was difficult and what was
easier.
• Tell the other person the most useful thing you learnt so far.
Sample Learning Hours 71
Learning Goals
This time we’re making a start on the “Testable Agile Design” theme.
Session Outline
• 5 min connect: What’s important to remember in TDD
• 10 min concept: Golden Rule
• 35 min do: shopping basket
• 5 min reflect
Connect
Ask the group to shout out five things that are important to remember
when doing TDD. Write up each thing they come up with on a
whiteboard or shared document everyone can see.
The kinds of answers you might get:
In TDD the tests drive the design of the production code. You can
express that as a golden rule:
Do not write any production code until you have a failing test
that requires it
This means you should declare new classes, methods etc, in test code.
Then use your tools to bring those things into existence.
Write the golden rule on a flipchart and make it look pretty.
What do you think about this rule? Will you try to use it?
¹³https://sammancoaching.org/kata_descriptions/shopping_basket.html
Sample Learning Hours 73
Learning Goals
The theme changed now to “Refactoring”.
Session Outline
• 5 min Connect: collect names of refactorings
• 5 min Concept: Martin Fowler’s refactoring definitions
• 10 mins Concrete: Pairs review Tennis and suggest refactorings
• 10 min Concept: Demo extract function on Tennis1
• 25 min Concrete: Pairs refactor Tennis1
• 5 min Conclusions: own definition of refactoring
Names of Refactorings
Have people note down names of refactorings that they know already
and then report to the group. Write up names on a whiteboard or
flipchart. When you come to this part, you might discover no-one
knows any names at all. In that case suggest some refactorings they’ve
used without knowing their name. For example Rename Variable and
Extract Interface. That might prompt them to remember some more.
Otherwise, just move on to the next step.
Sample Learning Hours 74
Refactoring definition
Do refactoring
Have them do what you just showed them and continue doing ‘extract
function’ until they have the public ‘score’ function in a good state.
If they have time, they can carry on and refactor away more code
smells.
Define ‘Refactoring’
Learning Goals
We’re still working in the “Refactoring” theme.
Session Outline
• 15 min connect: Refactoring misconceptions
• 5 min concept: Refactoring purpose
• 30 min do: Refactor Tennis3
• 5 min reflect
Discuss Misconceptions
Purpose of Refactoring
Work on Tennis3
Ask people to note down code smells they see in Tennis3 in The Tennis
Refactoring Kata¹⁶. As the address these smells, ask them to note
the names of refactorings they use. Hopefully they will at least find
“Mysterious Name” and apply “Rename Variable”. If they’re using an
IDE, have them learn the keyboard shortcuts.
Reflect
Have people note down an answer to this question: When should you
refactor?
¹⁶https://github.com/emilybache/Tennis-Refactoring-Kata
Sample Learning Hours 78
Learning Goals
The theme is back to “small steps”.
Session Outline
• 5 min connect: what to do before you start coding?
• 10 min concept: Test List
• 40 min do and reflect: Create and evaluate test lists
Connect
When I was young, I used to read these books in a series called
“Choose your own adventure”. The idea was the story would change
according to decisions you made as reader. After a few pages describ-
ing what your character is experiencing - “you are looking at a temple
complex with a large stepped pyramid with imposing entrance in
front of you and a beautiful grassy meadow to one side”, it would say
something like “to enter the temple, turn to page 164. To walk into the
meadow, turn to page 23”. So you turn to page 164 but quickly find
out there is a big orc in the temple that attacks your character with an
axe. So you quickly revise your choice and turn back to page 23 and
look at the meadow. Here you discover a beautiful unicorn. That’s
what we’re doing in today’s warmup - choose your own adventure.
Will you find the unicorn, or the orc?
Sample Learning Hours 79
Print out the options below on one side of a piece of paper, and the
consequences on the other side. Ask people to read through these
descriptions and choose the option that best matches how they think
they would behave. Then ask them to turn to the next page to see the
possible consequences.
Option A
Start by opening a new file in a code editor. Begin declaring a test case.
Refer back to the requirements document and pick the first thing it
refers to to turn into a test. Go back to the editor and write that test
case.
Option B
Option C
Option D
Option A consequences
Option B consequences
Option C consequences
Option D consequences
the requirements since you have no tests to guide you. In the end
your tests may become tightly coupled to your implementation and
difficult to maintain as the design evolves. I’d recommend a more
test-oriented analysis of the requirements. Take a look at Option B
for more information.
Repeat the above steps for a second kata if there is time, for example
Fractions or MontyHall.
Fractions¹⁸ or MontyHall¹⁹.
¹⁸https://sammancoaching.org/kata_descriptions/fractions.html
¹⁹https://sammancoaching.org/kata_descriptions/monty_hall.html
Sample Learning Hours 83
Learning Goals
The theme is changed this time, to work on designing tests.
Session Outline
• 15 min connect: review test code samples
• 5 min concept: Arrange - Act - Assert
• 30 min do: Mars Rover, Shopping Basket or Tennis
• 5 min reflect: code review
Pin up some code samples around the room. For example Mars Rover
Kata Sample Tests²⁰. Some follow Arrange-Act-Assert structure, some
don’t. Have them review the code and vote with their feet which is
most and least likely to contain bugs.
Similarly you could say about test code - All code you write may
contain bugs, and unit tests help you to find those bugs. If you write
the test code as clever and complex as the production code, your test
code will need tests too!
No-one wants buggy test code that could hide bugs in the production
code. So what to do? We write our test code to be as simple and
straightforward as possible. Nowhere for bugs to hide. Using a
standard Arrange - Act - Assert structure helps.
Bring up the code sample with the best AAA structure and go through
it.
Do: a Kata
I suggest one of the katas you created a test list for last time,
like MarsRover²¹. In that case, each pair can pick one of the lists
they created before. Alternatively use Tennis²² or Shopping Basket²³,
which should also be familiar. Practice writing new test cases with
an Arrange-Act-Assert structure.
It’s useful to choose a kata they already know at least a little bit, so
they make more progress and practice writing more than a couple
of test cases. Don’t worry too much about using a technique like
Parameterized or Data-Driven Testing, unless they’ve used it before
and know the syntax. For the moment you just want to make sure
the tests are straightforward, easy to read, and test one thing each.
Plan for a follow-up session to learn about using parameterization to
reduce duplication.
Reflect
Divide into pairs and take turns to explain to the other person: Why
should test case code structure be simpler than production code
structure?
²¹https://sammancoaching.org/kata_descriptions/mars_rover.html
²²https://sammancoaching.org/kata_descriptions/tennis.html
²³https://sammancoaching.org/kata_descriptions/shopping_basket.html
Sample Learning Hours 85
Learning Goals
The designing tests theme continues.
Session Outline
• 10 min connect: sticky notes of key concepts the group should
know already
• 5 min demo: start with the assert
• 30 min do: Mars Rover or Tennis
• 10 min reflect: observations
Connect
In advance of the session, write sticky notes with some concepts they
should already be familiar with, and stick them where everyone can
see them on a whiteboard or flipchart. For example you could have
these:
Ask the group to gather around the stickies. Ask for a volunteer to
step forward, pick up a note and explain what it is. Use coaching
questions to help them to explain the important and relevant aspects
of the thing, without you taking over the explanation. When the note
is explained, move it to one side. Repeat until different people have
explained each note.
With a remote group, put the statements in a shared online document
and use strikethrough to indicate the concepts which have already
been explained, rather than moving them around.
Do: a Kata
You could start over with the same kata as last time, or go for a new
one. I suggest MarsRover²⁴ or Tennis²⁵. Practice writing new test cases
starting with the assertion and working back to the setup. Be sure to
start over from scratch and not just take up where they left off before.
The repetition will help to make it easier to apply the new “start with
the Assert” practice.
²⁴https://sammancoaching.org/kata_descriptions/mars_rover.html
²⁵https://sammancoaching.org/kata_descriptions/tennis.html
Sample Learning Hours 87
• Baby steps
• Test Readability
• Duplication between test cases
• Pairing/Communication
• IDE/Editor
Read out some or all of the observations and stick them next to the
relevant area. Create more areas as needed.
The aim is to get people to see that writing the assertion first will help
them to succeed with many of the concepts we went through in the
‘Connect’ part of today’s learning hour.
Sample Learning Hours 88
Learning Goals
The theme is “Testable Agile Design”.
Session Outline
• 5 min Connect: “Take a Guess” with topic Overdesign
• 10 min explain yatzy & make list of test cases together
• 10 min ensemble with you navigating
• 30 min ensemble continues
• 5 min Reflect: whole group temperature - too many/too few
tests?
Connect
The topic is overdesign in software. Read the list of statements below.
Circle those that are relevant to the topic, and cross out those that are
unrelated. Compare your answers with your neighbour.
• “You Aint Gonna Need It” is a poor excuse used by failed de-
signers to justify deleting useful extension points in the software
design.
• In code reviews, you should suggest replacing any global vari-
ables with the Singleton pattern.
• Primitive Obsession is a code smell.
• UML is a graphical language for describing software design.
• Premature Generalization is a code smell.
Demonstrate
Starting at a whiteboard, explain the purpose of the Yatzy²⁶ kata. Read
the description to the group, and put the category and scoring rules
on a screen they can see. Ask the group if they can see any examples
in the description that would make good test cases. There are lots! For
example they might find these examples:
When they’ve identified these, ask the group what order they would
tackle the examples in. When some consensus arises, note this on
the whiteboard. I expect they would want to order by category, for
example:
Don’t worry too much about what order they want to do the cate-
gories in, although I do suggest you encourage them to tackle ones,
twos etc before tackling pair or full house.
²⁶https://sammancoaching.org/kata_descriptions/yatzy.html
Sample Learning Hours 90
Take the navigator role in the ensemble, rotate the driver. Steer the
group towards a design where you have a function for each yatzy
category, and some kind of switch statement in the main function
that calls them. Each such function is named after the category, takes
a list of five integers, returns an integer. You should get at least as far
as creating the first of those functions.
Do
Hand over the navigator role to someone else, continuing to code
from where you got to. Make sure they continue to work in small
steps, implementing function by function and keeping all the tests
passing.
Reflect
In pairs, discuss: - How did we break down the problem into pieces
for TDD? - Is each piece of the design testable by itself? - Do we suffer
from overdesign?
Sample Learning Hours 91
Learning Goals
This session is a little different - the goal is not to learn about a
particular theme but rather to gain awareness.
Session Outline
• 45 min Demo: TDD the best way you know how
• 10 min Reflect: group observations
Demo
Show off how productive you can be with TDD. Practice this demo
in advance so it goes smoothly!
Use the same programming language that they use, but don’t feel
restricted to use the same tools. Do show off all the modern IDE
features and refactoring shortcuts that you’d like them to be using.
This is what I would call a “Prepared Kata”. It takes some hours of
practice to do these well. It can be hard to both type and talk at
the same time. If you can, I recommend recording the coding part
in advance. The recording can be a silent screencast showing your
IDE as you code. Do the commentary live, pausing the screencast as
needed to explain the code that is appearing on the screen. Another
variant is to ask a trusted colleague to be the typist while you navigate
them and do all the talking.
By this point you should have got to know the team a little and their
codebase. Pick a TDD exercise that is as close as possible to code they
Sample Learning Hours 92
know and actual problems that they face. Alternatively pick a kata
you’ve done together already, like Yatzy or Mars Rover.
I don’t always manage it, but my ambition is to create and perform
a new code kata based on a snippet of their actual codebase. I like
to publish the starting code on a publicly hosted git server and do
the demo on a non-company sanctioned laptop. For those reasons I’ll
anonymize any code from their codebase and only retain the basic
structure so it shouldn’t reveal any company secrets. I aim to show
them that it is possible to work in a different way even when you
begin in a codebase like theirs.
Reflect
Ask the group to write observations on sticky notes. Ask some people
to read theirs out.
Learning Topics
These are the themes I have at the moment:
• Small steps
• Refactoring Safely
• Working with Legacy Code
• Designing Testable Code
• Designing Tests
• Double-Loop TDD
• Agile
As you can see from the 10 sample learning hours in the last chapter, I
tend to have two or three in a row on the same theme before changing
to another.
Different organizations have different challenges, and I wouldn’t
necessarily use every theme in every coaching engagement or with
every team. Likewise your own strengths and interests will influence
which themes you take up in your learning hours.
For each theme, I’d like to summarize what it is about and some of
the topics I include there. If you are not familiar with one of these
topics, there is a section of references at the end of this book which
might give you some suggestions of where to learn more.
Small steps
These learning hours are all about learning how to work incremen-
tally. Instead of writing all the tests all the implementation first, we
work with both together piece by piece. This way of dividing our time
and working iteratively and incrementally on both code and tests is
key to successful TDD.
Topics:
Learning Topics 94
Refactoring safely
Martin Fowler has written an excellent book about Refactoring. It’s
well worth getting a copy and encouraging everyone to read it, even
if they only get as far as a couple of chapters. These learning hours
help you to practice the skills you need to use the refactorings in his
book and improve the design of your production code.
Topics:
Legacy Code
Legacy code is basically code that is difficult to work with but we have
to change. One of the reasons its difficult to work with is probably that
the design is poor and it lacks both modularity and automated tests.
Adding tests to this kind of code is often a chicken-and-egg problem.
You can’t add tests until the code is redesigned to be more modular,
and you aren’t confident to change the code to make it more modular
until you have some tests.
The ‘Legacy Code’ theme is closely related to both ‘Refactoring’ and
‘Test Design’, but I tend to put it in its own category since there are
techniques for handling legacy code that you wouldn’t need in other
situations.
Topics:
Learning Topics 95
Testable Design
These learning hours are all about how the need for both testability
and the ability to refactor easily affects your design choices. One of
the biggest reasons people give up on TDD is if they lack the design
skills to do it.
Topics:
Designing Tests
Structure of a Test Case, sharing setup, how to verify correct be-
haviour. Some of this is specific to the programming language and
framework you are using. Some of it is general good design principles.
Topics:
• Arrange-Act-Assert
• Styles of assertion - matchers
• Stubs
• Fakes
• Mocks & Spies
• Test data
• Consistent Abstraction levels
Learning Topics 96
Behaviour-Driven Development
Many code katas have a description that contains a list of examples
or scenarios that are easy to turn into test cases. One of the skills of
TDD is taking a vague User Story and creating such a list of scenarios.
This is something we can practice and get better at.
Behaviour Driven Development builds on Test-Driven Development
and introduces the idea of working outside-in, from the user perspec-
tive first. A more ‘classic’ TDD approach has you working inside-
out, from the nitty-gritty details of an implementation out towards
something a businessperson would be able to use. In BDD as you
work outside-in you are guided by a higher-level test written from the
customer or user perspective. As you discover more detailed pieces
of code that are needed, you also add ordinary unit tests to drive out
small pieces of functionality. You find yourself doing ‘double loop’
TDD. Coming up with those higher-level, user-perspective tests is
also something you can practice.
In a production setting, you would come up with examples and
hence test cases by having conversations with business people who
understand the problem. When we are practicing we will need people
in the group to play the role of the business person, so it’s good to
choose exercises are taken from everyday domains where you could
expect most people to readily understand the business rules. You can
discuss the domain and together come up with examples that you can
then formulate into test cases.
Agile
Games for learning about DevOps and Agile in general
I designed a Pipeline game²⁷ and a custom deck of cards for playing
it. The idea is each card represents a step you could include in
your pipeline, and you lay them out on a table in the order you’ll
implement them. You do it in a group, discussing the pros and cons
²⁷https://www.eficode.com/pipeline
Learning Topics 97
Cyber-dojo
I’ve found cyber-dojo³⁰ very useful for setting up exercises quickly,
and also for viewing what code the participants are writing during the
session. It’s a substitute for going round looking over the shoulders
of the pairs as they work. Pairs can easily switch typist too - they
both use the same URL and when it’s time to switch, run the tests
and refresh the browser.
For commercial coaching work, you will need to buy a license if you
want to use the public server. Sometimes it gets overloaded or goes
down entirely. There are instructions for setting up your own server
on the cyber-dojo github page³¹.
³⁰https://cyber-dojo.org/
³¹https://github.com/cyber-dojo/cyber-dojo
Remote Learning Hours 99
VNC
I’ve had some success using a shared remote server for group pro-
gramming. I set up a Linux machine on Amazon’s EC2 with a
graphical desktop running a popular IDE. Everyone joins the same
videoconference call, then we all use VNC to log into the machine.
This means everyone can use their keyboard and mouse to control
the remote machine, so we just agree verbally who should control
it at any one time. Switching typist takes no time at all. The main
downside I’ve discovered is that keyboard mapping from a local mac
keyboard to the remote linux machine can be a bit quirky. If people
are using Windows locally then there is much less of a problem.
Retrospectives
So far this is the part that I’ve had the most trouble with when
working remotely. People seem somehow reluctant to write virtual
sticky notes. Perhaps they feel more permanent and less private than
actual paper. At least try to get people to say out loud what they’ve
observed and make your own notes on what they say.
Part 3: Samman
Coaching
Engagements
In the first sections of the book we looked at the details of what
a Samman technical coach does in the Ensemble sessions and the
Learning Hour. This is what you spend the majority of your time on.
In this section we take a step back and look at the overall coaching
engagement with an organization. We’ll talk about marketing, sales,
persuading a team to take you on as coach, and setting expectations.
In the last couple of chapters, we’ll talk about your coaching career -
how you get started and improve as a coach.
Most of the coaches I know are consultants who engage with a
number of different organizations over periods of months and years.
That is also the way I work, and what I am explaining in this part of
the book. I believe it should also be possible to be an internal coach
in a large organization. I don’t have experience of that but I hope you
will still find useful material in this section.
Finding an Organization
and Teams to Engage with
Finding good clients is crucial for a consultant. A good client will not
only pay the bills but also give you opportunities to really make a
difference, learn new things and have fun. Let me tell some stories
about what has worked for me.
A couple of weeks before the date we’d set for the workshop, they
called to ask if they could postpone it. They had an important release
coming up and needed to focus. So we set a new date two months
later. Unfortunately the same thing happened. The team was just too
stressed to find time to do a half day workshop. I reasoned that if they
couldn’t manage half a day, they were in no position to book any more
coaching. Since I was quite busy with other work, I declined to set a
new date for the workshop. You have to be able to slow down before
you can speed up.
Sales pitch
Once an organization is interested in your services, you’ll want to
explain in more detail what you’re selling. An example sales pitch:
Samman technical coaching helps developers to change the way they
work, day to day, minute by minute, in their codebase. They learn to
raise the quality of code in their product and work more effectively
together as a team. The coach works closely with the developers while
they are writing code to remind, reinforce, teach and demonstrate
good coding practices. You should see:
than three teams, see the next section about working with larger
organizations.
• Which days you will be working and which days you are
away/unavailable
• Which teams they’d like you to coach
• Some means of contacting the teams they’d like you to coach
(email, slack etc)
Finding an Organization and Teams to Engage with 112
Your sponsor can help you to book the kick-off meetings with the
teams. You could also ask them to make reservations in the teams’
calendars for 2 hours of ensemble working plus one learning hour for
the first 10 coaching days. Having said that, you might want to wait
with those bookings until you’ve met the teams and held the ‘kick-off’
workshops. More on that in the next chapter.
Beginning Coaching with
a New Organization
Plan to spend time with teams just getting to know them before
launching into the normal coaching routine of ensemble sessions and
learning hours. It’s really important to get a good introduction. This
section contains some advice about how to get started and spend that
time well.
Ideally you schedule this ‘getting to know you’ time a week or two
before the main coaching begins, so you can do some preparation
based on what you learn.
Present yourself
Soon after you arrive, you should present yourself to all interested
parties. Your sponsor should be able to help you to find suitable
occasions. Perhaps they have a regular all-hands meeting where you
can take 10-20 minutes to present yourself. Perhaps you can visit
some of the ‘community of practice’ forums for architects, testers,
developers etc. It might be useful to set up an internal wiki page with
useful information and links on the topic.
Developers will be curious about your background, the coaching
model, which techniques you will be working on. They will want to
know ‘what’s in it for me?’ - why they would want to be coached.
You could talk about scientific research into the benefits of pair
programming and Test-Driven Development. You could tell stories
and anecdotes of successful agile teams applying technical practices.
You should explain what ensemble working is and why it is such a
useful forum for a coach.
How you present all this is up to you. You might have some slides
prepared, that’s how I usually do this. Your style may be to use a
Beginning Coaching with a New Organization 114
Architecture overview
It can be helpful to find out about the architecture of the system they
work on. Sometimes it ends up not helping at all, because you find
yourself mainly working only in a small part of it at a fairly low level.
I usually try to spend a small amount of time at least gathering an
overview.
On some of my first coaching engagements I just asked people
to sketch the architecture on a piece of paper or a whiteboard. I
discovered that the diagrams I got back were pretty vague and hard
to interpret, and often omitted important details. Recently I’ve been
getting better results by explaining Simon Brown’s C4 model³², and
facilitating them to use that format to sketch at least the context and
container diagrams. Another thing that helped, was giving them time
to prepare such diagrams in advance of the meeting.
Once you can visualize the architecture, it can help you to orient
yourself in the code during future ensemble sessions.
³²https://c4model.com/
Beginning Coaching with a New Organization 116
As well as the production code, it’s useful to know about the in-
frastructure around it. Is there a Continuous Integration (CI) server
or Continuous Delivery (CD) pipeline? How long does it take, how
reliable is it? Do you have access to test environments and good test
data? Is there any deployment automation? Are there security policies
or compulsory reviews? These are all aspects of the development
process which you might want to try to influence, that may not be
directly within the team’s control.
I try to ensure that if we write unit tests, that they will be run as part
of the build and release process. Ideally in a CI server or CD pipeline.
If they don’t have either of those things, then I will want to try to
address that. It’s great to teach developers to write unit tests and do
refactoring, but they are going to learn better if they collectively get
feedback about failing tests even when I’m not there.
I’m hoping to get a feeling for where I can help them best, and where
the challenges are in the code. Just seeing a few classes and functions
like this gives you a first impression and a starting point. During the
Beginning Coaching with a New Organization 117
Structured Discussion
Now you’ve had a look at the code you might have formed your own
opinions about what they are having difficulty with. That might not
at all match up with what they think the main issues are. You want to
spend some time listening to what they are struggling with, and that
might change your priorities. Your job is to facilitate the discussion
and mostly listen.
You could use a ‘Lean Coffee’³³ format for the discussion, so they set
the agenda and steer the conversation towards the most interesting
topics. In a similar vein I’ve found a game called ‘Speedboat’³⁴ is quite
good for focusing the discussion on what is holding them back. I’ve
also used the Liberating Structure ‘TRIZ’³⁵, to help people to bring up
issues that might otherwise be taboo. For a smaller group I might just
ask open questions and see where the discussion goes.
In a remote session I’ve done a kind of lean-coffee variant using a
shared online document (eg a Google doc or a One Drive Word doc
or a Miro whiteboard etc) to gather issues. I give them 5 minutes in
silence to write their top issues separately on their own computers.
The question I ask is something like “What are the main technical or
code-related difficulties you experience in your team?”
When the time is up I ask them to paste their lists into the same shared
document. At the same time I add in a pre-prepared list that covers
many of the problems I often see.
Example prepared ‘common problems’ list:
I give them a few minutes to read the combined list and put a vote
marker (+1) next to their top 5 issues. Once everyone has voted, we
spend a few minutes working out if two or more issues are actually
the same one and should have their votes added together. Then we
pick out and highlight the three or four issues that got the most votes.
We take a 5-10 minute timeboxed discussion on each one.
Your aim here is to give everyone a chance to speak so you can better
understand their situation. Depending on what you hear, you can
adapt the focus of your coaching. You may discover problems you
can’t solve, and will need to take up with other coaches or managers.
Hopefully though, you will discover that there are some problems
that you will be able to help with.
Takeaways
At the end of this first session, hopefully you will have gathered:
Beginning Coaching with a New Organization 119
After you close the session and the team leaves, spend a few minutes
updating your notes with what you’ve learnt.
Chartering Workshop
People generally don’t like having help forced onto them, and you
can’t assume that you know better than they do what they need. The
kick-off workshop should have given you enough information that
you can tailor your coaching for the situation, and offer each team
something valuable to them. Coaching Chartering is about making
an agreement between the coach and the team about the aims and
contents of the coaching. It’s similar to Project Chartering³⁶.
³⁶https://www.agilealliance.org/glossary/project-chartering
Beginning Coaching with a New Organization 120
Structured discussion
I tend to structure a 90-120 minute workshop into sections of about
20 minutes where I present a proposed coaching area with slides and
possibly a short demo. I follow it with a general discussion question.
My aim is to learn whether people seem to understand and like the
suggestions, and whether they feel motivated to take part in the
coaching. For that to happen I definitely need to stop talking, and
regular slides reminding me to be quiet and ask a question helps
suppress my propensity to talk too much! With a team-sized group
of perhaps 4-9 people, everyone should be able to feel they had a say,
were listened to, and have the information they need to make up their
own mind.
Let’s go through some sample section topics and discussion questions.
Beginning Coaching with a New Organization 121
Team collaboration
Less task-switching and lower amounts of Work-In-Process make
a team more effective overall, and it means learning to collaborate
and work on coding tasks together. Individual working followed by
code reviews is not always the most effective form of collaboration.
Ensemble working is a structured collaboration that enables you to
code together on one task in an effective way. You don’t have to do it
all day every day or on every single task, you should learn when it’s
going to be most useful and effective. It’s a skill that takes some time
to learn. Ask “Have you tried Pair programming? How did that go?”
Go through the roles and the rules of ensemble working. Ask “Are
you interested in learning this skill?”
Test Design
Perhaps you noticed that the test cases they have at the moment
are not very well designed. Explain that good tests will find bugs
Beginning Coaching with a New Organization 122
Testable Design
Sometimes the biggest problem getting started with TDD is that the
code is designed in such a way as to make it difficult to test. Perhaps
there is lots of global state, singletons, dependencies on external
frameworks or network calls. Demo - show some code that is difficult
to get under test because of an awkward dependency, and how to
get it tested. Would this team like to learn this kind of technique?
Object-Oriented design principles? Functional design? Refactoring to
Patterns?
short, inspirational demos with shiny tools and techniques they may
not have seen before. You’re being friendly and open and listening to
them. It ought also to be clear they’ll need to put in some time and
make an effort to learn new things.
This is a chance for everyone to be involved in deciding the exact
coaching areas for their team. This affects which learning hours you
plan as well as what kind of programming task you choose to do in
the ensemble sessions. Write down a summary of what you agree on
a single slide or flipchart paper.
I hope the team will happily agree to Samman Coaching because they
want to do this. They are intrigued and they want to learn. Everyone
understands the goals and most important activities of the coaching.
Note: not all of these were shocks on the first day of a new assignment.
On many occasions the manager warned me in advance and/or it
wasn’t the first team I coached in that organization. Ideally you would
be looking out for these kinds of difficulties and anticipate the best
way to approach a particular team.
I was skeptical, I’ve heard those kinds of things before. This team
agreed to come to a kick-off workshop and kindly showed me some
of their test cases and code. I found myself by agreeing with them
- it was good! My standard learning hours would have been boring
for this team. I also asked about their teamwork, and although they
worked very well together as a team, they had not done anything
together as an ensemble.
I presented a proposal to them - that we could work together doing
TDD (like they usually do) and learn ensemble programming too. For
the learning hours, proposed I should design some new ones for them.
We could study Approval Testing, Property-Based testing, using code
coverage and other legacy code techniques. We could learn a modern
test framework they hadn’t used before.
Happily, they liked the proposal. I also had to talk to the sponsor
about it and get their approval. I had to hold the learning hours with
this team only, not together with any other teams. I also needed
time to prepare some new learning hours. My sponsor agreed that
I could spend billable time on these extra learning hours and doing
this additional preparation. I believe everyone was happy in the end.
I certainly enjoyed working with such a competent team.
Persuasion Principles
Hopefully these stories have illustrated some guiding principles:
deadline - you want the freedom to go slowly and learn rather than
feel pressured to finish it. Pick a task which involves writing code,
adding new functionality or improving existing functionality.
By working on a normal task that the team would have worked on
anyway, you get the opportunity to coach many techniques. You can
start by doing lightweight analysis, perhaps write a failing acceptance
test, then move on to discuss design alternatives and then write the
code using Test-Driven Development. You can coach the team to take
small steps, commit often, and get feedback from the product owner
or customer representative.
Alternatively you could invent a new task to work on specifically in
this ensemble coaching. You could decide to improve some existing
code. This should be in a piece of code they anticipate needing to add
functionality to, or which is notoriously buggy. You can add test cases
and do preparatory refactorings.
The team may be well aware of their worst class or can point out
a difficult method that they need to change. If they don’t have a
concrete suggestion for which particular bit of code to refactor, there
are analysis tools that can help you. For example something like
SonarQube³⁷ or CodeScene³⁸ can statically analyse a codebase and
produce a report revealing the biggest code smells and hotspots of
questionable design. It could be a good use of your time to teach
the team to use one of these tools to analyse their codebase, before
starting on the refactoring.
typist much closer to the screen, sideways on to it. It’s important that
everyone is close enough to the screen to read the code on it. For two
hours a day for a couple of weeks, you can handle the twisted neck
you get by sitting side-on to the screen. It’s not a long term solution
though.
you will hopefully find the teams and the organization would be open
to more.
Networking
As a consultant, the most important thing is that they like you. It’s
good to be friendly, and not just with your sponsor and the teams you
are directly working with. If you’re going to keep a steady stream of
new teams and organizations booking your services, you need to pay
some attention to networking.
Networking means deliberately getting to know new people and mak-
ing new business contacts. It’s about sharing information, contacts
and experiences. Perhaps you can help one another discover opportu-
nities or decide to embark on a shared venture. As a consultant, your
network is a crucial asset for finding work. It doesn’t just happen by
itself. In this section are some ideas about how to cultivate yours.
Lunches
Before covid-19 hit, I would recommend taking lunch with different
people each day. Get out of the building, be friendly and get to know
people. If you’re at an office working with development teams, there
are likely all kinds of other people around too. Be friendly and find
out who they are. Perhaps your sponsor can introduce you to other
managers, other coaches, other TDD enthusiasts.
Turn Up the Good 134
Invite these people out to lunch one-on-one. Most people are flattered
to be asked. Just explain you’re relatively new to the organization and
trying to get to know more people. If you’re just two people eating
together it’s a better opportunity for a good conversation than in a
larger group. People open up more if it’s just one other person present.
That’s another reason to get out of the building, too. People are often
more relaxed if their colleagues are not sitting at the next table.
With the pandemic lunches are not so straightforward, you might
need some other tactics.
• A short daily email sent to the sponsor and the team’s direct
manager after the coaching day. I write 2-4 sentences describing
highlights and what the team has learnt
Turn Up the Good 135
The aim is partly to remind your sponsor that you exist, that you’re
doing useful work, and that it was worth hiring you. More impor-
tantly, it gives them a chance to celebrate the successes with you,
and feel they are a part of them.
Other coaches
All the coaches working in an organization should talk together
regularly, so they can help each other and try to steer in the same
direction. (In the same way as other specialists from different teams
get together in a Community of Practice)
Depending on which skills you feel most in need of, here are some
ideas:
Shadowing
One thing I’ve done with several people is to have them shadow me
for a day as I work. That has helped them to learn how a coach spends
their time, and whether they might enjoy doing this too.
When you shadow a coach for a day at work, neither they nor
the organization they are coaching will pay you anything. They
A Career as a Samman Technical Coach 141
will expect you to pay your own travel costs, if there are any. The
coach might ask you to pay them for any additional time they spend
mentoring you. In ensemble sessions you will see the team’s code, so
you may need to sign an NDA.
Although I recommend this, whether you yourself could find a coach
to shadow could be tricky. Any coach you approach will want to get
to know you a little before they bring you with them for a day. They
take a certain amount of cost and risk by having you join them at their
client. You should be gracious if they are not willing or too busy.
turn into. If you’ve read this book then perhaps you’re interested
enough to check out the site and find out what’s happened since the
book came out.
References
In this section I’ve listed some references for where I learnt about
technical agile topics myself. I don’t want to suggest you have to read
any of the books I mention here. There may well be newer and better
things to read these days. This is a selection from my shelves of books
that have made a significant impression on me in my coaching work.
Refactoring safely
• “Refactoring” by Martin Fowler - the 2018 edition is a classic
already
• “Refactoring to Patterns” by Joshua Kerievsky which bridges
into the software design topic
Legacy Code
• “Working Effectively with Legacy Code” by Michael Feathers.
It’s still a classic.
• Arlo Belshee has written a lot of useful stuff on his blog⁴², par-
ticularly worth reading his posts about ‘Naming as a Process’⁴³
• I hope to write a book called “Approval Testing”. Watch out for
that one in the next few years.
⁴¹http://codemanship.co.uk/tdd_jasongorman_codemanship.pdf
⁴²http://arlobelshee.com/
⁴³https://www.digdeeproots.com/articles/on/naming-as-a-process/
References 146
Testable Design
• “Practical Object Oriented Design in Ruby” by Sandi Metz.
• “Agile Software Development Principles, Patterns and Practices”
by Robert C. Martin. It describes the SOLID principles amongst
other things.
• “Software Architecture for Developers” by Simon Brown
Designing Tests
• “Growing Object Oriented Software Guided by Tests” by Nat
Pryce and Steve Freeman covers many related topics, but since
they largely invented the idea of using Mock Objects, it’s
particularly worth reading what they have to say about that.
• “Modern C++ Programming with Test-Driven Development” by
Jeff Langr
• “The art of Unit Testing” by Roy Osherove
Behaviour-Driven Development
• The BDD Books⁴⁴ by Seb Rose and Gaspar Nagy
• “Specification by Example” by Gojko Adzic.
Teaching
• “Training from the Back of the Room” by Sharon Bowman
• “The Ten-minute trainer” by Sharon Bowman
• “Using Brain Science to Make Training Stick” by Sharon Bow-
man
⁴⁴http://bddbooks.com/
References 147
Other
• “Accelerate” by Nicole Forsgren et al. She has the data to show
which development practices make a difference. Successful orga-
nizations have a Generative culture and do Continuous Delivery.
Well worth reading.
• “The Phoenix Project” by Gene Kim. A good story with a
purpose.
Image attributions
• movement, passengers, jump, drawing by Adrien Coquet from
the Noun Project
• listening by Ragal Kartidev from the Noun Project
• flipchart by Simon Sim from the Noun Project
• Book by Ronald Cortez from the Noun Project
• Stopwatch by celine labaume from the Noun Project
• Calendar by Shmidt Sergey from the Noun Project
• Cat, Chicken, Teddy Bear by Amethyst Studio from the Noun
Project
• Paper People Cutout by Andrew Koszkalda from the Noun
Project