Quality Agents
QA Backend, QA Frontend, and QA Firmware - the testing layer
Overview
Quality agents form the testing layer of your AI team. Each agent specializes in a different testing domain, from API contracts to visual regression. They ensure your code works correctly, performs well, and remains accessible.
| Agent | Domain | Test Types |
|---|---|---|
| QA Backend | Server-side testing | Unit, integration, API, load, security |
| QA Frontend | Client-side testing | Component, E2E, visual regression, a11y |
| QA Firmware | Embedded testing | HIL, protocol, timing, hardware validation |
QA Backend
The QA Backend agent specializes in server-side testing. It writes comprehensive test suites covering unit tests, API integration tests, load tests, and security tests. It understands testing patterns for different backend architectures.
Responsibilities
| Test Type | Purpose | When to Use |
|---|---|---|
| Unit Tests | Test individual functions and classes in isolation | Every function with logic, especially edge cases |
| Integration Tests | Test interactions between components and services | Database queries, external APIs, message queues |
| API Tests | Test HTTP endpoints for contract compliance | Every public API endpoint |
| Load Tests | Test performance under expected and peak load | Before launch, after significant changes |
| Security Tests | Test for vulnerabilities and auth bypass | Auth endpoints, data access, input handling |
Technologies
- Test Runners: Jest, Vitest, pytest, Go testing, JUnit
- API Testing: Supertest, httpx, REST Client, Postman/Newman
- Load Testing: k6, Artillery, Locust, Gatling
- Mocking: MSW, nock, responses, WireMock, testcontainers
- Security: OWASP ZAP, Burp Suite, SQLMap, Snyk
Invoking QA Backend
# Write unit tests
@qa-backend Write unit tests for src/services/order.service.ts
Cover: order creation, validation, price calculation, edge cases.
Target: 90% coverage. Use Jest with TypeScript.
# Write API integration tests
@qa-backend Create API tests for the /api/users endpoints:
- GET /api/users (list with pagination)
- GET /api/users/:id (single user)
- POST /api/users (create)
- PATCH /api/users/:id (update)
- DELETE /api/users/:id (soft delete)
Include auth scenarios and error cases.
# Write load tests
@qa-backend Create a k6 load test for the checkout flow:
- Ramp up: 0 to 100 users over 2 minutes
- Sustained: 100 users for 10 minutes
- Ramp down: 100 to 0 over 1 minute
Thresholds: p95 < 500ms, error rate < 1%
# Write security tests
@qa-backend Create security tests for authentication:
- SQL injection on login
- JWT tampering and expiration
- Rate limiting verification
- CORS policy enforcementTest Organization Pattern
tests/
βββ unit/
β βββ services/
β β βββ order.service.test.ts
β β βββ user.service.test.ts
β βββ utils/
β βββ validation.test.ts
βββ integration/
β βββ api/
β β βββ orders.test.ts
β β βββ users.test.ts
β βββ database/
β βββ repositories.test.ts
βββ load/
β βββ checkout-flow.k6.js
β βββ api-stress.k6.js
βββ security/
βββ auth.security.test.ts
βββ injection.security.test.tsQA Frontend
The QA Frontend agent specializes in client-side testing. It writes component tests, end-to-end tests, visual regression tests, and accessibility audits. It understands modern frontend testing best practices.
Responsibilities
| Test Type | Purpose | When to Use |
|---|---|---|
| Component Tests | Test UI components in isolation with various props | Every reusable component |
| E2E Tests | Test complete user flows through the application | Critical paths: auth, checkout, core features |
| Visual Regression | Detect unintended visual changes | Design system components, landing pages |
| Accessibility Tests | Ensure WCAG compliance and screen reader support | All user-facing pages and components |
Technologies
- Component Testing: Testing Library, Storybook, Vitest
- E2E: Playwright, Cypress, WebdriverIO
- Visual Regression: Playwright screenshots, Percy, Chromatic
- Accessibility: axe-core, Pa11y, Lighthouse, WAVE
- Mocking: MSW (Mock Service Worker), Mirage JS
Invoking QA Frontend
# Write component tests
@qa-frontend Write tests for the DataTable component:
- Renders with data
- Handles empty state
- Sorting functionality
- Pagination controls
- Row selection
Use Testing Library with Vitest.
# Write E2E tests
@qa-frontend Create Playwright E2E tests for checkout:
1. Add items to cart
2. Proceed to checkout
3. Fill shipping info
4. Enter payment details
5. Complete order
6. Verify confirmation page
Include error scenarios and edge cases.
# Visual regression tests
@qa-frontend Set up visual regression for the design system:
- Button variants (primary, secondary, ghost)
- Form inputs (text, select, checkbox)
- Cards and modals
- Dark mode variants
Use Playwright screenshots with comparison.
# Accessibility audit
@qa-frontend Create accessibility tests for the main pages:
- Home page
- Product listing
- Product detail
- Checkout flow
Use axe-core integration with Playwright.
Flag any WCAG 2.1 AA violations.E2E Test Structure
// tests/e2e/checkout.spec.ts
import { test, expect } from '@playwright/test';
test.describe('Checkout Flow', () => {
test.beforeEach(async ({ page }) => {
// Set up authenticated user with items in cart
await page.goto('/');
await loginAsTestUser(page);
await addItemToCart(page, 'product-123');
});
test('completes checkout successfully', async ({ page }) => {
await page.goto('/checkout');
// Fill shipping
await page.getByLabel('Address').fill('123 Test St');
await page.getByLabel('City').fill('Test City');
await page.getByRole('button', { name: 'Continue' }).click();
// Fill payment
await page.getByLabel('Card number').fill('4242424242424242');
await page.getByRole('button', { name: 'Place Order' }).click();
// Verify confirmation
await expect(page.getByRole('heading', { name: 'Order Confirmed' }))
.toBeVisible();
await expect(page.getByText(/Order #/)).toBeVisible();
});
test('shows error for invalid card', async ({ page }) => {
// ... test invalid payment scenario
});
});sleep(). Use waitFor and expect with appropriate timeouts. Flaky tests erode confidence.QA Firmware
The QA Firmware agent specializes in embedded systems testing. It designs Hardware-in-the-Loop (HIL) tests, protocol validation, timing verification, and hardware interface testing.
Responsibilities
| Test Type | Purpose | When to Use |
|---|---|---|
| HIL Testing | Test firmware with real or simulated hardware | Integration with sensors, actuators, peripherals |
| Protocol Validation | Verify communication protocol compliance | BLE, CAN, I2C, SPI, custom protocols |
| Timing Verification | Ensure real-time constraints are met | RTOS tasks, interrupt latency, PWM accuracy |
| Power Analysis | Measure and verify power consumption | Battery-powered devices, sleep mode testing |
Technologies
- HIL Frameworks: Robot Framework, pytest-embedded, Unity
- Protocol Analyzers: Saleae Logic, Wireshark, BLE sniffers
- Timing Tools: Logic analyzers, oscilloscopes, SEGGER SystemView
- Power Analysis: Nordic PPK, Joulescope, multimeters
- Simulation: Renode, QEMU, vendor simulators
Invoking QA Firmware
# HIL test setup
@qa-firmware Design HIL tests for the sensor module:
- BME280 temperature/humidity readings
- Accelerometer motion detection
- GPIO interrupt handling
Platform: STM32F4 with pytest-embedded.
Include mock sensor responses for CI.
# Protocol validation
@qa-firmware Create BLE protocol tests for the fitness tracker:
- GATT service discovery
- Heart rate characteristic notifications
- Battery level reads
- Connection/disconnection handling
Use nRF Connect SDK testing framework.
# Timing verification
@qa-firmware Verify timing constraints for motor control:
- PWM frequency: 20kHz Β± 1%
- Control loop: < 1ms worst case
- Interrupt latency: < 10ΞΌs
Document test methodology and acceptance criteria.
# Power analysis test
@qa-firmware Create power consumption test suite:
- Active mode: < 15mA
- Sleep mode: < 50ΞΌA
- Wake-up time: < 5ms
Include automated power profiling script.HIL Test Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Test Host (PC) β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β pytest β β Robot β β Test Results β β
β β runner β β Framework β β & Reports β β
β ββββββββ¬βββββββ ββββββββ¬βββββββ βββββββββββββββββββββββ β
β β β β
β ββββββββββ¬ββββββββ β
β β β
ββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ
β USB/Serial/Debug
ββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ
β βΌ Device Under Test (DUT) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Firmware β β
β β ββββββββββββ ββββββββββββ ββββββββββββββββββββ β β
β β β Sensors β β Comms β β Test Harness β β β
β β β Drivers β β Stack β β (embedded) β β β
β β ββββββββββββ ββββββββββββ ββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β Logic β β Power β β Mock Hardware β β
β β Analyzer β β Monitor β β (optional) β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββTest-First Development
Quality agents work best when engaged early. Here's how to integrate them into your development workflow:
Parallel Test Development
# When implementing a new feature, run tests in parallel
@work-orchestrator Coordinate feature implementation with tests:
Parallel Track A (Implementation):
@backend-engineer: Implement order service
@frontend-engineer: Build order form
Parallel Track B (Tests):
@qa-backend: Write order service tests (based on spec)
@qa-frontend: Write order form tests (based on spec)
Integration Point:
Both tracks complete β Run full test suite β Fix any gapsTest Coverage Strategy
# Define coverage requirements upfront
@qa-backend Review the order module and create test plan:
Coverage Requirements:
βββ Unit Tests
β βββ Business logic: 90%+
β βββ Utilities: 80%+
β βββ Types/DTOs: skip (no logic)
β
βββ Integration Tests
β βββ Database operations: all repositories
β βββ External APIs: all integrations
β βββ Message queue: all publishers/consumers
β
βββ API Tests
β βββ Happy paths: 100%
β βββ Error cases: all documented errors
β βββ Edge cases: pagination, limits, auth
β
βββ Performance Tests
βββ Baseline: establish current performance
βββ Regression: detect >10% slowdownsContinuous Quality Checks
# CI pipeline integration
name: Quality Gates
on: [push, pull_request]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run test:unit -- --coverage
- run: npx coverage-check --lines 80
integration-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run test:integration
e2e-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npx playwright install
- run: npm run test:e2e
accessibility:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run test:a11yCommon Testing Patterns
Pattern: Contract Testing
# Ensure API contracts between services
@qa-backend Create contract tests for the order-to-payment integration:
- Define expected request/response schemas
- Generate consumer contract
- Verify provider satisfies contract
Use Pact or similar contract testing tool.Pattern: Chaos Testing
# Test system resilience
@qa-backend Create chaos tests for the order service:
- Database connection failures
- External payment service timeouts
- Message queue unavailability
Verify graceful degradation and recovery.Pattern: Mutation Testing
# Verify test quality
@qa-backend Run mutation testing on the pricing module:
- Use Stryker or similar mutation framework
- Target: 80% mutation score
- Identify weak tests that don't catch bugs