Chapter 6. Building the Right Team

Ocean’s 11 is one of those heist films that shows up on everyone’s list of favorites. It starts off with Danny Ocean getting released from prison. He meets up with his partner-in-crime and friend Rusty Ryan to propose a heist. The plan is to steal $150,000,000 from three Las Vegas casinos: the Bellagio, the Mirage, and the MGM Grand. The two thieves know they can’t pull of the heist alone, so they start gathering a crew of criminals including a former casino owner, a pickpocket, a con man, an electronics and surveillance expert, an explosives professional, and an acrobat.

The team splits up into two groups: the first group gets to know the ins and outs of the Bellagio, learning the routines of the staff and gathering details on how casino operates; the second group builds a replica of the casino vault to practice maneuvering past its challenging security system. Within a few days, the group hatches a plan. High jinks ensue, hurdles are dodged, and (spoiler alert!) the team eventually escapes with the cash.

Ocean and Ryan could never have robbed the Bellagio alone. Not only would they have needed months to gather the financial resources required to prepare for the heist, it’s unlikely that they could have concocted a reasonable plan to bypass the casino’s defensive measures requiring only the two of them. By assembling a team just the right size with just the right skills, they cut down on their execution time and increased their chances of success.

To successfully execute on a large refactoring effort, we need our own “Ocean’s 11”. Danny spent months iterating on his heist while locked up in New Jersey; from his blueprint, he derived a list of expertises he needed, along with the names of potential candidates with these abilities. In this chapter, we’ll learn how to assemble different kinds of teams depending on the kind of expertise we require to best execute on our refactoring effort. As technical leads, we’ll learn how to narrow-down our list of potential teammates and convince them to join us on our journey. Finally, we’ll talk through how to make the best of an unfortunate situation: needing to execute on the project alone.

Identifying Different Kinds of Experts

In Chapter 4, we learned how to draft an effective plan of action. We learned how to capture and synthesize the important complexity of our refactoring effort in a few, concise, top-level milestones with a handful of critical subtasks.

Because most of us work on a team with a few other engineers, there’s a strong likelihood that our plan was derived cooperatively and we intend to execute on it as a team. When executing a large-scale refactor, however, we almost always need some help from colleagues on different teams across the company. On the other hand, there are instances where we scope out and plan a refactoring effort either alone or with just one or two other engineers. In either case, we can use our plan to figure out precisely which engineers we’ll need and when.

We can start by re-reading through our plan. As we go through each step, we try to visualize the code we’ll need to interact with. Are we able to conjure it up easily? Are we able to confidently identify the changes we need to make and reason through the potential impact or downstream effects of those changes? Do we understand the pitfalls we might run into in the given area of the codebase? Do we understand the potential product implications of the changes we want to make? Are we deeply familiar with the technologies we’ll either be using directly or indirectly interfacing with? If so, great! We’re probably in a good position to make those changes ourselves. If not, then we’ll need someone else’s help. We can enlist someone for help in one of two ways, either as an active contributor or as a subject matter expert.

An active contributor is heavily involved with the project ideally from day one. They are actively contributing to the effort by writing code alongside you. Active contributors should be consulted for input on the execution plan early and through each of its revisions.

Subject matter experts, or SMEs for short, are not active contributors to your effort. They’ve agreed to be available to talk through solutions with you, answer questions, and maybe do some code review. While their contributions can be very meaningful, their time commitment to the project is minimal. Their primary focus remains on other projects distinct from yours.

Let’s make this a bit more concrete by working through an example project. Your company’s monitoring and observability team is migrating from one metrics-collection system to another (maybe StatsD to Prometheus). They’ve built up the infrastructure, provisioned some nodes, and are now ready to start accepting traffic from your application. The team needs one or two developers who are intimately familiar with how the application uses StatsD to help with the transition. Being one of those people, you’ve decided to lend a hand by writing a new internal library to interface with the new solution and ultimately replace the current library. You’ll need to ensure that the Prometheus library offers feature parity with the current one, and a clean, intuitive API. Your final task will be to establish best practices around using the new library and encourage its adoption across the engineering organization.

You don’t need to have intimate knowledge of how the new metrics-collection system works in order to do your job proficiently. You can lean on the monitoring team when needed and they can lean back onto you if they notice something odd about the integration process with your application. In this example, you’re an active contributor collaborating with the monitoring team.

While auditing uses of the StatsD library, you notice that another product development team is using it in a way that is distinct from most other teams. You want to understand why the team is using the library in this way, and if they absolutely need this behavior replicated in the new system. If they do need this behavior, then you have to make sure that Prometheus is able to accommodate it. You reach out to a few folks on the team to see if they might have time to answer your questions. One of them, let’s call them Frankie, eagerly agrees to meet with you. After a quick chat, you come to the conclusion that the behavior should be supported in the new Prometheus library and Frankie’s agreed to review your code as you build out the functionality. Frankie, in this scenario, is a subject matter expert.

You might need a number of different types of expertises to successfully execute on your refactoring effort. With our metrics-collection example, we needed the monitoring team’s technology expertise with StatsD and Prometheus, Frankie’s product expertise with a specific set of use cases, and our own expertise with how the codebase uses the metrics-gathering libraries at large. We might even want to consult with someone from the security team to confirm that no sensitive customer data ends up flowing through the new system (and if it does, we have measures in place to swiftly contain it).

When enumerating each of the expertises you’ll likely need, keep an eye out for a range of expertises. Refactoring at scale typically impacts a large surface area, so it shouldn’t be surprising if you end up with a lengthy list. Don’t worry, we’ll learn just how to narrow that list down next.

Matchmaking

We’ve now successfully drafted up a list of expertises we want available to us while we execute on our refactoring effort; for our metrics-collection refactor, we need a technology expert, a product expert, and finally a security expert. Alongside each of the expertises, we denote the major project milestone at which point that expertise will be needed; if the expertise is needed throughout multiple milestones, simply note the earliest milestone when their help will be needed. Our final step before beginning to brainstorm potential experts is to label whether we think we’ll need a subject matter expert or an active contributor for each expertise. We can pencil this in for now because the role we anticipate the expert to have might change as we meet with potential candidates and get work out their involvement with the project.

Finally, we have to match up each of these expertises with one or more people. Start from the beginning of the list and for each item either write the first few names of individuals or teams that comes to mind.

If you work at a large company or haven’t gotten to know folks across different engineering teams, you may have a difficult time coming up with experts for each expertise. That’s ok! You can start off by identifying a department. If you have access to an updated organization chart, use it to try to locate the best team within the department you identified. Do not be afraid to leverage your manager to help you generate and subsequently reduce the list of experts. Part of their job is to make sure that the team has all the resources it needs to efficiently execute on projects and they likely have much better visibility into which teams across the organization are well-suited to help out.

Tip

If you don’t have access to an updated organization chart but your engineering team has on-call rotations and uses a service like PagerDuty to alert engineers about incidents, you might be able to find the right experts by referencing these rotations. Look for the feature or infrastructural component for which you’re seeking an expert and find the team with the corresponding on-call rotation. Voila!

Continue to jot down names until you’ve run out of items. Table 6-1 shows an example list we came up with for the metrics-gathering migration.

Table 6-1. A list of expertises and potential experts
Expertise Milestone Role Expert

Understand how the order fulfillment code uses StatsD (distinct from most other product features)

1

SME

Frankie, Mackenzie, Order Processing Team

Automated end-to-end testing between library and Prometheus

2

active contributor

Jesse, Automated Testing Team

Monitoring application traffic to Prometheus as teams begin to adopt it

3

SME

Monitoring Team

How our application deployment pipeline will affect Prometheus nodes

1

SME

Jesse, Release & Deploy Team

Security implications of gathering metrics about customers; security-conscious customers we should be particularly careful about monitoring

1

SME

Product Security Team

Experts of Many Trades

Next, highlight any names that pop up more than once. There isn’t much overlap in our example set but we notice that Jesse might be a good candidate for two of the five items. Depending on a number of different factors including the size of your engineering organization, and the average tenure of an engineer, there can be quite a few senior individuals who have a breadth of expertises, many of which could be helpful to your refactor. Conferring with someone who happens to be an expert on multiple relevant topics can be helpful on many fronts.

First, it can help us decrease the total number of people we’ll need to coordinate with in order to complete our project. Coordinating a large project on a single team can be difficult, never mind coordinating a large project involving multiple developers across a number of different teams. Each contributor not only has to be pitched on the effort and brought up to speed, but they must also adapt to your team’s development process (i.e. weekly or daily stand-ups, monthly retrospectives, etc.) It can take a considerable amount of time and effort before everyone is well-aligned and operating at a good pace.

Second, experts who happen to have a deep understanding of multiple important aspect of the project likely have a strong perspective on how these pieces work together. This can be very valuable insight shared by very few other engineers at the company. Given our sample list of experts in Table 6-1, Jesse is likely one of those individuals. From our conversations with them, we know that they’ve worked closely with the Release & Deploy Team over several months to help them build a percentage-based release system for two important services at company. We also know that after that project, they moved to the internal tools team where they’ve worked to improve the availability of automated testing environments. Jesse is just one of those engineers who’s been at the company for a while, worked on a laundry list of projects, and has keen insight into how each of these pieces work together.

Unfortunately, people like Jesse can be quite busy (probably because they’re providing input on a number of different projects as an SME in addition to leading a few of their own). If they are not available to help in a regular capacity but you believe their unique knowledge is critical to the refactoring effort, offer to have them review your execution plan. I’ve found their input particularly helpful with regards to verifying my least confident time estimates. If you’re looking for an expert to be actively involved in your project, they’ll be able to suggest another expert or two to replace them.

If very few names (or none at all) overlap and your list of required expertises is quite lengthy, not to worry! You can still successfully execute on a large-scale refactor with just a handful of resourceful individuals.

Revisiting Active Contributors

For me, a good rule of thumb is to limit the number of active contributors to the size of team you’ve been most comfortable working with in the past. If you’ve been on successful product engineering teams of six, then limit your team to six active contributors. Everyone’s experience working with different teams at different companies is a little bit different; you know yourself and your preferred working conditions best, so go with what you know to be most effective. Large refactoring projects are plenty complex enough from both a process and technical standpoint; don’t let your team be yet another potential curveball.

If your list of active contributors feels too long, review your list and see if there are any expertises for which you can instead seek out the help of a subject matter expert. Coordinating with SMEs come at a much lower coordination cost because they are only consulted on an ad-hoc basis. We’ll cover some strategies for effectively communicating with SMEs in Chapter 7.

Biases in Our Expert List

If we happen to know someone who could be a valuable expert on one or more of the items on our list, we might ask them for their help directly. Chances are, they’ll be more than happy to help out. After all, asking someone you know is probably the most convenient option. If you’ve worked together previously, you’ll be able to establish a cadence that works well for both of you pretty quickly and begin making some salient progress early.

Asking a colleague for help directly can have its drawbacks, however. Software engineers are notoriously bad at estimating how much time and effort a task will take. This is often a consequence of the relentless optimism that being a software engineer requires. When something seems like a small ask, sometimes our colleagues can be a little too quick to say yes, not taking much time to properly scope the commitment. They may only realize well after the project’s kicked off that they’ve said yes to a few too many things and are now struggling to juggle it all. (I’ve been that person and trust me when I say that saying yes to too many things is just as unhelpful as saying no to everything.)

Another problem with asking a colleague for help directly is that you might overlook others who are better suited for the role. We all suffer from a number of biases we must consciously work to counteract. One such bias is recency bias, where we tend to recall things we’ve seen more recently more quickly. We are more likely to list a colleague as a good potential expert if we’ve heard their name or spoken to them more recently. We need to mindful of that bias before we finalize our expert list and take a minute to question whether each expert truly is the best one for the job or if we just happened to see their name CC’ed on an email a few days ago. If we think there’s a chance there might be a more qualified candidate, we should do our research and consider reaching out to a team rather than an individual. Managers of expert teams can vet your request for help to each of their developers and gauge interest. Great managers will identify those on their team who could contribute meaningfully but also would benefit the most from the visibility and career growth of contributing to your refactoring effort.

It’s also important not to confuse expertise with seniority. While Frankie might not be the engineer with the most industry experience nor longest tenure at the company, but they’ve made significant contributions over the past few months and you’re confident they can answer your questions and offer valuable insights in code reviews. Sometimes, the most senior person might not be the best co-conspirator; oftentimes these developers are very busy leading demanding projects of their own and their time is more valuable elsewhere. Your project might also be a prime opportunity for someone to get valuable exposure and visibility beyond their immediate team. Refactoring (particularly refactoring at scale) can be a tricky endeavor but it’s not one that engineers with just a years (or even months) of experience can’t meaningfully contribute to and learn from.

Note

If you’ve highlighted a team as being a good set of expert candidates, I recommend reaching out to their manager directly so that they can vet your request to their team, gauge interest, and help identify a number of potential candidates. Asking the manager for their input in choosing one or two experts from their team can help you minimize the biases you bring to the recruitment process.

Types of Refactoring Teams

We’ve spent quite a bit of time in this chapter talking about forming a team. But what about your existing team? Are you the best suited group to take on the proposed refactoring effort? In order to set yourself up for success as a technical lead for your team, you have to understand why your team is best positioned within the context of your organization to take the project on. There are generally three kinds of teams that undertake large-scale refactoring projects.

Owners

This kind of team owns a particular piece of the product and are refactoring code that they primarily own or are responsible for. This code interfaces with other teams’ code at some number of boundaries. At those boundaries, they must figure out whether to make the changes themselves, or coordinate with the engineers whose code they are interfacing with to make the necessary changes.

Say, for instance, you work at a company with three broad engineering groups: developer productivity, infrastructure, and product engineering. You are on the team responsible for testing libraries and tooling for your application within the developer productivity group. While it’s always great that engineers across the organization are writing more unit tests, you’re worried that the amount of time required to run them all has begun to hinder everyone’s ability to ship code quickly. With performance in mind, you start tracking timings for individual unit tests, gathering metrics on how long certain operations like setting up a complex mock state take. Your team decides to kick off a refactor focusing their efforts on speeding up the mock set-up process. While benchmarks for the new version show a drastic improvement, existing unit tests will need to be migrated to use the new set-up logic in order to benefit from the speed-up. There’s two main ways to go about the migration:

Option 1: One team does migrates all tests

The first option is for your team to migrate everyone’s tests for them. This approach has some distinct advantages. Your team is the most familiar with how to best migrate a test from the old to the new mocking logic; you know which kinds of tests lend themselves to easy migrations, the pitfalls to avoid with trickier tests, and how to maximize usage of the new mocking system to reap the most performance improvements. Your team is likely also the most motivated to execute on the migration. As owners of the testing framework, you’ve decided that this is a top priority. You’ve likely set some quarterly objectives around decreasing the amount of time required to run the full testing suite. Knowing you’ll be evaluated on whether your team achieved that goal is very motivating (especially when nearing the end of the quarter).

On the flip side, there’s thousands of tests to migrate. Your team might develop a clever way to use code modification tools to migrate some of the easiest migration automatically, but that would only get you a small percentage of the way to completion. If you divvied up the remaining callsites evenly across your team, it might still take you weeks of manual, repetitive work to move everything over to the new system. Your team is also not intimately familiar with what each of these tests is actually testing. As much as we’d like to assume that the tests treat the current mocking system as a black box, we can’t always predict how tightly-coupled the tests might be to the behavior of the existing implementation. There is a strong chance that we will eventually need some context on what (and how) the test is attempting to test target functionality in order to properly adapt it to use the new mocking system.

Option 2: Teams update their own tests

The second option is for the teams in the product engineering group to migrate the tests related to the features that they own themselves. With this approach, your team no longer needs to tackle thousands of tests alone. By distributing the work across the engineering organization, there’s a strong chance that the positive impact of the migration will be experienced much more quickly. Engineers on your team also don’t need to worry about deciphering how some of the trickier tests work on their own. With each team tasked with updating their own tests, they can do a much more effective job of retaining the intended behavior of the test. (As an added bonus, teams participating in the effort are given a great opportunity to critically review their current test coverage and maybe even improve it beyond shedding a few seconds at runtime.)

This approach comes with a few drawbacks of its own. While you should produce documentation for how to best upgrade a test regardless of which option your team choses, the initial quality of (and timely updates to) the documentation becomes much more important with this approach. Engineers actively migrating their tests will rely heavily on your team to answer questions and be available for code reviews. Even if you have an exceedingly thorough document of frequently asked questions readily available, you’ll probably still have to answer the same handful of questions more than once.

While you hope to convince enough engineers that the performance improvements of the new system are worth the effort, there will probably be a number of teams that fail to take the bait. A few teams might commit to the migration, but ultimately fail to complete it because feature work was of higher priority. When encouraging other teams to participate in a refactor, even when everyone agrees that the benefits are tangible and significant, be mindful that unless these teams have equally committed setting quarterly objectives around its completion, your project will be one of the first to be pushed aside.

Striking a balance

Neither option is perfect, but the one you choose will have an impact on your ability to achieve your team’s short- and long-term goals, as well as your relationship with other engineering teams. If possible, I recommend mixing the two strategies so as to minimize the downsides of either approach and maximize your chances of completing the refactor successfully. With our test scenario, for example, here are a few steps I would recommend.

Proposed Approach

  1. Have your team identify a few simple tests which might benefit the most from the migration. Reach out to the prodct engineering teams to get additional context on which tests they deem to be the most high-impact.

  2. Start with Option 1 (see “Option 1: One team does migrates all tests” above). Begin migrating the tests manually and document the process thoroughly. (If the tests are clearly owned by a specific team, either give that team a heads up or work with them to complete the migration.)

  3. For the migrated test files, run benchmarks to clearly demonstrate the performance impact. Document those, too.

  4. Develop a code modification tool to automatically migrate a few simple cases. Run the modification tool on small, logical subsections of the testing suite until all candidate tests have been migrated.

  5. Kick off Option 2 (see “Option 2: Teams update their own tests” above). Evangelize the new mocking system by highlighting the benefits and pointing engineers to sample migrations. Spin up office hours to answer questions and troubleshoot with engineers in person. Consider organizing regular “jam sessions” where engineers across organization can join in with your team to crank out a few migrations.

  6. Work with teams to set quarterly objectives around improving the performance of their tests; if they’ve committed to being evaluated on participating in the effort, there’s a better chance it’ll get done.

Clean-Up Crews

Some larger engineering organizations have teams dedicated to improving developer productivity. The range of the kind of work that these teams take on can be quite wide: they provision and manage development environments; they write editor extensions and scripts to automate repetitive tasks; they build tooling to help developers better understand the performance implications of their proposed code changes; they maintain and expand upon the core libraries all product engineers depend on (including logging, monitoring, feature flags, etc). More often than not, the developer productivity teams that continue to work alongside product developers within the boundaries of the application end up taking on the role of the “clean-up crew”.

“Clean-up crews” take on the important (but often thankless) work of identifying and shedding cruft and antipatterns from a codebase, and establishing better, more sustainable patterns in their stead. These teams are usually made up of engineers who care deeply about code health and want their fellow product engineers’ to have an easy time developing, testing, and ultimately shipping new features. Seeing other developers at the company use (and appreciate) their libraries and tools is what gives them the greatest satisfaction.

Typically, these teams take on hefty refactors for two reasons. First, the team’s breadth of knowledge of the codebase is unparalleled. Because these crews are owners of core, functional libraries, they tend to have at least some exposure to almost every single corner of an application. This is especially true of teams that work inside monolothic codebases. Second, the team values developing ergonomic solutions that are accessible to everyone, regardless of team or seniority; they have valuable experience thinking about what kinds of interfaces strike the right balance between extensible and practical. If the main driving motivation behind the project is to boost developer productivity (and keep it there), then this is the perfect team. A third, implicit reason, is that by having the “clean-up crew” map out and execute the refactor, product development teams can continue to focus on feature development relatively undisturbed.

Unfortunately, clean-up crews are not sustainable. When these groups are productive, other engineering teams, typically feature-development teams, feel less of a responsibility to commit to doing important maintenance work. Over time, the clean-up crews accrue an insurmountable amount of work, slowly burning out their team members. As a result, these teams are usually short-lived or have high turnover. Furthermore, the teams shrugging maintenance work gradually lose the muscle memory associated with supporting features long-term. Throwing another large-scale refactor their way might not be a viable option.

The Pitch

Now that we’ve gained context on the kind of relationship our team has with our refactoring project, determined the expertises we’ll need, and brainstormed a list of corresponding experts we hope to recruit, we come to the hard part: convincing them to help us. While we might not be able to offer one eleventh of the 150 million dollars contained inside the Bellagio safe, we can try to make a convincing argument that contributing to the refactor is well worth their time and effort. Different individuals respond differently to a number of techniques, so we’ll outline a few here.

Do not be afraid to deploy multiple tactics for a single expert (whether that’s team or an individual). The busiest or the most skeptical experts will likely need more than just a single reason to agree to embark on the journey with you, and rightfully so! As a collaborating expert in any role, you are agreeing to allocate a (maybe significant) portion of your valuable time and energy to the project. If the refactor comes with significant risks (which most do), you are opening yourself up to involvement with incidents. If it’s likely to drag on for a while, you may have to pass up other opportunities as they arise. Getting involved with a sizable refactor does not come without its risks. You should not try to minimize those risks; instead, aim to make the experts see that the benefits decisively outweigh them.

Finally, persistence can be a technique on its own. If you’ve spoken to each of the potential experts for a given expertise on your list and haven’t gotten anyone to bite, loop back around. The first few candidates will have had more time to consider the opportunity and you’ll probably have a few more tricks up your sleeve from the many other conversations you’ll have had to date.

Appealing to an engineer is a different experience from appealing to a team’s manager. Engineers are much closer to the code; they experience the pain points your refactor wants to address much more concretely, acutely and frequently. In my experience, you very rarely have to spend considerable (if any) time convincing engineers that the problem you perceive is an actual problem; they often know exactly why the pain points you’re seeking to fix are so important to fix because they’ve experienced the exact pain on multiple occasions themselves. With engineers, you’ll probably be able to use most of the pitching techniques outlined in the upcoming sections successfully (maybe combining a few).

Managers, on the other hand, might only feel the pain from a secondary perspective: for example, they might notice a gradual increase in time estimates suggested by engineers during sprint planning due to an equal increase in complexity of the code; in 1:1s, some engineers might express frustration with frequent incidents due to brittle, poorly-tested code. Managers are also often not incentivized to prioritize refactoring over feature development. This is usually because managers are measured on their team’s productivity with regards to shipping net new product innovations at a regular cadence. Spending a quarter or two improving the code the team is responsible for so that they can subsequently speed up their development velocity in future quarters is a difficult sell for upper management; so, managers don’t put up a fight unless there is a dire need for code clean-up. Of the techniques proposed next, I recommend leaning heavily on the metrics and bartering pieces.

Note

You can ensure that managers are motivated to prioritize code health and quality on their team(s) by explicitly evaluating them on their ability to define measurable goals around it and support the team in achieving those goals. It’s not always easy to get upper management to buy into adding this as an important evaluation metric, but if you are able to, it can make a world of difference in how your engineering organization builds and maintains software.

Metrics

In Chapter 3 we explored a variety of different ways in which we could quantify the current state of the application before embarking on our refactoring journey. Chapter 4 discussed how to develop a thorough plan of action, complete with solid set of success metrics determined from the initial measurements taken using the methods outlined in Chapter 3. These metrics can help you build a convincing argument for getting help with your refactoring endeavor.

Typically, these kinds of pitches are most effective with the more skeptical experts and those that are most data-driven in their regular work. These are the engineers that are always asking questions; they actively monitor the p95 response times of APIs their team is responsible for maintaining; they’re the first ones to notice an uptick in the average number of database operations hitting a specific shard. Appeal to their analytical side with your own metrics and you might secure yourself a new expert.

First, articulate why the metrics you’ve chosen are good indicators of the problem. Take the time to carefully explain the relationship between the problems you hope to fix, how you chose to quantify them, and the initial statistics you’ve gathered. Choose simple metrics first, and then augment your case with additional supporting data points. If you’ve acquired or generated any visuals that help illustrate the problem, reference them; even those we think of as “numbers people” appreciate an explanatory graph or chart every so often.

Then, juxtapose the starting metrics with your defined success metrics, staring with the desired end state. Afterwards, you can walk the expert through the evolution of the metrics throughout the effort, from start to finish. Justify that your success metrics decisively show that the refactor was successful and that they are sufficiently ambitious but achievable.

Generosity

There’s an odd cognitive dissonance known as the Benjamin Franklin effect: you have a better chance at getting someone to like you if you ask them for a favor than by doing a favor for them. To give an example, say Charlie asks a favor of Dakota. Dakota happily obliges. The phenomenon follows that Dakota is more likely to do another favor for Charlie than if Charlie had done one for them. The idea is that people help others because they like them, even if they actually don’t, because their minds struggle to maintain logical consistency between their actions and perceptions.

Engineers working closely with the code you aim to improve are more likely to understand its pain points. They probably know at least a handful of other engineers (either on their immediate team or in the organization at large) that experience these same pain points regularly. If this expert is the kind of coworker that has a finger on the pulse when it comes to the health of the codebase and the engineering morale surrounding it, then there is a strong chance that they have a great deal of empathy for their teammates and you can successfully appeal to their inner altruist.

Ask the expert about the things they’ve heard their teammates complain about. Make a mental (or written) note of the specific pain points that the refactor intends to fix. Once you’ve commiserated on the difficulties of the code in its current state, list each of the problems they mentioned and walk through your proposed solution. There might be a few problems that you don’t yet have an explicit solution for, and that’s perfectly ok! In fact, this is precisely why you reached out to this expert; you seek their perspective on the problems you’re trying to solve. Make it clear to them that these are the kinds of insights that they could provide to the project. Finally, emphasize that their contributions would concretely make their coworkers’ lives (at least a little bit) more pleasant and more productive. Point to the expected benefits of the refactor and summarize the success metrics (because a multi-faceted pitch is ultimately a stronger pitch).

Opportunity

If the expert you’re pitching is looking for a good career advancement opportunity or a chance to be more visible to other parts of the engineering organization, a large-scale refactoring project can be the perfect line item on their resume. Earlier in the chapter, we mentioned that some managers might want to identify team members who might both be an asset to the project while also gaining valuable visibility within the broader engineering organization; if they’ve provided you with a few names, make sure to have a conversation with them about what kind of growth and visibility these individuals need in order to get to the next level.

When you sit down with the expert, have a conversation about what types of growth opportunities they’re looking for. Hopefully the engineer and their manager are aligned on what behaviors they need to exemplify or projects they need to drive to grow in their career, but that is not always the case. If you want to decisively convince the engineer to join you, all the while setting them up for success, taking the time to coalesce the manager’s expectations with those of the engineer is the best approach. From the combined input, take the time to identify a few key portions of the refactor that this expert could contribute to in a way that demonstrates the key characteristics they’re looking for. When you meet with them, walk them through each of the milestones and highlight the contributions they can make. Describe how you hope each of these contributions can help them achieve their goals. Be careful to keep an open dialogue, and be open to their input. You’re not in their shoes, nor are you their manager, so their perspective on how they can be best set up for success might differ from your own.

Bartering

If all else fails, be ready to barter. Bartering can be a great way to acquire the resources you need to successfully finish your project, with some sort of commitment in return. Typically, bartering doesn’t happen between yourself and another engineer but rather between your own manager and the manager of the team you’re seeking help from. The promise you make in return can vary; it’s all about finding what the other manager values most, and finding an adequate alternative you’re happy to provided in exchange. Here are just a few examples:

  • Say your team has open headcount and the team you want to recruit experts from is in desperate need for additional headcount. If your organization allows it, and you are comfortable giving up some of your available headcount, you could provide the team with the headcount it needs in exchange for one or two engineers to contribute actively to the refactoring effort.

  • On the off chance that your teams have compatible feature ownership, you could barter taking additional ownership of some components the other team has been wanting to shed. Oftentimes when teams have unclear or debated boundaries, there tends to be ares that become entirely unowned or tossed between the two teams frequently (which essentially leads them to be unowned). In exchange for help, your team could agree to decisively own those features or components for a set period of time (a few quarters or a year).

  • If your engineering organization has communal responsibilities (completing a certain number of hours of customer support or participating in interviews), you can offer that your team take on some (or all) of the expert team’s responsibilities for a defined period of time after the refactoring effort has wrapped up. (Ideally, you agree for the exchange to kick off only after the project has finished or when it is near completion because any time taken away from it will only make it drag on at the detriment of everyone involved.)

Note

When bartering takes place between two engineers, normally it’s an exchange of subject matter expertise; that is, the expert you’re recruiting as a subject matter expert wants you to contribute as a subject matter expert on an ongoing or future project. I’ve also seen engineers agree to trade code review, take on additional on-call shifts if they share a rotation or agree to document and facilitate a certain number of postmortems on the expert’s behalf.

Be aware that with bartering, either party can fall through on their promise if priorities shift within the duration of the refactoring effort. Re-orgs at companies of any size can render these agreements void due to shifts in management or feature ownership. Managers or engineers leaving the company or switching teams can also impact any pre-arranged agreements. The longer the refactor is ongoing, the greater chance the agreement might fall through for whatever reason.

Repeat

If you’re not able to convince the first name for each expertise, don’t worry! This is why brainstorming multiple names early-on is important. Ideally you’re able to secure an expert for each expertise, and if you have trouble coming up with more candidates, consider reaching out to those who’ve turned down the opportunity for any additional recommendations; they might be able to give you a name or two.

If you’re unable to secure an expert for an expertise that you won’t need initially, consider pausing the search and picking it back up once you reach the stage where it becomes necessary. Experts who were previously on the fence might be convinced to join if they are able to see sufficient progress and maybe the hint of a positive shift in the initial metrics. Refactoring can be a little bit like snowballs rolling down a snow hill; as it gains momentum, it affects a greater and greater surface area, gathering up more and more resources as it nears completion.

A Few Outcomes

If all of the stars align, we might manage to convince everyone we’ve pitched and assemble the absolute best team for the job. Congratulations! Unfortunately, the ideal outcome is quite unlikely. There’s a strong chance you won’t be able to assemble your perfect dream team, and that’s alright. We can figure out a way to work effectively with the resources we are able to secure and deliver a quality refactor! Before we close out the chapter, we’ll spend some time exploring what a realistic scenario might look like and how to make the most it. We’ll also briefly discuss how to handle the worst-case scenario: having to go it alone.

Realistic Scenario

The most realistic scenario is one where you end up with a small handful of committed experts and teammates. At smaller companies experiencing a great deal of growth, everyone wears more than one hat and every engineer has a full plate, so it’s unlikely you’ll be able to get an expert to fill each of your desired expertises. At larger, more stable companies, you might have a difficult time getting folks from other teams to commit to helping you out simply due to organizational boundaries and priorities; just because someone is an expert in something you’ll need context on to successfully complete your refactor doesn’t mean that it is that expert or that expert’s management chain’s top priority.

Regardless of who you were able to convince before kicking off development, you’re in a good spot if you’ve managed to gather a core team of at least a few engineers for the earliest portions of the project. After all, the team you start with might not be the team you end with because the support and expertise you need to complete the first few milestones isn’t necessarily the support you’ll need for the remainder of the project. You might very well be able to encourage others to join you once you’ve shown some tangible progress and the benefits of the refactor become more visible to fellow engineers.

Worst-Case Scenario

The absolute worst-case scenario is if you aren’t able to secure any additional help and need to execute on the project alone. Now before we start exploring how to make the best of this situation, I want to take a moment to acknowledge that if your only option is to execute on a large, cross-functional refactor alone, you may want to consider not doing it at all. If the engineering organization is not sufficiently convinced by your proposal to properly allocate staffing and the expert engineers you’ve reached out to are unconvinced as well, maybe it’s time to go back to the drawing board and strengthen your case. Otherwise, maybe it’s time to consider that perhaps now is not the right time to execute on this project.

In the event that your manager, teammates, and a number of other engineers believe in the importance of the effort, but there simply aren’t enough resources to go around, then you may consider moving forward alone. Be forewarned, however, that it is not an easy path. Working alone can be terribly isolating. Because it’s just you, slowly making progress one step at a time, it can feel like you aren’t making significant progress. You rarely have the chance to bounce ideas off of other people who have substantial context on the state of the project and don’t need to be brought up to speed every time you need a second opinion.

On the plus side, you don’t have to coordinate with anyone else; you hopefully know the sequence of steps you need to take, and you can execute on them serially. Not needing to coordinate with anyone else can also be a serious downside. You have to keep very, very good track of everything that you are doing and make that information available publicly so that others who are invested in your effort but unable to contribute are able to gage where you are on the project.

One or two incidents are nearly inevitable when making expansive changes to a codebase. While postmortems should be blameless, when there is only a single individual responsible for a given project, it can feel as though the burden of responsibility and subsequent remediation falls solely on you instead of on a group of folks.

Note

I highly recommend taking a look at Etsy’s postmortem process developed by John Allspaw if you haven’t already. Their approach to incident response is really thorough and promotes deliberate, focused growth within an engineering organization all the while preserving individual engineers’ psychological safety.

I recommend you find a buddy; maybe someone else who has also been tasked to be the sole owner of a significant project. This person is there to keep you accountable and motivated, similarly to how you might regularly meet up with a friend for yoga: you know that they’ll be there because you’ll be there, and vice versa. You can establish a regular cadence for meeting up and talking through the progress you’ve made to date on your respective projects. You can help each other brainstorm solutions to the tough problems, and, on occasion, review each others’ code. Either way, having someone there to keep you company on the tough road ahead is absolutely critical to staying on track.

Fostering Strong Teams

You’ll need to hone one important skill throughout the entire team-formation process in order to build an effective team: communication. The best communicators are able to assemble the best teams by convincing the right engineers to join and setting clear expectations as to their involvement from day one. Each contributor, whether they are an active teammate or a subject-matter expert, is well-aware of their role and responsibilities within the larger effort, and feels confident in their ability to deliver on the stated expectations.

Communication continues to be of utmost importance throughout the remainder of your refactoring effort, especially as you begin to make changes to your codebase. In the next chapter, we’ll discuss the importance of frequent, thorough updates, and explore techniques for establishing and maintaining a free flow of information between your team and those affected by your changes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.28.197