AWSAWS Certified Generative AI Developer - Professional2026-102.5 Implement application integration patterns and development tools
Validate assisted changes against measurable contracts
Completed by the knowledge check
Learning objective
Use Amazon Q Developer and Kiro for GenAI code generation, refactoring, testing, and performance improvement
Core idea
For an engineer integrating foundation models, a coding assistant produces candidate changes. Your application’s contract determines whether those changes are acceptable. Code that compiles can still misread a streaming response, retry an irreversible action, or accept an unsupported model result. Use assistance to reduce implementation work while keeping correctness and performance decisions attached to observable evidence.
Amazon Q Developer documents IDE actions for explaining, refactoring, fixing, generating tests, and optimizing selected code. Kiro supports a broader spec-driven development process: turn a prompt into a specification and implementation steps, then collaborate on code, documentation, and tests. Choose the interaction that fits the change’s scope. A local adapter correction needs a narrow contract; a feature spanning request handling, generation, and delivery needs an agreed design.
The product names need care. AWS documents that the Amazon Q Developer CLI has been rebranded to Kiro and provides an upgrade path for Q IDE extensions. Do not design a toolchain that assumes the Q CLI and Kiro are permanently independent products. The blueprint retains both names; this lesson distinguishes the documented Q IDE actions from Kiro’s spec-driven workflow.
How it works
Generate code from an explicit boundary
Give the assistant the actual integration boundary: the existing SDK wrapper, the request and response contract, representative failure cases, and the repository’s conventions. State what the change must preserve. For example, an adapter must distinguish a complete response from a disconnected stream and must not publish a partial answer as final. The streaming mechanisms belong to 2.4.4 and 2.5.1; the development task here is to make those contracts explicit enough to review generated code.
Kiro steering files provide persistent project knowledge through Markdown files. Record recurring integration conventions there: the SDK wrapper to use, the error taxonomy, and retry ownership from 2.4.5. Keep a feature-specific specification focused on this request’s behavior and acceptance conditions; steering supplies established project patterns without restating them in every chat.
In Q Developer, Send to prompt copies highlighted code into the chat panel. You can ask questions or request changes in that context. Insert code replaces the selected code with the generated update. These are concrete editing mechanisms, not a proof that the replacement preserves behavior. Review the resulting diff, especially what disappeared: exception handling, validation, request correlation, and cancellation paths are easy to lose when a prompt emphasizes only the successful case.
With Kiro, use Spec-driven coding to formalize a feature before implementation. AWS describes specifications as structured artifacts that turn high-level ideas into implementation plans. Review the proposed design and steps before asking Kiro to implement them. Put observable acceptance conditions in that specification: which inputs are rejected, which outputs are returned, and which failures remain distinguishable. An instruction such as “build a robust GenAI API” gives the assistant no reliable stopping condition.
Refactor against behavior you already trust
Q Developer’s Explain action helps inspect unfamiliar code; Refactor targets improvements such as readability or efficiency; Fix targets debugging. Keep these jobs distinct. A refactor should preserve the externally visible contract. A bug fix should change one identified behavior and include evidence that the defect no longer occurs. Mixing both without a baseline makes regressions difficult to attribute.
For a GenAI integration, first record examples of valid requests, invalid requests, and model or transport failures. Then ask for a bounded refactor, such as separating response decoding from outcome classification. Inspect whether the assistant changed error semantics or retry ownership. Avoid asking it to “simplify” a wrapper when the apparent complexity implements a deliberate boundary. Retry budgets and SDK behavior are covered in 2.4.5; generated code must respect that existing policy.
Kiro’s Agent hooks automate predefined agent actions on events such as saving, creating, or deleting files. A hook can prompt routine documentation or test work as part of the development process. Scope it to a useful trigger and inspect its changes. A file-save event is not evidence that all integration checks passed, and an automated agent action should not become an implicit release approval.
Test the contract, then measure optimization
Q Developer’s Generate tests creates unit tests for the current file or selected code. Kiro can generate code and tests as implementation steps. Treat generated tests as a draft of coverage. If the same assistant misunderstands a response contract in both implementation and tests, the tests can pass while preserving the mistake. Compare them with independently specified acceptance conditions and representative SDK responses.
Separate deterministic adapter tests from model-quality evaluation. Unit tests can verify decoding, validation, and terminal outcomes with controlled fixtures. They cannot establish that a foundation model’s answer is useful across the production workload. Use the prompt regression contract from 1.6.6 for that second question. Include failure fixtures as well as normal results, and make assertions about behavior rather than the exact internal structure of the generated code.
Q Developer’s Optimize action proposes performance changes. Supply a measured bottleneck and a target metric rather than asking for speed in general. Compare the same workload before and after the patch: response latency, concurrency behavior, accepted-result rate, and resource use. A shorter function is not necessarily faster, and eliminating checks can improve a timing result by weakening correctness. Accept an optimization only when its benefit survives the original acceptance conditions.
Key distinctions and trade-offs
Selected-code assistance versus feature planning: Q’s documented IDE actions work on a file or highlighted code. Kiro’s specs and implementation steps help coordinate a larger feature. Neither removes the need to inspect the final change.
Generated tests versus independent acceptance: Test generation reduces authoring effort. Independent acceptance conditions prevent an implementation and its tests from agreeing on the same incorrect assumption.
Refactoring versus optimization: Refactoring improves structure while preserving behavior. Optimization needs a measured performance benefit. If a change alters output quality or failure behavior, assess that trade-off explicitly rather than calling it a refactor.
A narrow prompt limits review scope but might miss interactions outside the selected code. A feature-wide specification exposes those interactions but requires more design review. Expand context when the contract crosses modules, not merely because the assistant can process more files.
Architecture / decision scenario
A team adds streamed generation to an existing support API. It uses Kiro to draft a specification covering input validation, progress delivery, disconnects, and final completion. Engineers correct the specification before implementation and require failure cases as well as the normal stream.
One SDK adapter remains difficult to maintain. An engineer uses Q Developer Explain, then Refactor, to separate decoding from completion classification. Generate tests supplies candidate fixtures; the reviewer adds an independent disconnected-stream case that the generated tests omitted. A Kiro Agent hook requests documentation updates when the adapter changes.
Load measurements then identify repeated application-side transformation work. Q Developer Optimize proposes a patch. The team reruns the same concurrency workload and acceptance cases, accepting the patch only if latency improves without turning partial output into success. The tools contribute generation, refactoring, testing, and optimization; the contract and measurements decide release readiness.
Common exam traps
- Choosing a selected-code Q IDE action as the complete plan for a cross-module feature that needs a reviewed Kiro specification.
- Assuming Generate tests proves integration or model-quality correctness.
- Calling any faster implementation a safe refactor without checking behavior.
- Restating project conventions in every chat instead of recording them in Kiro steering files.
- Treating the Q Developer CLI rebrand as the removal of every Q Developer capability.
What to remember
- Supply contracts, failure cases, and measured targets before requesting changes.
- Use Q IDE actions for bounded code work and Kiro specs for feature coordination.
- Review generated tests against acceptance conditions written independently.
- Measure performance improvements on the same workload and quality gates.
- Account for the Q CLI rebrand when choosing development surfaces.
Knowledge check
A team adds streamed generation to an existing API. The change spans request validation, progress delivery and disconnect handling across several modules. Which assistance workflow fits that scope?
Every chat about a GenAI integration starts with the same instructions: which SDK wrapper to use, the error taxonomy, and which layer owns retries. Where should those instructions live?
Q Developer Generate tests produces a suite for a new streaming adapter, and every test passes. A reviewer then finds that both the adapter and the tests treat a disconnected stream as a completed answer. What should the team add?
Q Developer Optimize proposes a patch that cuts p95 latency by 30% on a benchmark of successful responses, partly by removing the check that marks partial output as incomplete. When should the team accept it?