Skip to content

Commit 84a70d8

Browse files
muratkeremozcanMurat Ozcan
andauthored
reafactor: test arch audit (#758)
Co-authored-by: Murat Ozcan <murat@mac.lan>
1 parent bee9c5d commit 84a70d8

8 files changed

Lines changed: 19 additions & 342 deletions

File tree

src/modules/bmm/workflows/testarch/atdd/workflow.yaml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,7 @@ template: "{installed_path}/atdd-checklist-template.md"
1818

1919
# Variables and inputs
2020
variables:
21-
# Story context
22-
story_file: "" # Path to story markdown with acceptance criteria
23-
test_dir: "{project-root}/tests"
24-
test_framework: "" # Detected from framework workflow (playwright, cypress)
25-
26-
# Test level selection
27-
test_levels: "e2e,api,component" # Which levels to generate
28-
primary_level: "e2e" # Primary test level for acceptance criteria
29-
include_component_tests: true # Generate component tests for UI logic
30-
31-
# ATDD approach
32-
start_failing: true # Tests must fail initially (red phase)
33-
use_given_when_then: true # BDD-style test structure
34-
network_first: true # Route interception before navigation
35-
one_assertion_per_test: true # Atomic test design
36-
37-
# Data and fixtures
38-
generate_factories: true # Create data factory stubs
39-
generate_fixtures: true # Create fixture architecture
40-
auto_cleanup: true # Fixtures clean up their data
41-
42-
# Output configuration
43-
output_checklist: "{output_folder}/atdd-checklist-{story_id}.md"
44-
include_data_testids: true # List required data-testid attributes
45-
include_mock_requirements: true # Document mock/stub needs
46-
47-
# Advanced options
48-
auto_load_knowledge: true # Load fixture-architecture, data-factories, component-tdd fragments
49-
share_with_dev: true # Provide implementation checklist to DEV agent
21+
test_dir: "{project-root}/tests" # Root test directory
5022

5123
# Output configuration
5224
default_output_file: "{output_folder}/atdd-checklist-{story_id}.md"

src/modules/bmm/workflows/testarch/automate/workflow.yaml

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -18,61 +18,13 @@ template: false
1818

1919
# Variables and inputs
2020
variables:
21-
# Execution mode
21+
# Execution mode and targeting
2222
standalone_mode: true # Can work without BMad artifacts (true) or integrate with BMad (false)
23-
24-
# Target specification (flexible - can be story, feature, or directory)
25-
story_file: "" # Path to story markdown (optional - only if BMad workflow)
26-
target_feature: "" # Feature name or directory to analyze (e.g., "user-authentication" or "src/auth/")
27-
target_files: "" # Specific files to analyze (comma-separated paths)
28-
29-
# Discovery and analysis
30-
test_dir: "{project-root}/tests"
31-
source_dir: "{project-root}/src"
32-
auto_discover_features: true # Automatically find features needing tests
33-
analyze_coverage: true # Check existing test coverage gaps
34-
35-
# Coverage strategy
3623
coverage_target: "critical-paths" # critical-paths, comprehensive, selective
37-
test_levels: "e2e,api,component,unit" # Which levels to generate (comma-separated)
38-
avoid_duplicate_coverage: true # Don't test same behavior at multiple levels
39-
40-
# Test priorities (from test-priorities.md knowledge fragment)
41-
include_p0: true # Critical paths (every commit)
42-
include_p1: true # High priority (PR to main)
43-
include_p2: true # Medium priority (nightly)
44-
include_p3: false # Low priority (on-demand)
45-
46-
# Test design principles
47-
use_given_when_then: true # BDD-style test structure
48-
one_assertion_per_test: true # Atomic test design
49-
network_first: true # Route interception before navigation
50-
deterministic_waits: true # No hard waits or sleeps
51-
52-
# Infrastructure generation
53-
generate_fixtures: true # Create/enhance fixture architecture
54-
generate_factories: true # Create/enhance data factories
55-
update_helpers: true # Add utility functions
56-
57-
# Integration with BMad artifacts (when available)
58-
use_test_design: true # Load test-design.md if exists
59-
use_tech_spec: true # Load tech-spec.md if exists
60-
use_prd: true # Load PRD.md if exists
61-
62-
# Output configuration
63-
update_readme: true # Update test README with new specs
64-
update_package_scripts: true # Add test execution scripts
65-
output_summary: "{output_folder}/automation-summary.md"
66-
67-
# Quality gates
68-
max_test_duration: 90 # seconds (1.5 minutes per test)
69-
max_file_lines: 300 # lines (keep tests lean)
70-
require_self_cleaning: true # All tests must clean up data
7124

72-
# Advanced options
73-
auto_load_knowledge: true # Load test-levels, test-priorities, fixture-architecture, selective-testing, ci-burn-in
74-
run_tests_after_generation: true # Verify tests pass/fail as expected
75-
auto_validate: true # Always validate generated tests
25+
# Directory paths
26+
test_dir: "{project-root}/tests" # Root test directory
27+
source_dir: "{project-root}/src" # Source code directory
7628

7729
# Output configuration
7830
default_output_file: "{output_folder}/automation-summary.md"

src/modules/bmm/workflows/testarch/ci/workflow.yaml

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,8 @@ validation: "{installed_path}/checklist.md"
1717

1818
# Variables and inputs
1919
variables:
20-
ci_platform: "auto" # auto, github-actions, gitlab-ci, circle-ci, jenkins
21-
test_framework: "" # Detected from framework workflow (playwright, cypress)
22-
test_dir: "{project-root}/tests"
23-
config_file: "" # Framework config file path
24-
node_version_source: "{project-root}/.nvmrc" # Node version for CI
25-
26-
# Execution configuration
27-
parallel_jobs: 4 # Number of parallel test shards
28-
burn_in_enabled: true # Enable burn-in loop for flaky test detection
29-
burn_in_iterations: 10 # Number of burn-in iterations
30-
selective_testing_enabled: true # Enable changed test detection
31-
32-
# Artifact configuration
33-
artifact_retention_days: 30
34-
upload_artifacts_on: "failure" # failure, always, never
35-
artifact_types: "traces,screenshots,videos,html-report" # Comma-separated
36-
37-
# Performance tuning
38-
cache_enabled: true # Enable dependency caching
39-
browser_cache_enabled: true # Cache browser binaries
40-
timeout_minutes: 60 # Overall job timeout
41-
test_timeout_minutes: 30 # Individual test run timeout
42-
43-
# Notification configuration
44-
notify_on_failure: false # Enable notifications (requires setup)
45-
notification_channels: "" # slack, email, discord
46-
47-
# Output artifacts
48-
generate_ci_readme: true
49-
generate_local_mirror_script: true
50-
generate_secrets_checklist: true
51-
52-
# CI-specific optimizations
53-
use_matrix_strategy: true # Parallel execution across OS/browsers
54-
use_sharding: true # Split tests into shards
55-
retry_failed_tests: true
56-
retry_count: 2
20+
ci_platform: "auto" # auto, github-actions, gitlab-ci, circle-ci, jenkins - user can override
21+
test_dir: "{project-root}/tests" # Root test directory
5722

5823
# Output configuration
5924
default_output_file: "{project-root}/.github/workflows/test.yml" # GitHub Actions default

src/modules/bmm/workflows/testarch/framework/workflow.yaml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,10 @@ validation: "{installed_path}/checklist.md"
1717

1818
# Variables and inputs
1919
variables:
20-
test_framework: "" # playwright or cypress - auto-detect from package.json or ask
21-
project_type: "" # react, vue, angular, next, node - detected from package.json
22-
bundler: "" # vite, webpack, rollup, esbuild - detected from package.json
2320
test_dir: "{project-root}/tests" # Root test directory
24-
config_file: "" # Will be set to {project-root}/{framework}.config.{ts|js}
2521
use_typescript: true # Prefer TypeScript configuration
26-
standalone_mode: true # Can run without story context
27-
28-
# Framework selection criteria
29-
framework_preference: "auto" # auto, playwright, cypress
30-
project_size: "auto" # auto, small, large - influences framework choice
31-
32-
# Output artifacts
33-
generate_env_example: true
34-
generate_nvmrc: true
35-
generate_readme: true
36-
generate_sample_tests: true
22+
framework_preference: "auto" # auto, playwright, cypress - user can override auto-detection
23+
project_size: "auto" # auto, small, large - influences framework recommendation
3724

3825
# Output configuration
3926
default_output_file: "{test_dir}/README.md" # Main deliverable is test setup README

src/modules/bmm/workflows/testarch/nfr-assess/workflow.yaml

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -18,58 +18,8 @@ template: "{installed_path}/nfr-report-template.md"
1818

1919
# Variables and inputs
2020
variables:
21-
# Target specification
22-
story_file: "" # Path to story markdown (optional)
23-
feature_name: "" # Feature to assess (if no story file)
24-
25-
# NFR categories to assess
26-
assess_performance: true # Response time, throughput, resource usage
27-
assess_security: true # Authentication, authorization, data protection
28-
assess_reliability: true # Error handling, recovery, availability
29-
assess_maintainability: true # Code quality, test coverage, documentation
30-
31-
# Custom NFR categories (comma-separated)
32-
custom_nfr_categories: "" # e.g., "accessibility,internationalization,compliance"
33-
34-
# Evidence sources
35-
test_results_dir: "{project-root}/test-results"
36-
metrics_dir: "{project-root}/metrics"
37-
logs_dir: "{project-root}/logs"
38-
include_ci_results: true # Analyze CI/CD pipeline results
39-
40-
# Thresholds (can be overridden)
41-
performance_response_time_ms: 500 # Target response time
42-
performance_throughput_rps: 100 # Target requests per second
43-
security_score_min: 85 # Minimum security score (0-100)
44-
reliability_uptime_pct: 99.9 # Target uptime percentage
45-
maintainability_coverage_pct: 80 # Minimum test coverage
46-
47-
# Assessment configuration
48-
use_deterministic_rules: true # PASS/CONCERNS/FAIL based on evidence
49-
never_guess_thresholds: true # Mark as CONCERNS if threshold unknown
50-
require_evidence: true # Every NFR must have evidence or be called out
51-
suggest_monitoring: true # Recommend monitoring hooks for gaps
52-
53-
# Integration with BMad artifacts
54-
use_tech_spec: true # Load tech-spec.md for NFR requirements
55-
use_prd: true # Load PRD.md for NFR context
56-
use_test_design: true # Load test-design.md for NFR test plan
57-
58-
# Output configuration
59-
output_file: "{output_folder}/nfr-assessment.md"
60-
generate_gate_yaml: true # Create gate YAML snippet with NFR status
61-
generate_evidence_checklist: true # Create checklist of evidence gaps
62-
update_story_file: false # Add NFR section to story (optional)
63-
64-
# Quality gates
65-
fail_on_critical_nfr: true # Fail if critical NFR has FAIL status
66-
warn_on_concerns: true # Warn if any NFR has CONCERNS status
67-
block_release_on_fail: true # Block release if NFR assessment fails
68-
69-
# Advanced options
70-
auto_load_knowledge: true # Load nfr-criteria, ci-burn-in fragments
71-
include_quick_wins: true # Suggest quick wins for concerns/failures
72-
include_recommended_actions: true # Provide actionable remediation steps
21+
# NFR category assessment (defaults to all categories)
22+
custom_nfr_categories: "" # Optional additional categories beyond standard (security, performance, reliability, maintainability)
7323

7424
# Output configuration
7525
default_output_file: "{output_folder}/nfr-assessment.md"

src/modules/bmm/workflows/testarch/test-design/workflow.yaml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,7 @@ template: "{installed_path}/test-design-template.md"
1818

1919
# Variables and inputs
2020
variables:
21-
# Target scope
22-
epic_num: "" # Epic number for scoped design
23-
story_path: "" # Specific story for design (optional)
24-
design_level: "full" # full, targeted, minimal
25-
26-
# Risk assessment configuration
27-
risk_assessment_enabled: true
28-
risk_threshold: 6 # Scores >= 6 are high-priority (probability × impact)
29-
risk_categories: "TECH,SEC,PERF,DATA,BUS,OPS" # Comma-separated
30-
31-
# Coverage planning
32-
priority_levels: "P0,P1,P2,P3" # Test priorities
33-
test_levels: "e2e,api,integration,unit,component" # Test levels to consider
34-
selective_testing_strategy: "risk-based" # risk-based, coverage-based, hybrid
35-
36-
# Output configuration
37-
output_file: "{output_folder}/test-design-epic-{epic_num}.md"
38-
include_risk_matrix: true
39-
include_coverage_matrix: true
40-
include_execution_order: true
41-
include_resource_estimates: true
42-
43-
# Advanced options
44-
auto_load_knowledge: true # Load relevant knowledge fragments
45-
include_mitigation_plan: true
46-
include_gate_criteria: true
47-
standalone_mode: false # Can run without epic context
21+
design_level: "full" # full, targeted, minimal - scope of design effort
4822

4923
# Output configuration
5024
default_output_file: "{output_folder}/test-design-epic-{epic_num}.md"

src/modules/bmm/workflows/testarch/test-review/workflow.yaml

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -18,54 +18,9 @@ template: "{installed_path}/test-review-template.md"
1818

1919
# Variables and inputs
2020
variables:
21-
# Review target
22-
test_file_path: "" # Explicit test file to review (if not provided, auto-discover)
23-
test_dir: "{project-root}/tests"
21+
test_dir: "{project-root}/tests" # Root test directory
2422
review_scope: "single" # single (one file), directory (folder), suite (all tests)
2523

26-
# Review configuration
27-
quality_score_enabled: true # Calculate 0-100 quality score
28-
append_to_file: false # true = inline comments, false = separate report
29-
check_against_knowledge: true # Use tea-index.csv fragments for validation
30-
strict_mode: false # Strict = fail on any violation, Relaxed = advisory only
31-
32-
# Quality criteria to check
33-
check_given_when_then: true # BDD format validation
34-
check_test_ids: true # Test ID conventions (e.g., 1.3-E2E-001)
35-
check_priority_markers: true # P0/P1/P2/P3 classification
36-
check_hard_waits: true # Detect sleep(), wait(X), hardcoded delays
37-
check_determinism: true # No conditionals (if/else), no try/catch abuse
38-
check_isolation: true # Tests clean up, no shared state
39-
check_fixture_patterns: true # Pure function → Fixture → mergeTests
40-
check_data_factories: true # Factory usage vs hardcoded data
41-
check_network_first: true # Route intercept before navigate
42-
check_assertions: true # Explicit assertions, not implicit waits
43-
check_test_length: true # Warn if >300 lines per file
44-
check_test_duration: true # Warn if individual test >1.5 min
45-
check_flakiness_patterns: true # Common flaky patterns (race conditions, timing)
46-
47-
# Integration with BMad artifacts
48-
use_story_file: true # Load story for context (acceptance criteria)
49-
use_test_design: true # Load test-design for priority context
50-
auto_discover_story: true # Find related story by test ID
51-
52-
# Output configuration
53-
output_file: "{output_folder}/test-review-{filename}.md"
54-
generate_inline_comments: false # Add TODO comments in test files
55-
generate_quality_badge: true # Create quality badge/score
56-
append_to_story: false # Add review section to story file
57-
58-
# Knowledge base fragments to load
59-
knowledge_fragments:
60-
- test-quality.md # Definition of Done for tests
61-
- fixture-architecture.md # Pure function → Fixture patterns
62-
- network-first.md # Route interception before navigation
63-
- data-factories.md # Factory patterns and best practices
64-
- test-levels-framework.md # E2E vs API vs Component vs Unit
65-
- playwright-config.md # Configuration patterns (if Playwright)
66-
- tdd-cycles.md # Red-Green-Refactor patterns
67-
- selective-testing.md # Duplicate coverage detection
68-
6924
# Output configuration
7025
default_output_file: "{output_folder}/test-review.md"
7126

0 commit comments

Comments
 (0)