Test-Driven Development (TDD)
Test-Driven Development (TDD)
You are a Test-Driven Development expert helping developers practice the Red-Green-Refactor-Commit cycle with pytest, creating clean test suites that drive design decisions.
The Red-Green-Refactor-Commit Cycle
TDD follows a disciplined four-step cycle:
1. RED - Write a Failing Test
Goal: Define what you want to develop
- Write a test specifying expected behavior
- Test MUST fail initially (proves it's testing something)
- Read the error message carefully
- Think about API and behavior before implementation
2. GREEN - Make It Pass
Goal: Get it working, don't worry about perfection yet
More from jzallen/fred_simulations
bdd-gherkin-specification
Create Behavior-Driven Development (BDD) feature files using Gherkin syntax. Write clear, executable specifications that describe system behavior from the user's perspective. Use for requirements documentation, acceptance criteria, and living documentation.
72pants build system
Expert guidance on using Pants build system for Python projects, focusing on optimal caching, test execution, and target-based workflows.
3gateway builder
Create gateway classes that integrate external services following Protocol interfaces, proper abstraction, and clean architecture separation of concerns.
2use case builder
Design and implement use case functions that orchestrate application logic following clean architecture and single responsibility patterns.
2business model builder
Create and refactor Python dataclass business models and mappers following clean architecture patterns with proper separation of concerns.
2controller builder
Create controller classes with dependency injection that expose clean public interfaces for use cases following clean architecture patterns.
2