AWS Logo
Menu
Amazon Q Developer: what can it help me with?

Amazon Q Developer: what can it help me with?

Amazon Q Developer, there is what's explicitly supported... and all the rest

Published Aug 14, 2024
Last Modified Aug 20, 2024
Lately, I have received the same questions on the capabilities of Amazon Q Developer multiple times. There is everything that is explicitly documented in the FAQ. But there is more. Let's discover this.

Question #1: "I don't see my developers as needing coding support as much as needing business support. They don't know the domain. Can Amazon Q Developer help them with that?"

Amazon Q Developer is based on a Large Language Model that has been trained on a very large set of information. So there are good chances that it knows your business domain. I worked most of my career in the financial industry but I studied computer science. So I had, on many occasions, to learn about the business domain. To do that, I started to open a web browser and search for definitions, explanations, and courses. Now I can stay in my IDE and ask Amazon Q Developer about the business domain related to my current tasks. When working for an insurance, I heard FNOL many times before understanding what it meant.
FNOL means First Notification of Loss. Good Answer.
Result of the prompt: what is FNOL?
Quite a good answer. But does it know more nuances? I'm developing specifically for car insurance.
Quite some interesting more details. Nice.
What is FNOL in the context of car insurance?
Nice! So Amazon Q Developer can help me understand the business domain but I still have some challenges moving from epics I receive from the business to stories I can implement.

Question #2: "Can Amazon Q Developer help write user stories?"

Let's continue on the Journey. Now that I know what FNOL is, I need to develop a single-page application to handle the FNOL workflow in the context of car insurance.
Here comes 5 user stories.
Write user stories for FNOL.
Amazon Q Developer returned 5 user stories that seem to be quite reasonable. However, you need to pay attention to the prompt. I tried: "Write the stories to implement FNOL for car insurance via a single-page application." And it answered: "I apologize, but your request seems to be outside my domain of expertise." It's actually a good thing. The worst thing with generative AI assistants is when they start to hallucinate. I lost hours trying to make a code hallucinated by early versions of coding assistants work to realize that it simply couldn't as some methods didn't exist in the framework used. But it was close enough to make me doubt. Amazon Q Developer has built-in guardrails to limit these situations.

Question #3: "User stories are nice but can Amazon Q Developer help with functional tests?"

Have you heard of BDD, Gherkin, and Cucumber? You can ask Amazon Q Developer ;-). It's not only vegetables. The idea is to formalize the description of functional tests in plain English to be able to easily transform them into tests executable with various test frameworks. Let's continue on our previous user stories and see if we can generate those tests.
Amazon Q Developer confidently generates gherkin.
User Stories to gherkin translation
Amazon Q Developer shows some confidence in the exercise and comes back with user stories described with the gherkin specification. We are going to ask to generate the equivalent test in JUnit. I let you try to do the same exercise with your preferred test framework.
And here we see the cucumber.
Gherkin to Junit conversion
That's when we discover cucumber, this library with the attributes Given, When, Then.
So Amazon Q Developer can help me with the business domain, the user stories, the more standardized way to write them with Gherkin, and the generation of the equivalent Junit tests. That's not the most exciting part of the job of a developer (Well! I like this.), but it went like a breeze.
Let's finish with one last question where I believe Amazon Q Developer is going to help more and more: the migration from one language (legacy) to another language.

Question #4: "I have this PL/I code that I need to migrate to a language the younger developers know. Can Amazon Q Developer help me with that?"

There are some plans for similar transformation but it's not an explicit feature of Amazon Q Developer today. That doesn't mean that it cannot help with this, even if PL/I is not in the list of languages supported.
Let's take some code examples found on the Internet: https://www.ibm.com/docs/en/zos/2.4.0?topic=gimapi-sample-pli-program.
Contextual Menu with Explain selected.
Amazon Q Developer Explain
We'll first check if Amazon Q Developer can understand PL/I.
And it explains it.
Amazon Q Developer recognizes the PL/I code
I don't know PL/I but it looks like a good enough explanation.
I often use Java as the target for transformation. But once somebody suggested that Rust may not be that far from PL/I. So I gave it a try.
Amazon Q Developer gives some initial answers.
Translation PL/I to Rust
Amazon Q Developer gives some high-level recommendations and even some code on how to proceed. As we have seen earlier, it's protected by guardrails to limit the risk of giving a confidently wrong answer that generally leads to more trouble than help. But if you are conscious of the risk, you can push it further.
It gives a try but warns you.
PL/I to Rust translation forced.
So now, I have a more complete code to start with and I'm warned that it's a rough translation. So I know that I may need to change multiple elements to make this work.

Last question: "Can it help me with more situations?"

I think that I showed that you can try Amazon Q Developer in more situations than what is described in the documentation and FAQ. It's going to tell you when it's out of its scope. And sometimes, you need to adjust the prompt to bring it to its limit. But you'll be warned when the content generated is a tentative answer. So you should not lose time because of a confidently wrong answer or hallucination that would have brought you in a wrong direction.
 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

Comments