A Framework for Managing Technical Debt

Spanish audio is available in the player settings
Rate this content
Bookmark
Slides

Let’s face it: technical debt is inevitable and rewriting your code every 6 months is not an option. Refactoring is a complex topic that doesn't have a one-size-fits-all solution. Frontend applications are particularly sensitive because of frequent requirements and user flows changes. New abstractions, updated patterns and cleaning up those old functions - it all sounds great on paper, but it often fails in practice: todos accumulate, tickets end up rotting in the backlog and legacy code crops up in every corner of your codebase. So a process of continuous refactoring is the only weapon you have against tech debt.

In the past three years, I’ve been exploring different strategies and processes for refactoring code. In this talk I will describe the key components of a framework for tackling refactoring and I will share some of the learnings accumulated along the way. Hopefully, this will help you in your quest of improving the code quality of your codebases.



Alex Moldovan
Alex Moldovan
35 min
09 Mar, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Today's Talk discusses the importance of managing technical debt through refactoring practices, prioritization, and planning. Successful refactoring requires establishing guidelines, maintaining an inventory, and implementing a process. Celebrating success and ensuring resilience are key to building a strong refactoring culture. Visibility, support, and transparent communication are crucial for addressing technical debt effectively. The team's responsibilities, operating style, and availability should be transparent to product managers.

1. Introduction to Refactoring and Technical Depth

Short description:

My name is Alex and I'm joining from Romania, from a city called Cluj. Today's topic is a framework for managing technical depth. I want to talk about refactoring culture and the three pillars of refactoring.

Hey everyone, thank you for chiming in for this session. My name is Alex and I'm joining from Romania, from a city called Cluj, which is in the beautiful heart of Transylvania, where I work as a frontend engineer at CodeSandbox and on the side, I'm also the founder of JS Heroes, our local community that organizes the local meetups here in Cluj and also the JS Heroes conference that happens every spring. You can also find me on Twitter at alexandmodovan and today's topic is a framework for managing technical depth.

And I wanted to talk about technical depth for a while and basically this talk is also not just about technical depth, which is inevitable for all the projects, for all the engineering teams, but also this is about refactoring. And I'm not necessarily going to talk with you about here's how you refactor code or here are some patterns for actually doing refactoring. I'm here to talk a bit more about the more meta layer, if you want, and I want to talk about refactoring culture, because I've been working for the past five to six years with different product teams, different engineering teams, vertical teams, horizontal teams, platform teams, and it always felt weird to me that we never really got refactoring right. As an industry we still have this problem a lot.

Actually, a few people talk about this in general, so I thought about exploring some things. Ever since I started thinking more about this, I started coming up with this framework, or structure, or more like, how do you build the right structure around the refactoring processes? This is what I refer to as a refactoring culture. The trigger for this particular talk came some good months ago. When we were working at Code Samples, we were working on this, let's say, small refactoring experiment where we introduced a new way of communicating with our backend. We have this backend of our code editor, which we call picture, which handles all the low-level primitives of what you can consider a code editor. Like file system access or tasks or processes and stuff like that. So we came up with this new way of doing it. And now we have basically two ways of doing the same thing in the application.

So we have a legacy picture provider, which was at the top of everything. And then inside it, we've got something called a picture provider. And just looking at this code at first, just looking at the PR that was kind of introducing this change, kind of at first made me scream, like, oh, no, this is not okay. We're just messing the code, we're going to live with this forever. And this is just kind of like a bad practice. But then I slowly started to understand it, actually this is okay, right? There was back then no possible way for us to just transition the entire codebase overnight, and just use the new way of consuming data. So we kind of had to support these two alternative ways. And this is what made me realize that, okay, as long as we have a method for this, as long as we have a clear understanding, you know, across the entire team that this is how we are handling this process, this is fine, right? This is more like managing this whole problem, now we have this technical debt, we are aware of it, but we are managing it at the same time. We're not, you know, stopping all development to just focus on this. We are moving forward with all our feature development. And at the same time, we have a plan to kind of mitigate this problem. So pretty much this is the, the gist of it, like what I want to kind of like say with this talk, like, okay, instead of fighting, you know, technical debt, instead of being in this process where whenever something pops up, whenever something is off, whenever, you know, the code base does not reflect the quality that we want it to be at, we stop all product development and we say to, you know, your product managers say, oh, we need to solve this because it's higher priority. That clearly ends up becoming a problem and a struggle for product development because you no longer have, you know, reliable way of just shipping like on a cycle basis. And at the same time, so instead of doing that, right, instead of saying, okay, I want to eradicate all technical debt as soon as it pops up, I'm thinking of a framework to more like manage this, right? To not be crippled by it, so you don't have to fall into the other extreme where, oh, we're not doing any refactoring anymore, we're just focusing on features and then just things just pile up, but at the same time not just be very reactive to this, like whenever something pops up, we immediately try to fix it. So this framework tries to put into place all these things, right? And this is what I call the three pillars of refactoring, because obviously there are three pillars, and we're going to walk through them in a bit.

2. Refactoring Practices and Inventory

Short description:

The first pillar is practices, which involves setting goals and guidelines for the team. It's important to document these practices and make decisions together. The next step is to assess the current state of the code base and identify the technical debt. This can be done by documenting the areas that need improvement and prioritizing tasks. For example, creating new components or deprecating outdated ones. It's crucial to have a separate document for tracking technical debt and not rely solely on the backlog. By doing this, you can build priorities and address the technical debt effectively.

So the first one, or the first thing you do is, or the first pillar is the practices. The next one is the inventory, and the third one is the process. Now, they might sound a bit abstract, but once I get through all of them, they will hopefully make sense for everyone.

So let's take them one at a time. What is practices about? Practices is pretty much about setting that goal with the team, sitting together and saying, in this team, in this engineering team, this is how we want to do things for this particular project, this is how we want to approach, this is the architecture, these are the patterns, these are the guidelines. So you have, again, all these things, patterns and all, we have your architecture.

Ideally, you have them documented as well, so a good practice of keeping track of these practices is to basically document them. You can have, you know, ways in which you want to structure your files and your folders, do you want to structure by functions, structure by feature, all these things, how you want to compose components, how you want to create components. Actually, at Code Sandbox, we do have this document for what we call the general coding guidelines. These are things that you don't, you can't really automate, right? There are decisions that just pop up. You can imagine you have a PR at some point and someone figures, hey, we've been doing this kind of logic, this is how we approach things for this kind of problem. Let's document this as a practice so that others can read it and come back later on, we can cross-reference it in other PRs and say, hey, we decided three months ago that we're going to name things like this or that we're going to use this particular abstraction like this or like if you have this, you should extract it in a separate component. All these things that cannot really be automated and are not always like black and white. They are more like, there are subtle differences and there are things that your team needs to decide on.

So practice is kind of setting this north star of where you want your architecture to be, where you want your patterns to be, what is the desired state in which the code base should be in or what's your aim as an engineering team? And then the next step is, in my mind is super important as the one that most of the things are, I think are missing, is kind of doing a bit of almost like introspection into the code base or research and figuring out what are we missing, right? What's the gap to this ideal or to this practices that we have in mind? This is what we want to get, but where are we now? Like, this is the inventory, trying to figure out what's missing, this is where you kind of document, what is your technical depth? You know, what are the parts of the application that need to be upgraded? You know, all the things that you need, all the steps that you need to do to get to that ideal scenario. So, you could have things in your backlog, for example, you start documenting, hey, we have specific tasks to upgrade something, to swap out an old way of doing things with the new way of doing things. Create a new component, extract a new component, deprecate a component, deprecate a system, whatever it is, you can have that somewhere documented. Some teams prefer the backlog. We did notice that backlogs are not the ideal scenarios for this because items tend to rot in the backlog, especially if you put them on low priority. So, we ended up with a separate document, for example, and I encourage everyone to kind of do this, try to figure out, okay, which are the key aspects of my code base that kind of have that growing technical depth. They can be very low, very small things, or it can be bigger things. In this case, we started documenting even the smaller things in this document called technical depth accounting. Whenever you introduce some technical depth or you guys just find something that all of a sudden, you're like, hey, this is technical depth that we haven't figured out, you document it somewhere. And it's not just living in someone's head that, hey, there's some technical document there. There is actually, it is actually documented in a place. And once you get to that, you start building priorities. And this is actually like a fun story. This is code from production that we still have. We had this Friday where we implemented something called the Markdown preview, basically taking Markdown files and rendering them nicely, formatting them for the preview when you navigate on the code base. And we kind of took this as a, it was almost like a hackathon experience where we just said, okay, let's build this.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Debugging JS
React Summit 2023React Summit 2023
24 min
Debugging JS
Top Content
As developers, we spend much of our time debugging apps - often code we didn't even write. Sadly, few developers have ever been taught how to approach debugging - it's something most of us learn through painful experience.  The good news is you _can_ learn how to debug effectively, and there's several key techniques and tools you can use for debugging JS and React apps.
Principles for Scaling Frontend Application Development
React Summit 2023React Summit 2023
26 min
Principles for Scaling Frontend Application Development
Top Content
After spending over a decade at Google, and now as the CTO of Vercel, Malte Ubl is no stranger to being responsible for a team’s software infrastructure. However, being in charge of defining how people write software, and in turn, building the infrastructure that they’re using to write said software, presents significant challenges. This presentation by Malte Ubl will uncover the guiding principles to leading a large software infrastructure.
Fighting Technical Debt With Continuous Refactoring
React Day Berlin 2022React Day Berlin 2022
29 min
Fighting Technical Debt With Continuous Refactoring
Top Content
Let’s face it: technical debt is inevitable and rewriting your code every 6 months is not an option. Refactoring is a complex topic that doesn't have a one-size-fits-all solution. Frontend applications are particularly sensitive because of frequent requirements and user flows changes. New abstractions, updated patterns and cleaning up those old functions - it all sounds great on paper, but it often fails in practice: todos accumulate, tickets end up rotting in the backlog and legacy code crops up in every corner of your codebase. So a process of continuous refactoring is the only weapon you have against tech debt. In the past three years, I’ve been exploring different strategies and processes for refactoring code. In this talk I will describe the key components of a framework for tackling refactoring and I will share some of the learnings accumulated along the way. Hopefully, this will help you in your quest of improving the code quality of your codebases.
Building a Voice-Enabled AI Assistant With Javascript
JSNation 2023JSNation 2023
21 min
Building a Voice-Enabled AI Assistant With Javascript
Top Content
In this talk, we'll build our own Jarvis using Web APIs and langchain. There will be live coding.
Power Fixing React Performance Woes
React Advanced Conference 2023React Advanced Conference 2023
22 min
Power Fixing React Performance Woes
Top Content
Next.js and other wrapping React frameworks provide great power in building larger applications. But with great power comes great performance responsibility - and if you don’t pay attention, it’s easy to add multiple seconds of loading penalty on all of your pages. Eek! Let’s walk through a case study of how a few hours of performance debugging improved both load and parse times for the Centered app by several hundred percent each. We’ll learn not just why those performance problems happen, but how to diagnose and fix them. Hooray, performance! ⚡️
Monolith to Micro-Frontends
React Advanced Conference 2022React Advanced Conference 2022
22 min
Monolith to Micro-Frontends
Top Content
Many companies worldwide are considering adopting Micro-Frontends to improve business agility and scale, however, there are many unknowns when it comes to what the migration path looks like in practice. In this talk, I will discuss the steps required to successfully migrate a monolithic React Application into a more modular decoupled frontend architecture.

Workshops on related topic

Building a Shopify App with React & Node
React Summit Remote Edition 2021React Summit Remote Edition 2021
87 min
Building a Shopify App with React & Node
Top Content
WorkshopFree
Jennifer Gray
Hanna Chen
2 authors
Shopify merchants have a diverse set of needs, and developers have a unique opportunity to meet those needs building apps. Building an app can be tough work but Shopify has created a set of tools and resources to help you build out a seamless app experience as quickly as possible. Get hands on experience building an embedded Shopify app using the Shopify App CLI, Polaris and Shopify App Bridge.We’ll show you how to create an app that accesses information from a development store and can run in your local environment.
Build a chat room with Appwrite and React
JSNation 2022JSNation 2022
41 min
Build a chat room with Appwrite and React
WorkshopFree
Wess Cope
Wess Cope
API's/Backends are difficult and we need websockets. You will be using VS Code as your editor, Parcel.js, Chakra-ui, React, React Icons, and Appwrite. By the end of this workshop, you will have the knowledge to build a real-time app using Appwrite and zero API development. Follow along and you'll have an awesome chat app to show off!
Hard GraphQL Problems at Shopify
GraphQL Galaxy 2021GraphQL Galaxy 2021
164 min
Hard GraphQL Problems at Shopify
WorkshopFree
Rebecca Friedman
Jonathan Baker
Alex Ackerman
Théo Ben Hassen
 Greg MacWilliam
5 authors
At Shopify scale, we solve some pretty hard problems. In this workshop, five different speakers will outline some of the challenges we’ve faced, and how we’ve overcome them.

Table of contents:
1 - The infamous "N+1" problem: Jonathan Baker - Let's talk about what it is, why it is a problem, and how Shopify handles it at scale across several GraphQL APIs.
2 - Contextualizing GraphQL APIs: Alex Ackerman - How and why we decided to use directives. I’ll share what directives are, which directives are available out of the box, and how to create custom directives.
3 - Faster GraphQL queries for mobile clients: Theo Ben Hassen - As your mobile app grows, so will your GraphQL queries. In this talk, I will go over diverse strategies to make your queries faster and more effective.
4 - Building tomorrow’s product today: Greg MacWilliam - How Shopify adopts future features in today’s code.
5 - Managing large APIs effectively: Rebecca Friedman - We have thousands of developers at Shopify. Let’s take a look at how we’re ensuring the quality and consistency of our GraphQL APIs with so many contributors.
0 To Auth In An Hour For Your JavaScript App
JSNation 2023JSNation 2023
57 min
0 To Auth In An Hour For Your JavaScript App
WorkshopFree
Asaf Shen
Asaf Shen
Passwordless authentication may seem complex, but it is simple to add it to any app using the right tool.
We will enhance a full-stack JS application (Node.js backend + Vanilla JS frontend) to authenticate users with One Time Passwords (email) and OAuth, including:
- User authentication – Managing user interactions, returning session / refresh JWTs- Session management and validation – Storing the session securely for subsequent client requests, validating / refreshing sessions
At the end of the workshop, we will also touch on another approach to code authentication using frontend Descope Flows (drag-and-drop workflows), while keeping only session validation in the backend. With this, we will also show how easy it is to enable biometrics and other passwordless authentication methods.
Build a Collaborative Notion-Like Product in 2H
JSNation 2023JSNation 2023
87 min
Build a Collaborative Notion-Like Product in 2H
WorkshopFree
Witek Socha
Witek Socha
You have been tasked with creating a collaborative text editing feature within your company’s product. Something along the lines of Notion or Google Docs.
CK 5 is a feature-rich framework and ecosystem of ready-to-use features targeting a wide range of use cases. It offers a cloud infrastructure to support the real-time collaboration system needs. During this workshop, you will learn how to set up and integrate CK 5. We will go over the very basics of embedding the editor on a page, through configuration, to enabling real-time collaboration features. Key learnings: How to embed, set up, and configure CK 5 to best fit a document editing system supporting real-time collaboration.
Table of contents:- Introduction to the CK 5 ecosystem.- Introduction to a “Notion-like” project template.- Embedding CK 5 on a page.- Basic CK 5 configuration.- Tuning up CK 5 for a specific use case.- Enabling real-time editing features.