Logo: Testing Strategy

Testing Strategy

Communautéit
Omar-Obando
testing-strategy

Use when designing comprehensive testing strategies, implementing test coverage, setting up CI/CD quality gates, and defining unit, integration, and E2E test approaches. Includes testing pyramid, coverage thresholds, and test automation best practices. Based on software testing certification standards and industry best practices.

Iwwersiicht

EditeurOmar-Obando
Repositoryqwen-orchestrator
Skill-Nummtesting-strategy
Stären
53
Forks
13
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Omar-Obando huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Testing Strategy an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/testing-strategy
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Omar-Obando/qwen-orchestrator.git /tmp/qwen-orchestrator
mkdir -p .claude/skills
cp -r /tmp/qwen-orchestrator/skills/testing-strategy .claude/skills/testing-strategy
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Testing Strategy an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Testing Strategy automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Testing Strategy net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Testing Strategy Skill — Comprehensive Test Coverage

Overview

This skill provides comprehensive guidance for designing and implementing testing strategies for software projects. It covers the testing pyramid, coverage thresholds, CI/CD integration, and test automation best practices. Based on software testing certification standards and industry best practices.

When to Use

Use this skill when:

  • Designing test strategy for new projects
  • Setting up CI/CD quality gates
  • Defining test coverage requirements
  • Implementing unit, integration, and E2E tests
  • Optimizing test execution time
  • Improving test reliability
  • Creating testing pyramid architecture
  • Setting coverage thresholds for different layers
  • Implementing test data management strategies
  • Building test automation frameworks
  • Creating test reporting and dashboards
  • Implementing flaky test detection
  • Setting up parallel test execution
  • Building test environment management
  • Implementing test coverage reporting
  • Creating test quality gates
  • Setting up test performance baselines
  • Implementing test result analysis
  • Building test maintenance strategies
  • Creating test documentation standards
  • Implementing test security scanning
  • Setting up test monitoring and alerting
  • Building test optimization strategies
  • Creating test team structure and roles

Do NOT use this skill when:

  • Writing specific test cases (use TDD workflow skill)
  • Debugging specific test failures (use debugging skill)
  • Writing production code (use implementer agent or specific framework skill)
  • Designing database schema (use database design skill)

Testing Pyramid

    ┌─────────────────┐
    │     E2E Tests   │  ~5-10% of tests
    │ (Integration)   │  Slow, comprehensive
    ├─────────────────┤
    │ Integration     │  ~20-30% of tests
    │   Tests         │  Medium, module interactions
    ├─────────────────┤
    │   Unit Tests    │  ~60-75% of tests
    │                 │  Fast, isolated logic
    └─────────────────┘

Rationale

LayerSpeedCostCoverageReliability
UnitFastLowHighHigh
IntegrationMediumMediumMediumMedium
E2ESlowHighLowLow

Coverage Requirements

Minimum Thresholds

LayerMinimum CoverageCritical Paths
Unit80%90%+
Integration70%85%+
E2E60%80%+

Coverage by Component

Component TypeCoverage TargetRationale
Business Logic90%+Critical path
API Layer85%+Integration points
UI Components70%+Visual regression
Utilities80%+Reusable logic

Test Categories

Unit Tests

Purpose: Test individual functions/classes in isolation

Characteristics:

  • Fast execution (ms to seconds)
  • No external dependencies
  • Mock all external calls
  • High coverage target

Example Structure:

typescript
describe('UserService', () => {
  let service: UserService;
  let repository: jest.Mocked<UserRepository>;

  beforeEach(() => {
    repository = createMockRepository();
    service = new UserService(repository);
  });

  it('should create user successfully', async () => {
    // Arrange
    const userInput = { name: 'John', email: 'john@example.com' };
    const expectedUser = { id: '1', ...userInput };

    repository.create.mockResolvedValue(expectedUser);

    // Act
    const result = await service.createUser(userInput);

    // Assert
    expect(result).toEqual(expectedUser);
    expect(repository.create).toHaveBeenCalledWith(userInput);
  });

  it('should reject duplicate email', async () => {
    // Arrange
    const userInput = { name: 'John', email: 'duplicate@example.com' };
    repository.create.mockRejectedValue(new Error('Email exists'));

    // Act & Assert
    await expect(service.createUser(userInput)).rejects.toThrow('Email exists');
  });
});

Integration Tests

Purpose: Test interactions between components

Characteristics:

  • Medium execution time (seconds)
  • May use real dependencies
  • Test module boundaries
  • Clean up after tests

Example Structure:

typescript
describe('User API Integration', () => {
  let app: INestApplication;
  let db: DatabaseService;

  beforeAll(async () => {
    app = await createTestApp();
    db = app.get(DatabaseService);
  });

  afterAll(async () => {
    await app.close();
  });

  it('should create and retrieve user', async () => {
    const userData = { name: 'Jane', email: 'jane@example.com' };

    const response = await request(app.getHttpServer())
      .post('/api/v1/users')
      .send(userData)
      .expect(201);

    expect(response.body.email).toBe(userData.email);

    const getResponse = await request(app.getHttpServer())
      .get(`/api/v1/users/${response.body.id}`)
      .expect(200);

    expect(getResponse.body.email).toBe(userData.email);
  });
});

E2E Tests

Purpose: Test complete user workflows

Characteristics:

  • Slow execution (minutes)
  • Real external dependencies
  • Test user journeys
  • High maintenance cost

Example Structure:

typescript
describe('User Registration Flow', () => {
  beforeAll(async () => {
    await page.goto('http://localhost:3000');
  });

  it('should complete registration', async () => {
    // Navigate to registration
    await page.click('a[href="/register"]');

    // Fill form
    await page.type('#name', 'Test User');
    await page.type('#email', `test${Date.now()}@example.com`);
    await page.type('#password', 'Password123!');

    // Submit
    await page.click('button[type="submit"]');

    // Verify success
    await page.waitForSelector('.success-message');
    const successText = await page.$eval(
      '.success-message',
      (el) => el.textContent
    );
    expect(successText).toContain('Welcome');
  });
});

CI/CD Integration

Quality Gates Pipeline

yaml
name: Quality Gates

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'

      - run: npm ci

      # Unit tests with coverage
      - run: npm run test:unit -- --coverage
      - uses: codecov/codecov-action@v4
        with:
          files: coverage/lcov.info
          fail_ci_if_error: true

      # Integration tests
      - run: npm run test:integration

      # E2E tests (optional)
      - run: npm run test:e2e

Coverage Gate Example

yaml
# Check coverage threshold
- name: Check coverage
  run: |
    coverage=$(jq '.total.lines.pct' coverage/coverage-summary.json)
    if (( $(echo "$coverage < 80" | bc -l) )); then
      echo "Coverage $coverage% is below 80% threshold"
      exit 1
    fi

# Check test count
- name: Check test count
  run: |
    tests=$(jq '.numTotalTests' reports/test-results.json)
    if [ "$tests" -lt 100 ]; then
      echo "Test count $tests is below minimum of 100"
      exit 1
    fi

Test Organization

File Structure

tests/
├── unit/                    # Unit tests
│   ├── services/
│   │   ├── user.service.spec.ts
│   │   └── order.service.spec.ts
│   ├── repositories/
│   │   └── user.repository.spec.ts
│   └── utils/
│       └── validation.spec.ts
├── integration/            # Integration tests
│   ├── api/
│   │   ├── user.api.spec.ts
│   │   └── order.api.spec.ts
│   └── database/
│       └── database.spec.ts
└── e2e/                    # End-to-end tests
    ├── user-flow.spec.ts
    └── order-flow.spec.ts

Test Naming Convention

[What]_[Condition]_[ExpectedResult].spec.ts

Examples:
- UserService_createUser_success.spec.ts
- UserService_createUser_duplicateEmail_throws.spec.ts
- UserController_createUser_returns201.spec.ts

Test Data Management

Factories

typescript
// factories/user-factory.ts
export const createUser = (overrides = {}): User => {
  return {
    id: uuid(),
    name: fake().person.fullName(),
    email: fake().internet.email(),
    isActive: true,
    createdAt: new Date(),
    ...overrides,
  };
};

// Usage
const user = createUser({ name: 'Custom Name' });

Test Scenarios

typescript
// test-data/user-scenarios.ts
export const userScenarios = {
  valid: { name: 'John', email: 'john@example.com' },
  invalidEmail: { name: 'John', email: 'invalid' },
  missingName: { email: 'john@example.com' },
  existingEmail: { name: 'John', email: 'existing@example.com' },
};

Mocking Strategy

What to Mock

  • External APIs
  • Database connections
  • File system
  • Time (date/time functions)
  • Random values

What NOT to Mock

  • Pure functions
  • Business logic
  • Domain models

Mocking Tools

ToolPurpose
VitestTesting framework
ts-mockitoObject mocking
nockHTTP mocking
jest-date-mockTime mocking

Common Anti-Patterns

❌ Bad: Testing Implementation Details

typescript
// ❌ BAD: Testing implementation
it('should call service method', () => {
  const spy = vi.spyOn(service, 'execute');
  component.ngOnInit();
  expect(spy).toHaveBeenCalled();
});

// ✅ GOOD: Testing behavior
it('should process order', () => {
  const result = component.processOrder(order);
  expect(result.status).toBe('processed');
});

❌ Bad: Flaky Tests

typescript
// ❌ BAD: Non-deterministic
it('should process quickly', () => {
  const start = Date.now();
  process();
  expect(Date.now() - start).toBeLessThan(1000);
});

// ✅ GOOD: Deterministic
it('should process order', () => {
  const result = process(order);
  expect(result.status).toBe('processed');
});

❌ Bad: Test Interdependence

typescript
// ❌ BAD: Tests depend on each other
it('should create user', () => {
  /* ... */
});
it('should update user', () => {
  /* uses user from prev test */
});

// ✅ GOOD: Independent tests
it('should create user', () => {
  /* ... */
});
it('should update user', () => {
  /* ... */
});

Real-World Impact

Before this skill:

  • No test coverage targets
  • Flaky tests in CI
  • Slow test execution
  • Low confidence in deployments

After this skill:

  • Clear coverage targets (80%+)
  • Fast, reliable tests
  • CI/CD quality gates
  • High deployment confidence

Cross-References

  • tdd-workflow - For test-driven development process
  • devops-pipeline - For CI/CD pipeline setup
  • security-auditor - For security testing

References

Heefeg gestallte Froen

Wat mécht de KI-Skill Testing Strategy?

Use when designing comprehensive testing strategies, implementing test coverage, setting up CI/CD quality gates, and defining unit, integration, and E2E test approaches. Includes testing pyramid, coverage thresholds, and test automation best practices. Based on software testing certification standards and industry best practices.

Firwat Testing Strategy op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Testing Strategy besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Testing Strategy an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/testing-strategy an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Testing Strategy benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Testing Strategy benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Testing Strategy domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Testing Strategy gratis?

Jo. Omar-Obando huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇