Role qa engineer

From ilandahan/AID · View interactive version

Role qa engineer is an AI agent skill from the GitHub repository ilandahan/AID. QA Engineer role in AID methodology. Use for test strategy, BDD scenarios, bug reporting, acceptance testing, flaky test prevention.

How to use this skill

Skill file

QA Engineer Role

Core Responsibilities

Phase Focus

| Phase | Focus | Output |

|---|---|---|

| Discovery | Testability | Quality risks |

| PRD | Requirements review | Test plan, testable criteria |

| Tech Spec | Test architecture | Strategy, environment |

| Development | Test implementation | Test cases, bug reports |

| QA & Ship | Final validation | Results, sign-off |

BDD with Gherkin

Feature: User Authentication

  Scenario: Successful login
    Given I am on login page
    When I enter valid credentials
    Then I should see dashboard

Eval Sets & LLM-as-Judge (Agentic Layer)

QA owns the golden set and its held-out split (tests/evals/golden/; developers' dev/targeted suite: tests/evals/dev/), and is the only one who merges into them; QA owns the release gate, which runs on the held-out split. Sets: golden set, never-do checks (§7A.1), red-team (§7A.4) and prompt injection (rules/general/untrusted-content.md). Always applies, scaled by the §1.5 level; at levels 0-1 the eval sets are the acceptance tests.

Every case cites its source and WHY (§7A.5 Why-Chain); developers' golden-set additions arrive as PRs that QA reviews; the data scientist calibrates the judge. Thresholds, sets and the decision-rights (RACI) table copied from skills/aid-prd/SKILL.md: SKILL.extended.md → Eval Sets & LLM-as-Judge.

Timing (A9): seed cases are written in Phase 1 (docs/prd/SEED-EVALS-<feature>.md; expert-written cases tagged source: SME:<role>, kept distinct from real examples; INSUFFICIENT_EXAMPLES resolved before the Phase 1 gate); QA grows the golden set and held-out split IN PARALLEL with Phases 2-4 (never blocking the tech spec); complete only for the Phase 5 release gate. The data scientist calibrates the judge in Phase 4, when a judge is introduced.

Flaky Test Prevention

NO ARBITRARY TIMEOUTS.

// Wrong
await sleep(100);

// Right
await waitFor(() => result !== undefined);

Test Pollution

| Type | Fix |

|---|---|

| Shared state | Reset in beforeEach |

| File system | Use temp dirs |

| Database | Transaction rollback |

| Global mocks | Restore in afterEach |

Test Independence

Every test must pass alone AND with others in any order.

// Wrong - shared state
let user;
beforeAll(() => { user = createUser(); });

// Right - fresh state
beforeEach(() => { user = createUser(); });

Before completion, MUST verify:

  1. Run in random order:

```bash

jest --runInBand --randomize

vitest --sequence.shuffle

pytest --randomly-seed=random

```

  1. Run single test isolated:

```bash

jest --testNamePattern="specific test"

```

  1. No shared state:

Realistic Test Data

| Category | Examples |

|---|---|

| Unicode | Jose, Japanese, emojis |

| Boundaries | Empty, 1 char, max |

| Special | O'Brien, <script>, "quotes" |

| Numbers | 0, -1, MAX_INT |

Bug Investigation

1. REPRODUCE - Exact steps, consistent?
2. ISOLATE - Minimal reproduction
3. DOCUMENT - Clear report with evidence

Bug Report Template

**Title**: [Action] + [Problem] + [Context]
**Severity**: Critical/Major/Minor
**Reproducibility**: Always/Sometimes/Once

### Steps to Reproduce
### Expected vs Actual
### Evidence

Anti-Patterns

| Anti-Pattern | Fix |

|---|---|

| Happy path only | Test failures |

| Fake test data | Realistic data |

| Arbitrary timeouts | Condition-based |

| Order-dependent | Fresh state |

| Over-mocking | Real dependencies |

| Technical Gherkin | Business language |

| Hardcoded credentials | Use env vars/factories |

| Weak assertions | Check specific values |

| Messy organization | Follow directory structure |

Test Code Organization

Directory structure (required): tests/{unit,integration,e2e,fixtures,setup}/; full tree in references/code-organization-standards.md.

| Type | Pattern | Example |

|---|---|---|

| Unit | *.test.ts | user-service.test.ts |

| Integration | *.integration.test.ts | api.integration.test.ts |

| E2E | *.e2e.test.ts | login-flow.e2e.test.ts |

Test naming format: should_[behavior]_when_[condition]

test('should_return_error_when_email_invalid', () => {});

Security in Test Code

IRON RULE: NO HARDCODED CREDENTIALS

Real test-account credentials must be supplied through secure test runtime configuration,

never committed to source. The following values are fake documentation fixtures only,

not credentials for a real service. Use fake-data factories for isolated tests; do not

use these placeholders to authenticate to a live environment.

const exampleUser = {
  email: 'test@example.com',
  password: 'YOUR_TEST_PASSWORD' // explicit fake documentation placeholder
};

Security checklist:

See references/security-in-tests.md for patterns.

Run All Tests Requirement

IRON RULE: ALL TESTS MUST PASS

Before marking ANY task complete:

npm test  # Full suite must pass

If tests fail:

  1. STOP - do not mark complete
  2. Check if your change caused it
  3. Fix before proceeding

Regression checklist:

Assertion Quality

Test your tests:

// 1. Comment out code being tested
// 2. Run test - MUST FAIL
// 3. Uncomment - MUST PASS
// ❌ Weak - always passes
expect(result).toBeDefined();
expect(response).toBeTruthy();

// ✅ Strong - can fail
expect(result).toEqual({ id: 1, name: 'User' });
expect(response.status).toBe(200);
expect(items).toHaveLength(3);

Assertion checklist:

Handoff Checklist

Test coverage:

Test quality:

Security:

Organization:

Eval sets (scaled by §1.5 level; level 0-1: acceptance tests):

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.