On Mentoring and Being Mentored

April 22nd, 2018

Background

Why would I choose to write about mentoring?

I guess it’s a topic that I’ve pondered over the years, ever since my first job out of university. During the couple of years I worked at TNT I didn’t benefit from any formal mentoring. However, when I think of who had a big impact on my learning on the job, there were certainly a couple of people who immediately come to mind.

But it was when I arrived at IBM that I was struck by the fact that everyone in the team was allocated an adviser. So I knew that, if I ever had any questions about anything, I could approach Rod, my adviser. I knew he had a wealth of experience and found his help invaluable. What impressed me even more was the fact that the company considered mentoring important enough to implement such a scheme.

That was back in 1986. Fast forward to 2018 and I’m in a very different situation, keenly aware of the need for young programmers with whom I work to have good mentoring.

So, several weeks ago, at RubyConf AU, when Alaina Kafkes challenged those in the audience of her talk about Tackling Technical Writing to publicly commit to writing about a particular topic, my response was:

And given that Sean was generous enough to say that he’d read what I had to say on this topic, it’s only fair that I put words to the screen and share my thoughts.

Mentoring Others

Meaning

Before I dive into my thoughts about mentoring others, I think it pays to pause and consider the meaning of the word mentor. The dictionary on my Mac defines a mentor as:

An experienced and trusted adviser.

Now that we have that definition out of the way, let’s consider what it takes, in my experience, to be a good experienced and trusted adviser.

Patience

One thing that I consider to be vital when mentoring is to be aware of the right time to offer advice. As a parent I’ve come to learn that one has to be patient and wait for the right moment. Or, to borrow from another context, I love the quote from Jack Gibson, the Rugby League coach, who said:

“A good coach thinks twice and says nothing.”

In other words, try to cultivate a sense of recognising moments when your colleague is ready for advice. It’s important to allow them the time and space to try to figure things out for themselves. You’ll usually know when they’re ready for your advice. They’ll ask you a question!

On the other hand, there will be times when your colleague could use some advice but doesn’t ask for it. So make it clear that he or she is welcome to ask questions about anything.

And then wait.

Provide a framework

It’s one thing to encourage your mentee to ask questions. However, to provide them with the basis to ask good questions that will help them learn, a framework will help.

What do I mean by a framework?

To begin with, something that provides structured learning. To be fair to your colleague, they’ll need training to help them be most effective at their work. Appropriate training will help the developer feel that they have ascended to a new level and give them confidence. That confidence should translate into a greater preparedness to attempt new tasks and, importantly, spark questions that will further improve understanding.

Also, it’s likely that different members of the team will have different strengths. Part of my envisioned framework is a skills matrix. For each skill there will be specialist mentors as well as a set of training resources.

In the early stages of implementing a mentoring program for a team, there may be a few gaps and imbalances in this matrix. For example, a skill that is important to the team may be Ruby Performance Optimisation. However, there may be nobody in the team that has sufficient strength in that skill to mentor others in the team. A next step to start filling that gap may be to identify some training resources, allocate one developer to complete that training and then become the mentor for that skill.

Continuing in this way, the skills matrix should start to take better shape. The aim should be to manage its evolution so that there is an even spread of mentors across the skills that are important to the team.

Everyone is different

Naturally we all differ. We gravitate towards different skills. We think differently. We have different needs.

So, in my perfect mentoring world, the needs of every individual should be provided for by a mentoring program that is fine-tuned and continuously adapted for that person. In practice this may not always be possible to the ideal degree. However, I think it is worth striving for.

Consider the other’s viewpoint

Perhaps this point is obvious.

However, I think it’s worth stating explicitly. Whether it’s during the process of creating and maintaining a mentoring framework, or in the act of mentoring, it pays to put oneself in the shoes of the other.

What are they keen to learn? What do they think they need to learn in order to do their job better? What do you think they need to learn in order to do their job better?

It pays to explore these questions in an open manner.

Pairing

Working as a pair, where one developer is a mentor and the other is more focussed on learning, can be an effective way of enabling a junior developer to grow. Whilst in general a more typical pair programming approach would involve two developers who are on a more or less even footing, switching the driver and navigator roles, a mentor/mentee pair offers an effective learning experience.

Having said that, there is a caveat. When there is a marked difference in skill levels, pair programming can be intensive and tiring, especially for the mentor. So it is important to be aware of this and provide sufficient breaks between pairing sessions. Ideally, as Ryan Bigg emphasised in his talk about hiring juniors at the recent RubyConf AU, a task that can be completed within two to three days is a good choice for this style of pairing.

One-on-one

As I alluded to previously, it’s important to consider the point of view of the person you are teaching. It’s not going to be surprising for them to feel self-conscious, even overwhelmed at times. So, as a caring mentor, ensure that there will be regular opportunities to catch up with your colleague in a one-on-one context.

I’m reminded about a coaching context again. When you’re coaching a team or a group, it pays to offer praise in public. It makes the recipient feel good. A little bit of an ego boost goes a long way.

On the other hand, if there’s a need for some constructive criticism, this is obviously best given in private. Nobody likes to be given negative feedback in front of their peers.

Being Mentored

Identifying mentors

When you’re a younger worker, learning your craft, it shouldn’t be difficult to identify trusted advisers. However, as one grows older, mentors aren’t as easy to identify. I know that from experience.

And I have to admit that in recent years I have struggled to find a single person who I can look to for advice as my professional advisor. When I consider my experience over the last decade or so, it leads me to reflect on the various needs I have for advice.

Perhaps, in my case, as an older, experienced IT professional working within a small group of developers, I need to be more flexible in the way I seek advice.

Relevant experience

My need for advice may stem from different sources.

In a more general, career sense, given that I’m closer to 60 years of age than 50, it’s likely that I need to look broadly to find someone who can give me appropriate career advice. Or, perhaps, I need to consider my own counsel. However, having said that, I think that’s probably a lazy response. Even though it will take more effort, I think it’s worth my while to keep searching for someone who I feel I can trust to give me good advice about how to approach the closing decade of my career as a software developer. Such an advisor will most likely outside my usual circle of professional colleagues.

Then again, my need for advice in a professional context may result from other sources. Perhaps I will need specific technical advice?

Younger mentors?

It shouldn’t be surprising in the context of professional software development as a senior practitioner to encounter situations where younger colleagues have greater expertise in specific disciplines and technologies. One only has to think of the latest JavaScript framework to develop a keen appreciation!

I’m certainly not too proud to seek advice from younger developers about technologies such as React and Webpack, for example.

So I guess, in essence, I think I should be prepared to seek and accept advice from different mentors for different topics.

Getting specific advice

At any stage in one’s career I think it makes sense to be flexible about seeking specific advice. Obviously some people are going to have greater expertise in particular topics than others.

In my own case, I think it definitely makes sense to think of seeking advice in specific terms. Who has the best advice to offer about specific skills?

So, when I’m looking to be mentored, it probably makes sense to consider the same matrix that I proposed earlier.

Wrapping up

One of the things I love about working as a software developer is the opportunity for learning and teaching.

It’s pretty rare to go through a career in software development without working as part of a development team. Every member of a team needs mentoring and most will be in a position to also help others in their team. Even if you spend much of your career as a freelance developer you will benefit from and be in a position to provide mentoring.

I hope this post has stimulated your thinking in some way about mentoring.

After all, when you think about it, it’s a two-way street. There are obviously going to be times when you need advice. So, it seems only fair that you be prepared to offer advice as well!

Tags: mentoring advice peopleware | Permalink | Comments (0)

Moving on to Birdsnest

December 8th, 2017

For the cast of thousands who hang off every word that I write on this site I am delighted to announce that I will be commencing a new role in the new year!

In January I will be starting work as a Senior Software Developer with Birdsnest, an online retailing company based in Cooma, NSW.

Whilst I will be based at my home office on the NSW Central Coast, I will be making regular visits to Cooma to work with staff on-site, especially the software development team.

Birdsnest is an inspiring company that offers a unique online shopping experience.

I look forward to working with the development team to help them build upon their successes to date.

Tags: permanent roles birdsnest | Permalink | Comments (0)

Available in the New Year

November 20th, 2017

The new year promises to bring new challenges.

Yes, having contributed to The Conversation’s development team as a contractor since June 2015, I will be moving on in late January, or earlier if I am able to provide fair notice.

I’ve very much enjoyed the opportunity to work with The Conversation over the last two and a half years and will have fond memories of collaborating with development colleagues as well as editors of the various editions around the globe.

What’s next?

I’m open to both consulting and permanent roles. If you’re looking for a seasoned, passionate software developer who has a track record for helping people by solving problems, please get in touch.

Tags: consulting permanent roles | Permalink | Comments (0)

On Non-Determinism

November 1st, 2017

It’s something that irks me.

I’ve seen it time and time again. Martin Fowler was moved to write about it and speak about it in 2011. I’ve stressed it’s importance many times since. Again recently I was moved to share it:

Resistance

My observation has been that developers are resistant to accepting the challenge of battling the scourge of intermittently failing tests.

What is the reason for this resistance? This is something that has intrigued me for years. And I’d like to delve into it in a little more depth.

Time and Effort

I suspect that part of the human impulse to resist addressing non-deterministic tests is the intuition that to accept such a challenge might lead to much time and effort expended for little result. If that is the case, believe me, I understand. Fixing this sort of problem is not for those faint of heart!

Having experienced the struggle of identifying what causes an intermittent failure, I know it isn’t easy to unearth the root cause.

Quarantining

In my experience there is a palpable resistance to Martin Fowler’s suggested approach of quarantining non-deterministic tests. On one level, this bewilders me. As Martin illustrates, if a test cannot be relied upon to pass or fail, it is worse than useless. It is infecting the whole test suite. So, the sane approach is to, at least temporarily, remove it from the test suite.

Whenever I have suggested this, I have been met with resistence. Developers claim that the test is useful, that it provides protection as part of the regression suite against bugs being introduced. I’m still searching for a way of countering this argument, which is clearly fallacious. As Martin quite rightly asserts, if a test cannot be relied upon to pass or fail against the same codebase, it is worse than useless and must be immediately quarantined!

Sure, there is extra effort involved in configuring the quarantining process. The use of RSpec tags is handy for this. Then there is the perceived risk of the team forgetting to fix the quarantined test. Again, it requires some effort to set up, but it is certainly possible to automate warnings to the team about tests that have been quarantined for too long as well as build pipelines that contain too many quarantined tests.

Removal

Of course, another possible response to a troublesome non-deterministic test is to simply remove it from the suite.

This may sound radical, but let’s consider the situation from a cost/benefit perspective. If a test cannot be guaranteed to reliably pass or fail then it is clearly not providing much benefit. If it takes considerable effort to debug and still cannot be guaranteed to reliably pass or fail, what should the developers make of it? It has clearly already absorbed considerable cost. This leaves the question of potential benefit.

A related question is: how crucial is this test as part of the suite? Is it a vital part of the test suite? If the answer to this question is “yes” then it is appropriate to continue trying to solve the non-deterministic behaviour. However, if the answer is “no”, there seems little value in keeping the test within the suite.

Laziness

People are naturally lazy. Why do something that requires effort unless you really have to or there is a clear benefit that will accrue to you?

If a developer is working on a pull request, pushes a commit and the resultant build on the CI server fails with an error that is obviously unrelated to their pull request, what’s the easiest thing to do? Click the button to rebuild the test, of course! The temptation to take this action, even if the developer in question has the appreciation that this may not be a helpful response in the even slightly longer term for his or her colleagues, can be compelling.

I’m not sure of the best way of countering this. Appealing to the greater good?

Priority

Usually when a developer notices an intermittently failing test their focus is elsewhere. They may be working on a feature and notice that the build fails due to a non-deterministic test that is unrelated to their feature. Or they may be watching the master build in preparation for a deployment. Understandably the priority in these scenarios is to enable the feature to be merged or the deployment to go ahead.

The key here is to at least take some action to fix the non-determinism, even if it is to schedule some work to rectify the situation later. Unfortunately, in my experience, the tendency is often to ignore the intermittently failing test.

Causes

As Martin Fowler points out, there are many causes of non-deterministic tests. Among them are:

  • lack of isolation
  • asynchronous behaviour
  • remote services
  • time
  • resource leaks

Each of these deserves an article on their own. In Rails applications, the type of intermittent failure I’ve seen most is due to asynchronous JavaScript. Indeed, it is interesting to note that An Empirical Analysis of Flaky Tests found that 45% of flaky tests were due to the test execution making an asynchronous call and not properly waiting for the result of the call to become available before using it.

Much has been written elsewhere about dealing with non-deterministic tests that use RSpec and Capybara. For example:

Added to this, Keith Pitt has detailed 5 ways we’ve improved flakey test debugging, which focuses more on how to capture the database state when a test fails intermittently.

They are all worth reading. However, what I’m pondering in this article is more to do with motivation.

A Way Forward

How can we best encourage developers to tackle non-deterministic tests?

Expecting the person who first notices the failing test to fix it is probably not a good approach. After all, that person is likely to be feeling frustrated or even angry that an unrelated test failure is holding up their progress.

A colleague of mine recently suggested assigning the task of fixing a non-deterministic test to the last person who changed that test. It’s a helpful suggestion that at least circumvents the frustration that I wrote about earlier. It also assumes that the team member assigned to fix the flaky test is willing and capable.

Of course, keeping a CI build healthy is a shared responsibility. The build is more likely to be healthy if all members of the team contribute to meeting the challenge posed by non-determinism.

A Parting Thought

In my case, one thing I need to be mindful of is to be careful not to let the frustration that I sometimes feel become counter-productive. As Kent Beck implied a while back, as well as working in small increments, it is important to be both kind and honest.

If I follow that advice hopefully I will respond to discovering non-deterministic tests by gradually finding ways to help the team to handle the challenge of fixing them more successfully.

Tags: non-determinism continuous integration testing | Permalink | Comments (0)

Achieving Flow in a Development Team

June 1st, 2017

One day last June I was moved to share an opinion on Twitter.

And as the following exchange shows, at least one reader, my former colleague SengMing Tan, expressed a desire to know more.

As I foreshadowed, it has taken me a while to get around to elaborating.

However, the time has come. After nearly a year has elapsed I am fulfilling my promise.

Here is a description of how the team I’ve been working in at The Conversation uses Kanban, Trello, GitHub, Buildkite and Babushka to develop, review and ship software in a way that encourages flow.

Tools and Techniques

Kanban

Whilst there are several tools that we use which combine to help our team feel that we are constantly making progress towards shipping software, it is the Kanban system which underpins them.

As I understand it, the team started out with a low-fi approach by using a physical card Kanban wall. But by the time I joined, they had moved that wall to Trello. Which was just as well, because I was the first remote member of the development team.

Nevertheless, I think it is the Kanban style of only allowing a specified maximum number of cards in each “swim lane”, that is crucial to the overall feeling of progress that our team has.

Trello

As anyone who has used Trello knows, the general style is to represent progress by aiming to move cards from left to right across the columns. Whilst there are other columns on our development board, the following image depicts those that are essential to the way Trello supports our Kanban style of development.

I’ve blurred out the details of the cards but the key things to notice are the column headings. Notice that we have upper limits set for how many cards should be Queued, In Progress or under Review. This helps us each individually focus on completing a piece of work. As a team, it draws attention to ensuring that work is reviewed in a timely manner. If more than six cards are in the Review column, we consider that to be a broken state. It is a prompt to the team to give more focus to reviewing pull requests until we can merge enough of them and move the corresponding Trello cards to the Ready column.

There are other columns on our development board such as Confirmed to the left and Complete to the right of those shown in the screenshot. And we have other boards. However, in the context of how we use Trello to help the team achieve flow, the four columns shown demonstrate what is at the heart of how we use Trello.

GitHub

One of the things I like about the paid version of Trello is the various Power-Ups. I find the GitHub Power-Up particularly useful. As I have written elsewhere, when I’m working towards a solution I prefer to share code via a pull request as early as possible. Fortunately our team has a strong culture of providing respectful feedback via pull requests.

There are times when I feel the need to gently prod my teammates to provide feedback on my pull requests. However, once the conversation within the context of a GitHub PR starts, it is usually very helpful. I like the way the tone of our comments tends to be questioning and curious rather than judgemental.

Once a Trello card, with a linked PR, is designated as available for review, it is important for the team to give it timely attention. Occasionally attention is diverted elsewhere. For this reason our team programmed our Slackbot to inform us if a card has been in the Review column for too long. To me this is a helpful prompt to keep contributing to the effort that will result in shipping software. Speaking of Slack, its integration with GitHub is an obvious boon. Being able to see via our main #dev Slack channel when a PR is created or merged certainly helps teamwork.

Being able to easily trace code changes in a PR that result from a Trello card is wonderful for maintaining flow. Did I mention how much I love the Trello GitHub Power-Up?

Buildkite

The ways in which Buildkite can assist teams achieve flow is worthy of a post in itself. For the purposes of this discussion, I’ll confine myself to the way Buildkite is integrated into our team workflow.

We use Buildkite to automate our continuous integration builds. Unsurprisingly it is integrated with GitHub so that it’s easy to see whether or not the build has passed for the latest commit on a PR. Then there is the Slack integration, which I find useful as another prompt about the success or failure of builds. There are times when the first place I’ll notice a build failure is via our #buildkite Slack channel.

Obviously part of achieving flow is ensuring that the build for a PR is successful before that PR is merged. And, of course, the build for the master branch must be green_heart before we can deploy.

Babushka

Whilst we have not yet reached the point where we continuously deploy our software, we do typically deploy applications several times each day. The tool that helps us ship software is Babushka, courtesy of an alumnus of The Conversation, Ben Hoskings.

Babushka may not be as well known as other tools which support deployment but it has served our team well so far. Once a master build is green_heart for an application and we are ready to shipit, it is a simple matter of entering babushka ‘SHIP IT’ at the command line and the defined dependencies will enable babushka to deploy our software.

Summing Up

It’s all about flow. As emphasised by psychologist Mihály Csíkszentmihályi, in a personal context flow is “the mental state of operation in which a person performing an activity is fully immersed in a feeling of energized focus, full involvement, and enjoyment in the process of the activity.”

Translating this concept into a software team, we can see that it is important to remove as many barriers as we can to the team being fully immersed in shipping quality software. The Kanban approach supported by various integrated tools can certainly help in this regard.

And, in my experience, it can be fun too!

Tags: agile teams flow | Permalink | Comments (1)