Learn to use AI-powered Accelerator agents — from Agents to Hero
View the Project on GitHub devopsabcs-engineering/agentic-accelerator-workshop
| Duration | 35 minutes |
| Level | Intermediate |
| Prerequisites | Lab 00, Lab 01, Lab 02 |
By the end of this lab, you will be able to:
Before running any agents, establish a baseline by measuring the current test coverage.
Open a terminal in VS Code (Ctrl+ ) and navigate to the sample app:
cd sample-app
Run the test suite with coverage reporting:
npm test -- --coverage
__tests__/placeholder.test.ts.
Use the Code Quality Detector agent to get a comprehensive quality analysis.
Ctrl+Shift+I).Type the following prompt:
@code-quality-detector Analyze sample-app/ for code quality issues including coverage, complexity, and maintainability
Review the findings. The detector should identify issues such as:
| Finding | Category | File |
|---|---|---|
| Test coverage below 80% threshold | Coverage | Project-wide |
| High cyclomatic complexity | Complexity | sample-app/src/lib/utils.ts |
Use of any type annotations |
Type Safety | Multiple files |
| Code duplication in utility functions | Maintainability | sample-app/src/lib/ |
| Missing error handling | Reliability | sample-app/src/lib/db.ts |

Use the Test Generator agent to create unit tests for one of the uncovered files.
In Copilot Chat, type:
@test-generator Generate unit tests for sample-app/src/lib/utils.ts to improve coverage
Review the generated test file. The agent should produce tests that cover:
utils.tsExamine the test structure. The generated tests should use Jest syntax (describe, it, expect) consistent with the project configuration in jest.config.ts.

Apply the generated tests and measure the coverage improvement.
Copy the generated test code into a new file:
# Create the test file (paste the generated content)
code sample-app/__tests__/utils.test.ts
Re-run the test suite with coverage:
cd sample-app
npm test -- --coverage
src/lib/utils.ts.
Before proceeding, verify:
utils.tsProceed to Lab 06.