Testing Strategy
Relevant source files
The following files were used as context for generating this wiki page:
The Testing Strategy for the bl1nk Skill Platform is an integrated, multi-layered approach designed to ensure high-quality feature development from conception to deployment. It encompasses automated CI/CD pipelines, test-driven development (TDD) workflows within feature specifications, and multi-platform validation for desktop applications. The strategy prioritizes incremental progress, early validation of core functionality, and comprehensive coverage across unit, integration, and end-to-end (E2E) testing tiers.
Sources: specs/main/plan.md, Comprehensive.md, plugins/kiro-skill/skills/kiro-skill/SKILL.md
Test-Driven Development (TDD) Workflow
The project utilizes a spec-driven development methodology where testing is integrated into the design and task planning phases. Implementation tasks are explicitly structured as prompts for a code-generation LLM to implement features in a test-driven manner, ensuring that tests are prioritized before or alongside functional code.
TDD Execution Flow
- Design Validation: The testing strategy is defined during the design phase, covering unit, integration, and performance considerations.
- Incremental Tasks: Tasks are broken down into discrete coding steps that prioritize early testing and incremental builds.
- Sub-task Verification: Sub-tasks often include specific requirements for writing unit tests alongside the implementation of models or services.
The diagram shows the iterative TDD loop integrated into the task execution phase.
Sources: plugins/kiro-skill/skills/kiro-skill/SKILL.md:162-200, plugins/kiro-skill/commands/kiro/spec.md:200-220
Testing Tiers and Tools
The platform employs a variety of testing levels to ensure stability across the monorepo.
| Testing Level | Scope | Primary Tooling |
|---|---|---|
| Unit Testing | Models, utility functions, and isolated logic. | Vitest |
| Integration Testing | API endpoint interactions and service layer connections. | Vitest, tRPC |
| End-to-End (E2E) | Full user flows within the Electron environment. | Playwright |
| Database Validation | Schema integrity and Prisma model validation. | Prisma CLI |
| Syntax/Quality | Code style, linting, and workflow syntax. | ESLint, actionlint, Markdown lint |
Sources: specs/main/plan.md:15-25, Comprehensive.md:88-105
CI/CD Pipeline Automation
The CI/CD infrastructure, managed via GitHub Actions, enforces testing standards on every push and pull request. The "CI Pipeline" (ci.yml) executes a battery of checks to maintain a target project health score of 9.5/10.
CI Workflow Architecture
This flowchart illustrates the parallel and sequential execution of the CI pipeline.
Key Pipeline Features:
- Caching Strategy: The pipeline caches the pnpm store,
node_modules, Playwright browsers, and build artifacts to keep execution under 15 minutes. - Coverage Thresholds: Unit tests are required to maintain a coverage threshold of 80%.
- Multi-Platform Matrix: E2E tests are executed across Ubuntu, Windows, and macOS runners to ensure cross-platform compatibility for the Electron-based client.
Sources: specs/main/plan.md:150-180, Comprehensive.md:108-125
Specialized Testing Modules
E2E Test Restructuring
The E2E test suite, consisting of over 80 tests, is organized into feature-based categories:
- Chat: Testing messaging flows.
- Providers: Validation for external AI providers (Azure, Ollama).
- Context: Testing system mentions and context handling.
- Core: Validating engine and setup procedures.
Security and Quality Scanning
The security scanning workflow (security-scan.yml) provides automated analysis for:
- Dependency vulnerabilities (Snyk).
- Static code analysis (CodeQL, SonarCloud).
- Secret detection to prevent accidental exposure of credentials.
Sources: Comprehensive.md:132-145, specs/main/plan.md:210-230
Configuration and Implementation
Testing behavior is governed by root-level and app-specific configuration files.
// Example ESLint Configuration for Quality Enforcement
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-function-return-type": "warn"
}
}
Sources: Comprehensive.md:155-170, specs/main/plan.md:105-115
The Testing Strategy ensures that every feature developed through the bl1nk platform is grounded in requirements, verified by architecture-aligned designs, and validated through a rigorous automated pipeline before release.