Testing Test Driven Development (TDD)
Apply rigorous test-driven development methodology following the Red-Green-Refactor cycle (write failing test, implement minimal code to pass, refactor while staying green) that ensures tests genuinely verify behavior by requiring observed failure before implementation, preventing untested code and false-positive tests. Use this skill when implementing any new feature or functionality in any programming language, when fixing bugs or resolving defects in existing code, when refactoring code to improve design while preserving behavior, when adding new methods, functions, classes, or modules to a codebase, when modifying existing behavior or business logic, when writing code in any file that will be executed in production environments, when creating API endpoints, service methods, or controller actions, when implementing data validation, transformation, or processing logic, when building user interface components with testable behavior, when writing algorithms, calculations, or business rules, when integrating with external APIs, databases, or third-party services, when you're about to write production code without having written a test first, when you've already written implementation code and need to delete it to start with TDD, when someone suggests "writing tests after" to save time, when under time pressure and tempted to skip testing, when a task seems "too simple to test", before making any code change that could affect application behavior, or when working on any code that is not throwaway prototypes, generated code, or configuration files (which are the only exceptions that require explicit partner approval).
7
0
2025年10月29日 14:48