Skip to Content
Solution PlaysPlay 101: Play 101 β€” Pester Test Development πŸ§ͺ

Play 101 β€” Pester Test Development πŸ§ͺ

The golden template β€” AI-powered Pester 5.x test generation for PowerShell, AST-driven analysis, comprehensive mocking, >90% code coverage.

Build production-grade Pester test suites from PowerShell code. AST analysis identifies testable functions, the builder generates Describe/Context/It blocks with proper mocking, the reviewer validates assertion quality and coverage gaps, and the tuner eliminates flaky tests and optimizes CI/CD integration.

Quick Start

cd solution-plays/101-pester-test-development code . # Use @builder to generate tests, @reviewer to audit, @tuner to optimize

Architecture

πŸ“ Full architecture details

ComponentPurpose
PowerShell ASTParse source code to identify testable functions
Pester 5.xTest framework with Describe/Context/It blocks
Mock SystemInModuleScope, Mock, Should assertions
Code CoverageInvoke-Pester with -CodeCoverage for >90% target

Pre-Tuned Defaults

  • Coverage: >90% target Β· function-level Β· branch analysis
  • Mocking: InModuleScope for module functions Β· Mock external deps
  • CI/CD: GitHub Actions + Azure DevOps pipeline templates
  • Quality: No flaky tests Β· deterministic assertions Β· proper teardown

DevKit (AI-Assisted Development)

PrimitiveWhat It Does
agent.mdRoot orchestrator with builder→reviewer→tuner handoffs
copilot-instructions.mdPester domain (AST, mocking, coverage, CI/CD patterns)
3 agentsBuilder (gpt-4o), Reviewer (gpt-4o-mini), Tuner (gpt-4o-mini)
4 skillsDeploy (149 lines), Evaluate (173 lines), Generate Tests (180 lines), Tune (221 lines)
4 prompts/deploy, /test, /review, /evaluate with agent routing

The Golden Template

Play 101 is special β€” it was the first v2 play and established the patterns used by all 100 other plays:

  • builderβ†’reviewerβ†’tuner handoff chain
  • Model differentiation (gpt-4o for builder, gpt-4o-mini for reviewer/tuner)
  • 4 agent-routed prompts
  • Skills with 100+ lines of domain procedures

Cost Estimate

ServiceDev/moProd/moEnterprise/mo
Azure OpenAI$15 (PAYG)$150 (PAYG)$400 (PAYG)
Azure DevOps$0 (Free tier)$40 (Basic)$120 (Basic + Hosted)
Azure Storage$1 (LRS Hot)$10 (LRS Hot)$30 (ZRS Hot)
Application Insights$0 (Free)$15 (Pay-per-GB)$40 (Pay-per-GB)
Total$16$215$590

πŸ’° Full cost breakdown

πŸ“– Full documentation Β· 🌐 frootai.dev/solution-plays/101-pester-test-developmentΒ  Β· πŸ“¦ FAI Protocol

FAI Manifest

FieldValue
Play101-pester-test-development
Version1.0.0
KnowledgeT3-Production-Patterns, O3-MCP-Tools
WAF Pillarsreliability, operational-excellence, security
Last updated on