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.



This talk has been presented at TechLead Conference 2023, check out the latest edition of this Tech Conference.

FAQ

The speaker is Alex, a frontend engineer at CodeSandbox from Cluj, Romania, in the heart of Transylvania.

JS Heroes is a local community that organizes meetups and a conference every spring. It was founded by Alex.

The main topic of Alex's talk is a framework for managing technical debt and refactoring culture.

The three pillars of refactoring culture are Practices, Inventory, and Process.

Practices set the goal for the team, defining how to approach architecture, patterns, and guidelines. They ensure everyone knows the desired state of the codebase.

Inventory involves documenting the current state of the codebase, identifying technical debt, and understanding the gap between the current state and the ideal practices.

The refactoring process should involve execution, ownership, time management, and tracking progress, similar to how product features are managed.

Some rules for successful refactoring include making the process visible, rewarding, and resilient. This involves transparency, celebrating successes, and ensuring the process continues even during intense feature development periods.

The Marie Kondo method in refactoring involves regularly cleaning up the codebase by removing unused or outdated code, similar to decluttering a living space.

Convincing product managers can be done by showing metrics that highlight the impact of technical debt on development speed and overall team productivity, as well as emphasizing the risks and long-term benefits.

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
Watch video: Debugging JS
Debugging JavaScript is a crucial skill that is often overlooked in the industry. It is important to understand the problem, reproduce the issue, and identify the root cause. Having a variety of debugging tools and techniques, such as console methods and graphical debuggers, is beneficial. Replay is a time-traveling debugger for JavaScript that allows users to record and inspect bugs. It works with Redux, plain React, and even minified code with the help of source maps.
Principles for Scaling Frontend Application Development
React Summit 2023React Summit 2023
26 min
Principles for Scaling Frontend Application Development
Top Content
Watch video: Principles for Scaling Frontend Application Development
This Talk discusses scaling front-end applications through principles such as tearing down barriers, sharing code in a monorepo, and making it easy to delete code. It also emphasizes incremental migration, embracing lack of knowledge, and eliminating systematic complexity. The Talk highlights the use of automation in code migration and the importance of removing barriers to enable smoother code migration.
Building a Voice-Enabled AI Assistant With Javascript
JSNation 2023JSNation 2023
21 min
Building a Voice-Enabled AI Assistant With Javascript
Top Content
This Talk discusses building a voice-activated AI assistant using web APIs and JavaScript. It covers using the Web Speech API for speech recognition and the speech synthesis API for text to speech. The speaker demonstrates how to communicate with the Open AI API and handle the response. The Talk also explores enabling speech recognition and addressing the user. The speaker concludes by mentioning the possibility of creating a product out of the project and using Tauri for native desktop-like experiences.
Fighting Technical Debt With Continuous Refactoring
React Day Berlin 2022React Day Berlin 2022
29 min
Fighting Technical Debt With Continuous Refactoring
Top Content
This Talk discusses the importance of refactoring in software development and engineering. It introduces a framework called the three pillars of refactoring: practices, inventory, and process. The Talk emphasizes the need for clear practices, understanding of technical debt, and a well-defined process for successful refactoring. It also highlights the importance of visibility, reward, and resilience in the refactoring process. The Talk concludes by discussing the role of ownership, management, and prioritization in managing technical debt and refactoring efforts.
Power Fixing React Performance Woes
React Advanced Conference 2023React Advanced Conference 2023
22 min
Power Fixing React Performance Woes
Top Content
Watch video: Power Fixing React Performance Woes
This Talk discusses various strategies to improve React performance, including lazy loading iframes, analyzing and optimizing bundles, fixing barrel exports and tree shaking, removing dead code, and caching expensive computations. The speaker shares their experience in identifying and addressing performance issues in a real-world application. They also highlight the importance of regularly auditing webpack and bundle analyzers, using tools like Knip to find unused code, and contributing improvements to open source libraries.
A Practical Guide for Migrating to Server Components
React Advanced Conference 2023React Advanced Conference 2023
28 min
A Practical Guide for Migrating to Server Components
Top Content
Watch video: A Practical Guide for Migrating to Server Components
React query version five is live and we'll be discussing the migration process to server components using Next.js and React Query. The process involves planning, preparing, and setting up server components, migrating pages, adding layouts, and moving components to the server. We'll also explore the benefits of server components such as reducing JavaScript shipping, enabling powerful caching, and leveraging the features of the app router. Additionally, we'll cover topics like handling authentication, rendering in server components, and the impact on server load and costs.

Workshops on related topic

Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Featured Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
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.