flutter-test-strategy
Skill30 starsChanged 4 days agoApache-2.0View on GitHub
Use when deciding what to test in a Flutter/Dart codebase across unit, widget, golden, and integration layers, authoring concise IEEE/ISTQB test-matrix.md (<= 80 lines), and enforcing fail-honest coverage gates.
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Mock or individual test mechanics: Use dart-generate-test-mocks or flutter-add-widget-test once the layer is chosen.
- Very specific: line 18
Non-Dart backend suites: Use test-driven-development or testing-expert.
- Very specific: line 35
Exclusions: Never write dedicated tests for generated files (*.g.dart, *.freezed.dart, *.gr.dart) or trivial getters.
- Very specific: line 38
Tier 1 (Fast-Track): Run only the scoped test file (flutter test <assigned_test>.dart).
- Very specific: line 40
Strict Fail-Honest Verification (
BLOCKED/SKIPPED): If flutter test or integration_test/ (simulator/emulator/Chrome web) cannot …
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter Test Strategy
Overview
Flutter Test Strategy defines lowest-layer test placement (Unit, Widget, Golden, Integration), per-package coverage ratchets, concise IEEE/ISTQB docs/<feature-name>/test-matrix.md (<= 80 lines), and Fail-Honest execution proof across Claude Code and Google Antigravity—complementing dart-add-unit-test, flutter-add-widget-test, flutter-add-widget-preview, flutter-add-integration-test, dart-generate-test-mocks, and dart-collect-coverage.
When to Use
Trigger Scenarios
- Choosing between
Unit,Widget,Golden, andIntegrationtests for a Flutter feature or bugfix. - Authoring Tier 2/3
docs/<feature-name>/test-matrix.md(<= 80 lines) or calibrating per-package LCOV gates.
When NOT to Use
- Mock or individual test mechanics: Use
dart-generate-test-mocksorflutter-add-widget-testonce the layer is chosen. - Non-Dart backend suites: Use
test-driven-developmentortesting-expert.
Process
flowchart LR
A["Change / US-AC"] --> B["Lowest Layer: Unit | Widget | Golden | Integration"]
B --> C["Scoped TDD Loop (Assigned Test Only)"]
C --> D["Full Suite + LCOV Ratchet"]
D --> E["test-matrix.md (<=80 lines) + Exit 0 / BLOCKED"]1. Layering Rule & Design Contract Alignment
Inspect root AGENTS.md (<= 90 lines wired to context/memory/MEMORY.md), official Google root DESIGN.md (<= 110 lines 2-layer YAML + 8 sections), and optional docs/<feature-name>/design.md (<= 35 lines screen delta). Test at the lowest layer that catches the defect (see references/test-pyramid-flutter.md):
- Unit (
package:test): Domain rules, DTO mappers, Notifier/Bloc transitions with fake repos. - Widget (
WidgetTester): Loading/empty/error/data branching, user gestures, 48x48dp & Semantics. - Golden: Pixel/theme/text-scale fidelity against root
DESIGN.mdtokens (flutter-add-widget-preview). - Integration (
integration_test/): Critical multi-screen flows (auth, checkout) on simulator/device/Chrome. - Exclusions: Never write dedicated tests for generated files (
*.g.dart,*.freezed.dart,*.gr.dart) or trivial getters.
2. Actionable IEEE/ISTQB test-matrix.md (<= 80 lines) & Fail-Honest Proof
- Tier 1 (Fast-Track): Run only the scoped test file (
flutter test <assigned_test>.dart); skiptest-matrix.md. - Tier 2 & Tier 3: Author
docs/<feature-name>/test-matrix.md(<= 80 lines) with1. Execution Summaryand2. Test Case Matrixusing per-case columns:TC-01... ->ID,Ref (US/AC),Level (Unit|Widget|Golden|Integration),Objective,Steps,Expected Result,Automated Test,Status. - Strict Fail-Honest Verification (
BLOCKED/SKIPPED): Ifflutter testorintegration_test/(simulator/emulator/Chrome web) cannot execute (missing Flutter SDK, no simulator booted), you MUST reportBLOCKED: Not executed — <exact command & terminal error>(orSKIPPEDwhen N/A)—strictly forbidden from claimingPASSEDwithoutexit code 0terminal output.
Usage
# Scoped TDD loop vs full coverage ratchet excluding generated code
flutter test test/features/cart/cart_notifier_test.dart
flutter test --coverage
lcov --remove coverage/lcov.info '*.g.dart' '*.freezed.dart' '*.gr.dart' -o coverage/filtered.infoRed Flags
- Claiming
PASSEDforflutter testorintegration_test/withoutexit code 0terminal output instead of reportingBLOCKED/SKIPPED. - Exceeding
80 linesor omittingObjective,Steps, orExpected Resultindocs/<feature-name>/test-matrix.md. - Testing generated
*.g.dart/*.freezed.dartfiles, running full test suites inside parallel TDD loops, or skipping regression tests on bugfixes.
Verification
- Domain logic covered by unit tests, UI branching by widget tests, and
DESIGN.mdvisual tokens by golden tests where applicable. - Generated files (
*.g.dart,*.freezed.dart,*.gr.dart) excluded from per-package LCOV ratchets. - Tier 2/3
docs/<feature-name>/test-matrix.mdstays<= 80 lineswith full IEEE/ISTQBTC-01... columns. - Every test tier verified by
exit code 0terminal output or explicitly markedBLOCKED: Not executed — <exact command & terminal error>/SKIPPED.
References
- Deciding the Layer — Worked Examples
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-challengerSkill
- agent-metricsSkill
- bigquery-query-optimizationSkill
- blackbox-testerSkill
- build-and-ci-gatesSkill
- cdc-scd-patternsSkill
- code-criticSkill
- code-implementerSkill
- code-smells-expertSkill
- commit-expertSkill
- compliance-verifierSkill
- context-captureSkill
- context-restoreSkill
- database-migration-expertSkill
- design-spec-expertSkill
- documentation-expertSkill
- flutter-architecture-decisionsSkill
- flutter-performance-profilingSkill
- flutter-release-engineeringSkill
- flutter-review-checklistSkill
- flutter-senior-orchestrationSkill
- flutter-upgrade-migrationSkill
- gcp-data-engineeringSkill
- guidelines-karpathySkill
- loop-engineeringSkill
- performance-scalabilitySkill
- product-analystSkill
- pull-request-expertSkill
- python-expertSkill
- qa-testerSkill
- refactoring-code-expertSkill
- repo-researchSkill
- security-auditSkill
- senior-architect-engineeringSkill
- senior-dev-orchestratorSkill
- sql-query-optimizationSkill
- test-driven-developmentSkill
- testing-expertSkill
- ui-ux-designerSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

