This year, at re:Invent 2024, there were a few announcements about Amazon Q developer. Among these announcements, three new agents looked interesting to me.
The first agent should generate your documentation (/doc), the second agent should generate your unit tests (/dev) and the third agent should review your code vulnerabilities (/review).
So this is what I evaluated in this blog post.
I started from this simple feedback application, with this simple architecture:
And the code I used is right there: https://github.com/welcloud-io/wio-from-diagram-to-code-with-amazon-q-developer/tree/main/feedback-app-project-from-diagrams, so you can reproduce this from it.
/doc to document your application
So among the new agent I choose the doc agent, to create a README.md file that does not exist yet
Once done, I accept the generated README.md, which will be created in my folder
The result is not bad, and when I verify what has been generated that seems correct. I don't really see any correction to apply, at least they are very small like adding more arguments to the cdk commands, but compared to the time I saved against writing it on my own, it's negligible.
However I am a bit disappointed with the diagrams and I would like to add more.
Lets start a new documentation task:
Then, I don't create, but update the existing readme file...
...with a specific change
And ask it add a sequence diagram
And it naturally adds a mermaid sequence diagram, in the right section (dataflow)
I accept it and preview the diagram, and the result is not bad at all, at least better than the original data flow for me.
I think I could add more things, but at least what we have to understand is that this agent has to be used in an iterative process, and the documentation will not be generated in one go.
/test to test your code
Now I want to add more tests to my code, so I will use the new /test agent.
For that I have to open the file which contains the code I want to test, in my case the send_feedback.py.
It proposes to specify a function, but since I just have only one function...
I directly press enter
After a few seconds I can see the test that will be placed in a new generated test file
I accept the tests...and I run them.
Very quickly, after just a few modifications, they are all running (7 tests, 130 lines of code). Again, compared to the time I would have needed to write these tests on my own it's negligible.
Now I will intentionally introduce an error and see if it's covered (therefore detected) by my new test suite. So, I remove the feedback field in my table update instruction:
and here is the result
So now I should be able to refactor my code safely. Pretty interesting!
/review to review your code
Then, before committing I want to review my code, so I will use the /review agent
I will choose review workspace
And I get all the issues in my code, so there is no critical issue
for example it detects there is no encryption of my DynamoDB database
From there I can view the details of this weakness (CWE),
You can also ignore the issue, or ask to fix it
If I want to fix it, I can first see the suggested code, and accept the fix
My code is updated
And the issue disappears from my list
Conclusion
I am not really looking for more agents with Amazon Q Developer, I believe we have so much to explore and discover with what exists that I don't want to feel overwhelmed, not knowing what to choose.
However, a think that specialized, well defined agents can incredibly increase the quality of our work and save time.
So, after I tried this agent for just a few hours, I feel I can already get value from them, at least they are a very good starting point for the things we sometimes are discouraged to do.
Top comments (0)