How do you ensure large-scale codebases remain agile and adaptable in this world of continuous change? Well, today, Justine from Moderna is going to join me on the podcast. She's going to help me understand how AI is revolutionising the way enterprises tackle the complex challenges of code maintenance and migration. Because while AI assistants have proven their worth in helping individual developers optimise and write code, scaling that innovation across an organisation's entire codebase, well, that requires a fundamentally different approach of something we don't talk about enough.
And Justine's expertise in AI-driven code refactoring and her book, AI for Mass-Scale Code Refactoring and Analysis, released last September, makes the perfect guest to explore this topic. So today, we'll examine how AI can streamline the process of large-scale migrations, reduce technical debt, and empower engineering teams to work more efficiently. And as businesses continue modernising their applications, I want to ask questions such as, what will AI play in ensuring code quality and adaptability on a massive scale? How do we get there?
And how can organisations leverage some of these tools to manage the complexity of enterprise-level development? Well, let's get today's guest up to find out more. So a massive warm welcome to the show, Justine. Can you tell everyone a little about who you are and what you do?
Absolutely. First of all, thank you for having me. So I'm Justine. I'm based out of Montreal.
I've been working at Moderna, a great company that uses and maintains and developed and created Open Rewrite. And I work as an AI research engineer. So I do everything that has to do with AI, but I also do a little bit of research in that space as well to make sure we always have the best technology to offer to our customers. For some context, at Moderna, we help companies keep their systems running smoothly by automating updates to thousands of applications or a million lines of code.
That's the coolest title in the world, isn't it? Especially right now, AI research engineer. Does your LinkedIn get bombarded? I'm curious.
Absolutely, it does. I definitely do get a lot of messages. Either people want me to use their platforms or some people come with questions, which I actually like getting questions. I think it's always fun to help out people.
So for anyone who wants to ask questions about AI, they should definitely keep messaging me. I love answering those. Oh, I love it. I'm so glad I could have you on the podcast because there's a lot of hype around AI at the moment.
I'm curious, the work you're doing at Moderna, how have you leveraged AI to tackle unique challenges of large-scale code-based migrations and updates across enterprises? Because we often hear about, this is AI, the game-changing, the transformative technology, but I love to hear more about the real-world use cases and how you're using it there. Yeah, absolutely. It's very different than, I came from a more research side at first when I did my graduate school at McGill and Mila in Montreal.
And to see how it's actually used in the real world is very interesting. And to really see the nitty-gritty day-to-day and how it can be used and leveraged in a way that you can trust it. So Moderna uses Open Rewrite, which is an open-source framework that basically does the changes for you. And so these changes actually don't use ML, so machine learning.
They don't use what we call AI these days. They have these, it's basically code that changes code. So it's deterministic, it's always going to be the same change, and that's what makes it very reliable. What's interesting, though, is you now have this framework that you can use to go and grab AI, now really modern AI, the ML of today, to actually do changes in a way that you can trust it.
So it's kind of like Open Rewrite is this guardrail for changes or for impact analysis as well. It lets you basically walk through code and ML only in a precise spot and precisely when it's needed, which is really good for latency costs as well. You have basically everything that Open Rewrite can do, and then when it's time to have this generalist model do whatever you need it to do, you can plug it in. Incredibly cool.
And just to boost any myths or misconceptions, what are the differences between AI techniques that might be used for individual developer assistants and those required for mass-scale code refactoring? There's a big difference there, right? Absolutely. And it might sound a bit abstract until you have an example to tie it to.
So when we talk about ML for code in general, we'll often think of ChatGPT, Copilot, all these code assistants that can generate code for you. And while those are very useful, and us at Moderna use them every day for our own workflow, they can definitely make you go faster. Sometimes we need them to be perfect when using them at scale. You need to be able to trust them, and you have a human in the loop.
So when it's a one-to-one coding within a model, you have this feedback loop to one, okay, generate code, then the actual developer can look at the code and say, yes, no, that's not what I meant, and continue and refine. But when you're looking at scale, you kind of lose that loop and have the human in the loop. So I think one of the things where AI really shines to be for refactoring or for this actual day-to-day path that we're trying to solve, you want to be able to use a technology called embeddings. I don't know if you've ever heard of those before.
Basically, a numerical representation of an entity, in our case, code. And when you use these embeddings, you can now do a lot of arithmetics with them. So you can now search for things because you can now look at distance between a user query and an entity, so code. So if you're looking for something in your code or you want to get an idea of what kind of method declarations you have in your code, it's a great tool to be able to actually visualize this.
And this is done thanks to embeddings and thanks to Open Rewrite and Modern, who are able to walk through the code and have this type of information. One of the key technology that makes Open Rewrite and Modern so strong, as opposed to using code as text as input for a model or using even just the abstract syntax tree, we have something we call a lossless semantic tree, which basically is a think about an ASD, but with so much more information that gets leveraged. One of the key ones is a type attribution. So being able to have this extra information that would be lost otherwise, the models are able to actually go grab this extra information and that doesn't get lost.
And this is something even a human wouldn't have access to when looking at the IDE. But thanks to the bytecode, we're able to have all this information for the types and really get to what does it mean for this object to be of this type? What does it mean when the method uses this type? And that's what the embedding is able to leverage so much more of its context.
And before you came on the podcast today, I was doing a little research on you. One of the things I came across was that you've written AI for mass scale code refactoring and analysis. So can you tell me a bit more about that? What inspired you to write it?
And ultimately what the main takeaways are for software developers and organizations that may be even checking it out after listening to our conversation today? We really wanted to write this book for both people who are interested in using AI for mass scale code refactoring and analysis, but also for those who just in general want to integrate AI in a way that makes sense to them and not have it just be those extra little sparkles that you add on a feature. You want it to be something that's meaningful and actually bring something new. And so for both these people, we really go into details about what were exactly the problems we faced when adding AI to Open Rewrite and Moderna and how to actually deploy these systems in a way that you can trust it and a way that your customers can trust it and keeping basically the power and the control into the user as opposed to the model.
Because if something has a 1% error rate, let's say, and you have a code base of 1,000 switch cases, we'll say something like that, you have 1,000 instances that you want to use your model. A 1% error rate means there's 10 cases where there could be an error. And as we know, sometimes one little change in code can make a whole difference, especially in a switch case. You can imagine how that can very disastrous effects after.
So the key takeaways in this book is we really want to start with saying a good refactoring campaign can start with understanding your code. So it kind of goes back to this embedding, going back to the LSTs who have this extra information. We also look at using the smallest model that you can use for what you need. So a sentence we kind of coined was, don't butter your toes with a chainsaw.
And it's really when you have these boundaries in what you're going to deploy that you start getting very creative. And these models are so generative. They're so good at facing different kinds of problems that are not necessarily in their training set that it's a great opportunity to start stacking them a little bit like Lego blocks and to experiment. So that's another thing we really are trying to get across.
Try it and try with small things first. You don't go for a generative model straight from the beginning. Look if you can't train your own model. Look if there isn't a model that's already trained.
There's so many embedding models out there that are open source, free to use, and can run on very small computers. And for any developers that are listening to our conversations, they've probably heard so many different things. Some are good, some are bad, some are bad, some are making them a little cautious. So as someone that's right in the heart of this space, how do you see AI maybe transforming the future of software development beyond just code creation?
What do you see here? It's a really fun space to be in. As much as there's going to be a lot of pushback and there's sometimes going to be people who are kind of dreaming too quick, too big. It's like, all right, this is a great tool.
It's not going to solve world hunger yet. But for code, I think definitely letting developers interact with their code in a different way is definitely the thing in the short run that I'm most interested in or excited to see. Even ourselves, we're working on a new way to show search results. Modern can be used to do transformations of code, whether that's refactoring, upgrading libraries.
But it can also be used to search for things. So if you're looking for some sort of method or you want to see all the methods from a certain library, that's very easy to do. When we show these results, they're going to be showed repo by repo, file by file, and that kind of stuff. What if we could use AI so that you can kind of walk through your code in a different way and see it differently?
If you have some results that are similar to each other within the search result, why not put them next to each other? This idea is like helping you get to the deep parts of your code faster, even if you don't interact with that code often. So that's just one example. But this idea of being able to even ask questions about your code.
Where do this user's credentials get saved in this repo? And to be able to ask a question like this to your code without knowing what library you use to keep those credentials, that's really where we're going to harness this day-to-day expertise that the code will have. And it's going to make it a lot faster to jump into new code, I think. Well, I love that.
So much time that can be saved from that as well. For business leaders listening and all the conversations that you're having with business leaders, what would you say are some of the most common challenges that organizations are currently facing when attempting large-scale code-based migrations? I think that it goes back to time, right? You were just saying about time saved.
I think these migrations take so much time. Some companies will put a certain amount of time in their budget. All right, we're going to dedicate this many engineers over that much time. And it becomes kind of a whack-a-mole, right?
So you have so much that you need to migrate already. And as you have this team working on this certain migration, whatever you're working on might already become something that needs to be migrated later, right? It's a problem that keeps happening. It's a snowball that we need to solve kind of early on.
So having someone work on these projects by hand, it's doable. It really depends on the scale and what your goals are. But this is kind of the problem with the origins of Open Rewrite. We want to solve this.
Let's do this automatically. So instead of having one person work on one repo, have one person work on a certain migration that can then be applied on all of the repos. And we all gain from that, right? So we have a lot of migrations that are open source already, these recipes that anyone can use because we can all gain basically from having written this once.
And let's just have all the changes be done at the same time instead. I think the next goal is for these people who write frameworks and libraries. When they have a new version, the goal would be for them to write that migration itself as well. And it's just going to make people be able to jump onto that new version of that framework so much faster because they can now automatically upgrade their code to whatever version they need to use this other library or framework.
And the amount of time that can be safe here is immense and incredibly exciting. But there will be some hardcore traditional developers and extremely cautious IT managers out there that will be a little bit cautious and a little bit more wary. So how do you put them at ease? How do you ensure that AI-powered code refactoring is faster but also maintains the reliability, the scalability, and security of enterprise solutions?
Because it's something we can't ignore here as well, right? I'm happy that they ask these questions. I think it's a really good process. Like I said, I come from research, right?
So this is like the day-to-day you have to ask yourself what are going to be the hard-hitting questions, right? And I think here is something at scale that we're using. So we have even on our public platform for people to try out recipes. We have so many repos that they can see it on.
They can also do it on their own code. Once they talk to our team, we always facilitate this because we want them to be in control. Every change then becomes a certain pull request or comment, whatever you want to do. But basically, you can verify all these changes.
But I think very quickly you'll see that there aren't errors. And that's because of the deterministic framework, the way that Open Rewrite is done. When it comes to time to make the changes, those aren't AI. That is, a human has written, when you see this, do this.
And like any code, there'll be some bugs, obviously. But the fact that we run these recipes on so many repos, we really get this stress test, basically, of quality. And there is in some circles concern that AI will replace jobs, et cetera. But I always maintain that the magic happens when AI and the human worker, or in this case developers, can achieve things together that neither can achieve on their own.
So what role do you believe collaboration between developers and AI assistants will ultimately play in the future of software development? Because it's not about one or the other, is it? I think it is that collaboration. Even myself, I saw myself using these LLMs to chat about concepts.
I didn't come from the Java world. I came from Python. And to be able to add very quickly my touch and understand very quickly the framework that I was working in that was written in Java, it was so great to be able to, instead of going to bug someone else who's busy doing something else, why can't I first start chatting and asking my questions in a way that makes sense? And it's a great first attempt in understanding code.
And I'm not saying these chatbots, though, should replace documentation, but it is definitely another tool in your toolbox as someone who gets started either with a new framework, a new language, a new project, a new team, whatever it is. And that definitely can only help. And so I can only imagine a junior, that stress of going to go see a senior for the first few times, it can be very intimidating. And so to have this first line of defense, in a way, and that way to be really taken under the wing of AI to understand the code faster, and then you can go ask your questions, right?
So I think that's very useful to have another tool in your toolbox. And I definitely see it as cooperative. 100% with you there, especially on that. Another tool in your toolbox, which is a great way to look at it.
As we look at adoption, we've been talking about AI for two years. We're now seeing a maturity. But how do you see adoption of AI for large-scale co-maintenance? Have you seen that evolving over the next few years?
Do you think some industries will benefit more than others, or which will benefit the most? I think anyone that has old repos that are kind of afraid of touching. Some of the people who have worked on these projects are either retiring or leaving. So to have more junior people writing in COBOL, that kind of stuff, it's going to be a good time to do these migrations, and a good time to do these refactorings in a way that can make the code more easy to maintain in the future.
I think it's going to be interesting, the industry. So I look at people who need to have code that is very secure, and they have a lot of code, and that code tends to be old. So that's what banks, insurance companies, they have such an amount of repos, and they're massive. They're so complicated and intertwined with each other, and they're very hard to change as well, because there's so much security that goes behind them.
I think this is a great place to have this trustable change using the recipes. I completely agree with you. At the very beginning of our conversation today, you were telling me about your incredibly cool job title, AI Research Engineer. But obviously, you took a long time to get you where you are, and you've enjoyed a successful career.
I'm going to ask you to look back for a moment now, because none of us are able to achieve any degree of success without a little help along the way. Very often, it's someone that's seen something in us, or invested a little time, or pointed us on the right. path for example but is there a particular person or people that you're grateful towards that we could maybe give a little shout out today i love that question absolutely i love throwing flowers i think it's there's so many people that every day like i'll write a little bit of code it reminds me of them right but the two that come to mind is definitely my two supervisors for my master that i did at mcgill and mila when i was choosing my supervisors that matching process an advice i got was don't get two supervisors try to do only one the reasoning behind that it's hard to know who's going to be the leader of the two and you might end up kind of falling to the cracks just because professors tend to be so busy so i went to get that advice and i am so happy i did because i got two awesome and they gave me so much time so much of their attention and yeah so jinn and they were both incredible and they had two very different backgrounds jinn is more in the software engineering research while danny is more into the ml for code graph neural nets but together the three of us i think we really did some good work and it was just i learned so much on what kind of questions to ask yourself and like i was mentioning before where you're always asking yourself the hard-hitting questions that definitely comes from research everything you do it's not great it's working i'm done it's why is it working and this like this it gives you a really better like way to code and to really push your understanding of anything you're doing so much further and for that i'm forever grateful oh man a quick shout out to jinn and danny so important that we share stories like this because i suspect that both of them are unaware on the impact that they've had on your career equally the people we didn't mention that when you're writing code and you think about those individuals and what they've contributed to that code that you're writing and all these people collectively make such a big difference in our lives and i love the phrase used as well about throwing flowers absolutely lovely but before i let you go for anyone interested in learning more about modern or bombarding your inbox with any questions that they might have where would you like to point everyone listening i think linkedin is the best place i'll make sure to filter through the people asking me to use their platform and only look for the questions and messages but definitely linkedin i think it's the best way to reach you oh so well i'll have a link to that and the modern website and we covered so much today in a short amount of time and it's so good that you managed to bring to life everything that we're talking about with real world examples but just a big thank you for sharing your story today and thank you for having me wow i think it's clear that scaling ai beyond individual code files to large-scale enterprise applications is without doubt a transformative challenge and equally an opportunity and as justine highlighted today ai driven mass-scale code refactoring can empower organizations to reduce efficiencies handle migrations more effectively and ultimately evolve with the demands of modern development but the conversation also raised a few important questions how will organizations prepare for ai's growing role in enterprise software what steps will they take to ensure sustainable modernization and with ai proving its value in solving these complex challenges we need to remember the tools we adopt today could reshape how we build tomorrow's digital infrastructure but over here let me know your thoughts techrollwriteroutwork.com linkedin x instagram just at neilcqs let me know but that's it for today so thank you for listening as always hopefully you can join again tomorrow we'll do it all again with a different guest how's that sound good answer speak with you all tomorrow bye for now