Skip to main content Etsi

AIConference talks

Automate and elevate: Boosting developer productivity with AI | Nerea Leguinazabal

At The Future of Software conference in London, Nerea Leguinazabal showed us how we can leverage AI to write cleaner, more efficient code, reduce errors and bugs, and accelerate our development cycles. Nerea also discusses some of the challenges and opportunities associated with integrating AI and how it can accelerate our DevOps adoption and delivery. In this demo, learn how GitHub Copilot can help your organization. About the speaker: Nerea is a solutions engineer at GitHub, specializing in application transformation and DevOps ways of working. Her focus is to take customers off a journey from legacy technology to serverless and containers, where code comes first while enabling them to take full advantage of DevOps practices.

Automate and elevate: Boosting developer productivity with AI | Nerea Leguinazabal
Transcript

Thank you! As Dan was saying, we're going to talk - about Copilot and GitHub. How can you boost your productivity using Copilot? The first thing I want to ask is who is using Copilot here? Any hands? Oh, so many. Okay. I want to understand this because later I'll do some demo and explain the basics a bit. A bit of an introduction for the people that have never used Copilot. Then we'll go into things I like more and the most interesting parts, - such as ?????? You'll see it later. The first thing. I'm sure you've seen this slide. I'm sure you're feeling it. We did a study a couple years ago where we discovered - that 75 percent of the time developers are not actually developing. They're planning or refactoring, - doing stuff that's maybe a bit boring or less productive. I'm sure you've felt that and that you want to spend more time - doing what's interesting to you, right? Why does this happen? You see a bunch of things here. Sometimes it's because you have legacy code or complex databases. You have to do repetitive tasks. Maybe create some unit testing. We're also onboarded in a bunch of repos. We may not know what they're about and we have to onboard super fast, - which is very hard to do. We may just need to reuse code or follow some frameworks - that we're not familiar with, right? How does Copilot help with this? Hopefully, if you've used Copilot, you've seen - that it maximizes your happiness. This is what we're going to try to show later. How does it happen? The first thing would be increasing your productivity. How does this translate into real things? This is a bit abstract what I'm talking about. First of all, it solves some of the challenges - we were talking about earlier. I'm onboarded in a new project. Maybe I'm not familiar with a framework. I use it a lot to learn new languages, - new frameworks and new models that I want to develop. Other things that it can help you with. It can help you focus on the things that are more interesting. I don't know. Things like creating data for your test or refactoring stuff. That's not really something that brings value sometimes. That's what Copilot is going to help you with. That's what it's helping me with. That's what we say when we talk about productivity. Finally, it's going to accelerate software development. You'll see if you've already started using Copilot that you develop - ten times or 20 times faster instead of going - to the documentation and trying to figure out how things work. You'll be like "just tell me how it works and give me some examples, - some GitHub code, so I can start from somewhere." This brings us acceleration and innovation way faster than - it could if we were only doing it ourselves. Something you've already experienced is you'll have more time - to do the interesting stuff. I like to say you won't spend time doing mundane tasks like unit testing, - documenting, summarizing stuff, and trying to understand the code - and search the documentation. All those things are repetitive. We don't want to spend time doing them. It's that 75 percent of time we spend trying to do things - for the other 25 percent, which is actually coding. That will be out of the question, and we'll spend more time - talking to our teammates, brainstorming and trying to understand - the design we want to do. It's a bunch of other things that are not only bringing value - to the business but also to ourselves, because it's where we actually enjoy - spending our time. Where is this whole thing? Most likely you're using different IDEs, platforms et cetera. As you can see, today we are in your favorite IDEs, hopefully. We are in Visual Studio Code and Visual Studio - and the whole family of JetBrains. We recently added Xcode and more recently, - maybe a couple of weeks ago, we added Eclipse. Yay, Eclipse. Sometimes people use Eclipse. It's a bit old-ish, but we still added it, because it's very useful - for some business cases. As you see, we have a bunch of things, but it's not only in the IDE. If you've already used Copilot with the platform, - you see it brings another set of things that the IDE cannot bring. That's what we're going to see in the demo. Where is this coming from? This is a super simple repo that I use a lot to do my demos. Actually, I'm going to show you what it looks like. I think it's worth showing you what we're talking about It will make sense later. I have here a little bookstore. If you've had demos, maybe someone presented this to you already. Otherwise, it's like a Java application where you can buy some books, - add some stuff to your cart et cetera. Not super relevant, maybe, because you're a data scientist - and you're using notebooks and languages that are not Java. This is just for you to understand what we're about to do. We're in this repo, glowing-octo-sniffle. If we go and suddenly become a developer, - like you all probably are, the first thing that we would do - in our day is ask if we have something to do. You have an issue or you have a feature - you have to develop. That's exactly what we're going to do. Here, I'm in Visual Studio Code just because I like it more, - but you can do the same in other IDEs. The first thing you see on the right is the Copilot chat. Here you can do a bunch of things like ask for information - or ask, for example, about an issue or something to do. Let's ask Copilot. As you see, I'm doing the @, and @GitHub is just going to - connect me to the platform. Here you see a bunch of other things. These are extensions. I don't know if you're familiar with them. They're to extend the functionality that maybe Copilot doesn't have today - or to connect to other systems that you're going to use to bring - that information from. In our case, we're going to bring information from GitHub. We're going to ask: are there any issues assigned to me? What this is going to do is connect to the repo I've just shown you. It's going to scan through different issues I have. It's going to bring back that issue. You already start to see I have a bunch of issues in different repos. The one that we're going to go for is the fresh one: - add rating feature to the bookstore. Let's go and click into it and see what's up. Let's let it finish. Okay, super. It's redirecting us to an issue I had opened and assigned to myself - in the repository we were looking at. What is this about? You've seen earlier that we have that little bookstore. What we wanted to do is add a rating feature for that. We want our users to know what the best book is, - what we can do and what's worth maybe buying. You see it here bit differently. The description, the context, maybe some comments - on how the UI has to look. We're going to start developing this. The first thing I'd ask Copilot, if you've already used it, - is how I'd go about doing this new rating feature. Let's ask exactly that. How do I do to build the rating feature? You see what it's telling me because it's a live demo. You're aware it didn't work on the first try. Let's retry. Let's ask: how can I build a rating feature for my books? Hopefully this time it works. Okay. It won't assist me with this. Great. Happens every time I have a demo. Okay. Then let's do it in a different way. Let's come over here and to the book. I'm going to show you... This is the book you saw earlier. The object, right? I'm going to ask it to maybe add some features directly. Let's say: can you add some rating feature - with the constructors? Let's see if it now starts to build up some stuff. You see that if I give it a bit more context - and a bit better prompt, it's going to understand a bit better - what I want to do. In this case, I know I want to build the rating feature. I know I need to update the constructors, - because I'm familiar with the code and because this is the object - I've created in Java to store these books. It has added the rating field. Not only that, but it has also added some getter and setters - for the new rating field I've just added. Let's go ahead and accept that. What happens now? Usually I rather come here when I want to do something specific. Let's say I know the exact thing I have to do in the exact file. I'll come and iterate over it. In this case, we could say this is good, but maybe this rating feature - needs some threshold. They can't just rate it from minus 1,000 to 2,000. That doesn't make sense. Let's ask it to add some threshold there. You can see that this is not only about generating code. It's also about talking to Copilot, iterating with it - and really understanding the whole process of development. I forgot to say this earlier, but this is not a replacement for developers. It's a tool for developers. I want you to have that in mind because people confuse it - and start to panic. They think AI is going to take over the world and replace everyone. Let's go ask: I want the rating feature. Let's say it can be from 0 to 5. I want the rating feature to be from 0 to 5. Can you modify the code? Okay. You see it has taken what I'd selected and rewriting it. In this case, I've said from 0 to 5, so that's what it's doing. If we're outside those boundaries, it's going to give us an error. You could iterate if you have more specific ideas, - if you want to add something or if you have a library - or something you're more familiar with. I'm trying to make this accessible, because I know some people - maybe have never used Copilot, and it's a first approach. Let's get this and move it here so that you can see it better. What happens now? You've noticed that it's written new stuff because I've asked it - to write new stuff. It hasn't actually removed the previous stuff - because I didn't select it or ask it to be refactored or anything. That's what we're going to ask. This I like a lot, because I spent a lot of time refactoring in my early days. I'll ask it to review the whole thing and tell me - if there's something I should change. It should like come up with extra information - like remove some stuff or add some stuff you're missing. In this case, the source or the context it's taking because I'm in the book... Okay, you don't have any feedback. Cool. Let's do something else. Let's ask it to review it in a different way. I want to show you different ways of doing this. If we have a review of one of our developers, - there's not necessarily anything wrong or worth a comment. I want you to see how we can leverage Copilot a bit more. I've selected #file. These little hashtags, if you haven't used them, are quite useful. They're to avoid having to select something every time. For example, #file, #editor or #codebase. The different things you'd usually use to talk to Copilot. Let's ask: can you please refactor the file? Let's see what is comes up with. It works a bit different from earlier. I've just said to revise the whole thing. In this case, it's taken book because I have it open. I also had some lines selected from 2 to 44, - which was the new stuff It's bringing some new code. Let me make it a bit bigger so you have better visibility. You have the book, the different constructors. In this case, it's removing the previous stuff - because I've asked it to remove it and to refactor the whole thing. It's still maintaining the new stuff. What happens with this? It's like if you're working with a peer. You'll have to be more specific. You come to me and tell me to just build a rating feature. How? Give me some guidelines. Where do you want me to build it? When should it fail et cetera. How can you bring this to over here? You can either select it and replace the whole thing - or you can copy it and paste it, but I think this is easier. More things you can do that are quite interesting. Maybe you noticed in the beginning that it was talking about workspace - in this part. If you do something like this, you'll see these different parts. We had the workspace. I hinted a bit at the context when I said I selected a file - or maybe a piece of code. Now I'm selecting the whole workspace. That means I'm going to select everything in the repo. You could also, if you have the code in GitHub, - call to some organization and a specific repo you have there. You can connect the pieces together. If you've used Copilot, this is the basic thing you'd start with. You're like "yeah, that's okay." "We've already seen this 100 times with different repos." What's more interesting about this that I find cooler because it's newer and it helps us a bit more? What's the next step? If you've recently used Copilot, you've also seen this part - where you can edit. What's the difference between this chat and editing in Copilot? Earlier, I said I first need to go to this book file. Then I need to ask this specific thing. Then I need to specify what I have to do and replace it. A bunch of things that maybe are not something you want to do - for a thousand files or even three files. You don't want to do that, right? What you could do instead is say... I want to refactor several things. Earlier, I was just refactoring the book, - but if we have the book, most likely we need to refactor the test as well. We filed this stuff, and that's something we always forget. Let's do exactly that. Let's go for the book test that I have over here. Let's also maybe replace the UI we have today. We want to update it, because we're going to show - a new rating feature. Let's go for the book HTML. I have a set of files that I've selected. Now it's not just trying to understand what the context is, - but it's also specified a bit more. I like to say that the prompt is a bit more understandable to Copilot - so that it knows exactly what it has to go for. Let's ask it to refactor this whole thing. Let's say: can you refactor these files - with the new rating feature - we created in Book.java. What you start to see here is that it's starting with the first one. It's bringing BookTest and saying that I need to add some test rating - so that the rating feature that I've just created is tested. I don't know if you've noticed, but here there are changes that are being made. If we go to BookTest, which is the one it's telling us - it's started refactoring, you'll see that it's not only added - one random test but it's tried without any specifications, - because we weren't very good at prompting. Don't learn from me from the prompts I do here. It has created three tests. It has created three tests so you can test that new rating feature. It has also added in the setup without us specifying that - that you have to set up the rating so it works as well. There are more things it has done without us asking. It has also modified the UI. We were saying we are adding this rating feature. We don't have it in the UI, so how are they going to - click on it and rate it? You have here a new column with the rating. It's telling you this is the new rating I've just added. I'm also going to add a display so you can see - the actual rating in your UI. I think that's the next step for Copilot. Now I want to show you the next next step for Copilot. I don't know if you've heard about the agent. Is anyone using the agent for Copilot? Yeah? Okay. Yay. Someone. Nice. Okay, so this is new for you. This is great. That's good news. Let's do something. Let's discard this whole thing. I don't want it anymore, so I'm going to remove this whole thing. Let's start from the beginning. We are going to say... We were saying in the beginning: can you bring me - the actual issue that I have? Let's try again and see if it works. Hopefully this time it works. It's going to bring that issue we were seeing. We are going to ask it from the agent, - which is just going to be an extra smart peer, I'd say. Someone that's actually going to go a bit above what you're expecting. You don't only give it specific things - like modify this, refactor this, create this. You don't have to go step by step. Now it's like build me the whole feature. I don't want to have to specify the whole thing. You can specify it better or worse, but I want to build it - from this issue that I have here. I haven't shown it to you earlier. Over here, if you can see it, you have a couple of options. You have the option to change the model or to go to agent mode. That's what we're going to do. We're going to go to agent mode. We're going to pass this new issue. We're going to click over here. You see it has switched over. Now we're in agent mode. What is it doing? It's taken that rating feature that we just passed over - and it's started to draft the plan. It's saying that now that I have this issue, - I think I need to update the backend and the frontend. That's what we were asking before. We also need to add tests, which is also - what we were asking before because we know how it works. For us, it's easy to know. Where do I have to modify this whole thing? We haven't specified the files. Now we say: just do it and figure it out. That's exactly what it's doing. Let me scroll a bit more. It's started. First, I'll read the stuff you have. I'll actually read the model. Then, I'm going to go to the services. I'm going to auto-serve it. I'm going to go over the different files you have. I'm going to create new writing services if needed. If I have to implement some new stuff in the model, I will. If I need to create some new tests for the new writing model, I will. That's what it has done. See these little dots that we saw earlier during the edit? It continues doing its own thing. It likes to be productive. Let's go over the thing that it has already done. It has taken a different approach. This writing is not going to be in the book. Now it's going to be its own thing because we want to set up some stuff. We are also going to set up a rating service. We are going to update the BookServlet. We're going to do a bunch of things, so now it's not about specifying - what we actually want. If it was a junior developer, it's more like: - "can you help me draft a plan on this - and also take action on it?" It's a bit different. It's like the next step to what we had before. Of course, you are going to continue using the chat - because maybe you just want to brainstorm or, I don't know, - go through some new model or some new framework - you want to learn about. Some new repo even. Wouldn't it be cool if we could actually find it somewhere else? Earlier, we were saying this is in the IDE. I've shown you the five IDEs we have. I was also talking about the platform. That's what we're going to do. Let's do something. This is the issue. I don't know if you've already seen workspaces. It's a very similar idea to what I was talking about with agents. I don't want to have to re-ask if I already have some markdown - or I have an issue where I'm specifying what I want to do. I want to just go to my workspace - and I want to be able to implement this whole thing. I'm going to go ahead and open the workspace. This is only happening in the platform. This is, let's say... Copilot is embedded throughout the whole platform. It's not either in the ID or in the pull request - or either here. It's everywhere. That's what you're seeing. It's taking the issue we've just seen and implemented in a couple of ways - and bringing a plan together. It's telling me maybe I should go over what's actually happening today. What is the current behavior? There's no rating feature. That's what we specify in the issue. What would be the solution to this? We have to add, as you saw earlier, a new rating attribute - and new getters and setters. We have to create some samples. We have to display that somewhere. So what can you do here? It's not only about having something come to you. It's collaborating. Here are different suggestions. How is it going to be treated? How is the feature integrated? You can prompt it. You were the enemy. You can ask how you should go about creating an additional feature. I don't want to have to rely on the ratings of my customers. I