Back to Index

Supercharging developer workflow with Amazon Q Developer - Vikash Agrawal


Chapters

0:0 Introduction
0:38 What is the SDLC
1:18 How to get started
2:13 Idea
2:48 Demo
5:41 Unit test
7:4 Documentation
8:1 Build on GitHub
9:43 Investigation
10:51 Conclusion

Transcript

Hi everyone, I'm Vikash. I'm a software development manager with AWS at Amazon. I'm Linda. I'm a developer advocate at AWS. And in this video, we're going to talk about the software development lifecycle and specifically how you can use Gen.AI throughout that lifecycle. We're going to focus on Amazon Q Developer, which is an AI coding assistant.

And we're going to show you where you could use it in all the different parts of that. So I'm going to throw it to Vikash because he as a manager always gets a very common question regarding this. One of the most common questions that I hear from the engineering team is how can they incorporate generative AI practices into their software development lifecycle or the SDLC.

For those of us who don't know what SDLC is, it's a process of building and releasing software to our customers. We generally start with a planning phase where we gather requirements, product feedback, etc. Then we go to the create phase where we actually build the software application itself. Then we test it, do end-to-end testing, integration testing, penetration testing, to make sure that the software that we are building is safe for our customers.

We then deploy it. And finally, we maintain it and modernize it. Over time, depending upon the feedback, we go through this cycle all over again. So let's get right into it. Amazon Q Developer is a coding assistant that is also in your IDE, can be even in your CLI and terminal, actually also has a GitHub extension and can be also in different parts of the lifecycle, right?

So I'm going to show you where you could get started. One of the cool things is if you install it in the command line or the IDE, it doesn't require an AWS account. All you have to do is go to this page, click get started for free, and choose which one you want.

But once you do that, I'll just quickly show you. Here you have an example of how it appears in Visual Studio Code over here. And we're going to build, don't worry. Here is a way it appears in the CLI. What we can do next is jump into the CLI version, because that's the most lightweight version for you to install Amazon Q.

You all have a command line on your computer. And here you can do either the planning phase, or if you've already done the planning phase somewhere else, you can go straight into creating and coding. So let's get into it. I have an idea. Why don't we build a game for our viewers today?

So this game is called 2048 or 2048. So we have multiple tiles. The goal of the game is to merge two tiles of the same number, and then the numbers double. The goal is to reach a total of 2048 or 2048. So here, if you see, we are merging two tiles of two, they become four, we are merging two tiles of four, they become eight, we are merging two tiles of eight, making them 16, and so on and so forth.

This is a really fun game to build. So I actually think let's get right into the CLI and try it out. So everyone has a command line, right? So in order to start Q, once you install it, we showed you where to install it. Now, Vikash gave me a challenge.

We have to build this 2048 game. To start it, all I have to actually write is Q. I press enter. If you aren't sure what to do and how to use it, you can just type with natural language right now and start just talking to it, also as a chat, also to ideate.

But if you want to see all the other options you have, you can do slash help. And you will see also that you have all these different commands, as well as MCP, if you would like to use that, and other tips. So for now, I want to build a 2048 game in Python using fast API.

Yeah, let's do using fast API. Let's use poetry. Using poetry. Let's see what it comes up with. So now it's giving me the plan. It's telling me here's what I'm going to do. And now I have an ability to either accept each step by pressing Y and enter, or I can just do T and trust it.

Vikash, should we trust it? I trust Q. Of course, this is a demo. If you're building in production, we always recommend reviewing the code. But here, we're going to trust it and it'll start running. And now you can see how long each step is taking as well. All right.

So now, while we were chatting, this was generating some 2048 code here. One thing I forgot, and check this out. One thing I forgot is, look, it's putting it inside just my regular folder. I actually wanted to move the whole thing into my development folder. So guess what? I could actually ask it, can you move this project to my development folder?

So now, it will move it in there. That's actually a pretty nifty little hack. Yeah, because I always forget when I do this to put it in the right place. All right. So now, it's saying the project's set up. You can see that here it appears in my development folder.

Awesome. I think this code actually looks good. I am really happy that it is using FirstAPI rightly. It has a response model. It has created post-APIs. Agreed. What's cool, Vikash, you could also use this in your IDE, right, and open the folder structure. Because, of course, this is more coming out in the CLI.

But you can use Q in your IDE of choice. Given that my engineering team relies on VS Code, IntelliJ, Eclipse, and everyone has their own preferences, right? An Amazon Q developer touches all these touch points, which makes it very seamless of an experience. It even created a readme, Vikash.

Which part of the software development lifecycle is that? Awesome. So now, it tells me what my project structure is. It created it in the development folder, even though I only remembered Midway. And it tells me how to run it. I think this is a great start. But is it production ready?

I would say no, too. Why don't we add unit test? Yes. So let's open it in the IDE. So why don't we start with adding unit test to make sure that it's production ready? So let's start with that. I quickly open up in my IDE and I start invoking my Amazon Q developer agent for test for generating unit test by invoking slash test.

So here I'm doing slash test. It automatically invokes the Amazon Q developer agent and it quickly starts looking at the code itself. Once it's done, let's look at the generated code. Here we see it is able to understand all pieces of the code and we have, I think, a good amount of test.

It is amazing that it was able to also understand the state and created relevant tests for the state management itself. So I think this looks pretty, pretty robust. I generally use slash test a lot. There's also a feature called slash dev, which is for feature development. You can give it a prompt in the IDE.

It will automatically understand the entire project as context and build context aware features for me. So let's go ahead and quickly ask you to fix my bugs by just saying fix and giving the error message. It quickly analyzed my code base. It figured out where the error is, gave me the code.

I applied it and now let's see what happens. Voila! I have a working code for a game with unit test. Let's do one more thing. Why don't we generate documentations before we raise a pull request? So let's invoke the slash doc, which is the Amazon Q developer agent to generate documentation.

I go ahead, I quickly pass on slash doc. I ask it to create a readme. So initially there was a readme generated, but now that we have a code and we have unit test, I want to see how it does better. So it quickly started my summarizing my code base, started going through my source files.

So now I see a documentation. It is able to understand my source code. It gives me the instruction, which was pretty much the same last time as well. This is interesting. Now my API endpoints also have relevant examples, my troubleshooting documentation. And it also gave me a data flow diagram of how my state is being managed.

And I think one of the next steps could be deploying or having a PR. But did you know also the queue is available inside GitHub? And you can actually build inside GitHub. I have agents there. And I'm going to show you really quick that as well. So if you like to build on GitHub and not leave GitHub, you can also do that.

Awesome. I'm going to give you a quick overview. So head over to QDeveloper in Marketplace and GitHub. And all you have to do is choose which repos you want. You can put all or a few. And now you can actually either use an existing issue or create a new one.

Apply a label here. Let's say we're just doing development agent. And based on that issue, it will generate code. It will tell you when the PR is ready. And you can then look at the files that were changed. And now if we want to change something in the PR, you can actually add comments and request changes like I normally would in a review.

And then request the changes so it does it again. So you don't even have to leave GitHub. And then Q also automatically runs code scans and fixes it right in the PR. And so it's pretty awesome how you can use also agents right inside GitHub with Q. We talked about where we could code, which is IDEs, CLI, GitHub.

We're building this 2048 game. We even ran tests. We add documentation. So what's next in the lifecycle? So the next would be to deploy it to our cloud services already. So one of the most common things, and I'm guilty of it, is saying works on my machine, right? To make this game an actual production ready, we'll deploy it into AWS console.

And in the background, I use the slash dev agent in the IDE to actually generate SAM scripts and deploy my application. You know what's something interesting I found? What? That our application was actually not running the right way in production. Oh. Yes. So I need to investigate. So let's go ahead and do that.

So here, I come to my AWS console. I go into my CloudWatch. Let's first look at the Lambda where I deployed through SAM. And I'm looking at the logs. And I quickly see there is some import error happening in the Lambda itself. Now I can start investigating the application directly in the console itself using Amazon Q developer.

The Amazon Q developer AI operations automatically starts looking at the log group and all the associated resources. It creates a topology and then figures out the root cause for me. I don't have to spend time debugging. I can look at the graphs. I can figure out what's going on and come back and fix my application.

It's so easy for developers to actually know what's happening rather than trying to find the right timestamp and create reports or incident reports for the team. So this feature enables me to quickly look what's wrong in my application. And I can go back in time and go ahead and fix it.

I think this, I was happy with this report. So let's just go ahead and close the investigation. Taking this game to production. I think when we saw the errors and Amazon Q developer helped us debug what's the reason. I think one of the takeaways for me in this particular situation is to think of infra upfront, how your application is going to the customers.

I think if that's something that we would have done early on, we wouldn't have faced this. I should have asked QCLI to generate an IAIS. We should have thought about infra. We are both part of the software development lifecycle, Vikash. So we should have thought about it up front.

What was your takeaways? My takeaway is kind of similar to yours where we have to pre-plan. So that planning phase might have other things. And maybe one way to actually follow best practices is to actually ask, even in the CLI, we could say, what is the best way for me to plan for something that's a bit more robust, right?

And production ready and follow best practices. And you can iterate before you ever actually have the code saved anywhere, right? Or like generate and iterate. So I think the planning part where you can, of course, if you're deploying to the cloud, use IAC. And then being able to utilize Q in different ways for your use case in so many different locations is helpful.

Of course, it's always you are the person planning. You're the manager. And AI is just helping you with all these tedious tasks and almost becoming your assistant in so many places there. So it's awesome to have it in all these different places. But, of course, it's on you as we learn to be able to do this responsibly.

And I love security scans and the monitoring and observability because I think it helps a lot in mitigating issues. Absolutely. One of the things that you rightly pointed out is as engineers and with a generative AI and Amazon Q developer, the planning phase might probably also include planning your prompts.

Because prompt engineering is going to be a very important skill set to make sure that you get desired outputs from the models and the agents. So for anyone who's watching this and wants to try Q, first of all, you could try it for free in the IDE, you could try it for free in the CLI, you could try it for free in GitHub and so many different locations.

So definitely give it a try. Play around with it yourself. So you could head over to aws.amazon.com slash Q slash developer and get started building right over here. If you want to see what's new, also check out there's updates coming through. So be sure to check that out. And if you have any questions, let us know in the comments.

And as always, happy building.